OpenAI-Codex-CLI-智能体编程实战指南-七-

OpenAI Codex CLI 智能体编程实战指南(七)

原文:Agentic Coding with OpenAI Codex CLI

译者:飞龙

协议:CC BY-NC-SA 4.0

参考文献

文献列表

  1. David Sanchez (Microsoft),“DevOps Practices and Principles for the Agentic Era: Strategic Direction”(智能体时代的 DevOps 实践与原则:战略方向),Microsoft DevBlogs,2026 年 4 月 15 日。四大协作区域、三层流水线验证及智能体采用成熟度模型。 https://devblogs.microsoft.com/all-things-azure/agentic-devops-practices-principles-strategic-direction/

  2. Docker,“Docker MCP Catalog: Discover and Run Secure MCP Servers”(Docker MCP 目录:发现并运行安全的 MCP 服务器),Docker Blog,2025,https://www.docker.com/blog/docker-mcp-catalog-secure-way-to-discover-and-run-mcp-servers/;Docker,“MCP Toolkit: Run MCP Servers Securely”(MCP 工具包:安全运行 MCP 服务器),Docker Blog,2025,https://www.docker.com/blog/mcp-toolkit-mcp-servers-that-just-work/。MCP 工具包将经过验证的 MCP 服务器打包为具有受限权限、资源上限、凭据注入和输出扫描的容器镜像。

  3. Figma 宣布其官方 Dev Mode MCP 服务器进入测试版,向兼容 MCP 的客户端暴露设计文件数据,包括组件、变量和布局约束。该服务器适用于所有 Figma 计划,但免费层级有速率限制。 https://www.figma.com/blog/introducing-figma-mcp-server/

  4. Geoffrey Huntley,“The Ralph Wiggum as a Software Engineer”(《辛普森一家》中的 Ralph Wiggum 做软件工程师),2025 年 7 月 14 日。Ralph loop 模式的起源,得名于《辛普森一家》中的 Ralph Wiggum。 https://ghuntley.com/ralph/

  5. GitHub Blog 上的 Git 2.5 发布公告,描述了 multiple-worktrees(多工作树)功能及其相比克隆的性能优势。 https://github.blog/open-source/git/git-2-5-including-multiple-worktrees-and-triangular-workflows/

  6. GitHub,“GitHub Copilot Coding Agent”(GitHub Copilot 编码智能体),GitHub Blog,2025。 https://github.blog/news-insights/product-news/github-copilot-workspace/

  7. GitHub,“GitHub Copilot is generally available to all developers”(GitHub Copilot 面向所有开发者正式发布),GitHub Blog,2022 年 6 月。 https://github.blog/news-insights/product-news/github-copilot-is-generally-available-to-all-developers/

  8. GitHub,“Introducing GitHub Copilot: your AI pair programmer”(推出 GitHub Copilot:你的 AI 结对程序员),GitHub Blog,2021 年 6 月 29 日。 https://github.blog/news-insights/product-news/introducing-github-copilot-ai-pair-programmer/

  9. Google,“Gemini CLI sunset notice”(Gemini CLI 停服通知),I/O 2026,2026 年 5 月 19 日。Gemini CLI 已弃用,截止日期为 2026 年 6 月 18 日。建议迁移至 Antigravity CLI。 https://developers.googleblog.com/an-important-update-transitioning-gemini-cli-to-antigravity-cli/

  10. htek.dev,“All Agent Harnesses: The Live Comparison”(所有智能体测试框架:实时对比),https://dev.to/htekdev/all-agent-harnesses-the-live-comparison-1km5(亦发布于 https://htek.dev/articles/all-agent-harnesses-live-comparison),访问于 2026 年 5 月。跨多个评估维度(包括工具使用、记忆、多智能体能力、沙箱、治理、可扩展性、IDE 集成、CLI 支持、部署、定价和开源状态)的从业者实时对比,确认测试框架的选择优于模型选择。

  11. JetBrains,“Which AI Coding Tools Do Developers Actually Use at Work?”(开发者在工作中实际使用哪些 AI 编码工具?),JetBrains Research Blog,2026。 https://blog.jetbrains.com/research/2026/04/which-ai-coding-tools-do-developers-actually-use-at-work/

  12. Mejba Ahmed,“Cross-Model Adversarial Review: Codex + Opus 4.6”(跨模型对抗性审查:Codex + Opus 4.6),2026 年 5 月。受控实验显示,在 API 成本低于 2 美元的情况下,互补模型盲点带来的问题检测能力提升了 2.75 倍。 https://www.mejba.me/blog/codex-plugin-claude-code-adversarial-review

  13. React 19 于 2024 年 12 月发布稳定版。执行自动备忘的 React Compiler 是一项关键功能,它改变了围绕 useMemo 和 useCallback 的推荐模式。 https://react.dev/blog/2024/12/05/react-19

  14. Squintist,“Why Everyone Is Quietly Quitting OpenClaw”(为何大家都在悄悄弃用 OpenClaw),YouTube,2026 年 4 月 23 日,https://www.youtube.com/watch?v=urAMvpPhtqo。记录了 OpenClaw 增长至 247,000 颗星后的用户流失。关键失效模式:每月 86 美元的心跳令牌消耗、上下文压缩导致安全规则丢失、通过邮件注入提示窃取 SSH 密钥、升级导致记忆丢失。幸存用户独立收敛于类测试框架的实战手册。

  15. Strangler Fig(绞杀无花果)模式是一种软件迁移策略,在现有系统旁增量构建新系统,逐步将功能从旧系统路由至新系统,直到原系统可被退役。Martin Fowler 将其描述为优于大爆炸式重写,因为它能持续交付价值并保留回滚路径。 https://martinfowler.com/bliki/StranglerFigApplication.html

  16. Tony Lee,“How Codex Solves the L1-Bulletion Problem Differently”(Codex 如何以不同方式解决 L1-Bulletion 问题),https://tonylee.im/en/blog/codex-compaction-encrypted-summary-session-handover/,访问于 2026 年 4 月。

  17. van Riel, Z.,“I Quit My GitHub Job Because AI Breaks Software”(我辞去 GitHub 工作,因为 AI 破坏了软件),2026 年 4 月。前 GitHub 高级工程师 Van Riel 认为,当一名开发者产生的代码量是原来的 100 倍时,“他们无法再有意义地审查所生成的内容”,从而从统计学上保证了未被发现的 Bug 存在。 https://www.youtube.com/watch?v=aEL384kTznk

  18. Vivek Trivedy,“Improving Deep Agents with Harness Engineering”(通过测试框架工程改进深度智能体),LangChain Blog,2026 年 2 月,https://www.langchain.com/blog/improving-deep-agents-with-harness-engineering。记录了仅通过测试框架中间件变更(模型保持不变),将 Terminal Bench 2.0 排名从第 30 位提升至第 5 位。

标准、规范与基础

  1. Agent Skills 生态增长,2026 年 5 月。跨 40 多个产品的广泛跨平台采用,数千个已发布的技能。 https://agentskills.io

  2. Agent Skills 规范,“渐进式披露加载模型”,https://agentskills.io/specification,访问于 2026 年 3 月。

  3. AGENTS.md 官方规范站点。 https://agents.md/

  4. AGENTS.md 由 OpenAI 于 2025 年 8 月开源,并于 2025 年 12 月捐赠给 Linux 基金会下的 Agentic AI Foundation (AAIF),使其成为由中立机构管理的开放标准,创始支持者包括 Anthropic、Block 和 OpenAI。 https://www.linuxfoundation.org/press/linux-foundation-announces-the-formation-of-the-agentic-ai-foundation

  5. NVIDIA AI Red Team,“Indirect AGENTS.md Injection via Malicious Dependencies”(通过恶意依赖进行间接 AGENTS.md 注入),2026 年 4 月。利用一个在 go mod tidy 期间写入恶意 AGENTS.md 的 Go 模块进行概念验证。

工具与开源项目

  1. Agent Skills 规范仓库,https://github.com/agentskills/agentskills,访问于 2026 年 3 月。

  2. Agent Skills,skills-ref 参考验证器(Python,从源码安装),https://github.com/agentskills/agentskills/tree/main/skills-ref,访问于 2026 年 6 月。

  3. aigorahub,“Elves: Autonomous Multi-Batch Development Skill”(Elves:自主多批次开发技能),2026。分层记忆与策略性遗忘、宪法判断,以及 100:1–500:1 的自主比率。 https://github.com/aigorahub/elves

  4. Anthropic,Claude Code 文档。 https://docs.anthropic.com/en/docs/claude-code

  5. axe-core 是由 Deque Systems 维护的开源无障碍测试引擎,于 2015 年开源。它覆盖 WCAG 2.0、2.1 和 2.2 的 A、AA 和 AAA 级别,也是 Google Lighthouse 无障碍审计背后的引擎。 https://github.com/dequelabs/axe-core

  6. Cline 贡献者,“Cline: Autonomous coding agent for VS Code”(Cline:VS Code 的自主编码智能体),GitHub,https://github.com/cline/cline

参考资料

工具与平台

  1. Codexia:一个用于 Codex CLI 和 Claude Code 的轻量级代理工作站,基于 Tauri v2 构建,内置 Git worktree 管理、任务调度器、远程控制和技能管理。github.com/milisp/codexia

  2. DeusData,“codebase-memory-mcp:高性能代码智能 MCP 服务器”,GitHub,2026。支持 66 种语言的 Tree-Sitter AST 知识图谱,查询延迟达亚毫秒级。github.com/DeusData/codebase-memory-mcp

  3. GitHub Actions actions/checkout 文档指出,fetch-depth: 0 是获取完整历史记录所必需的,用于 git rebase 和 git worktree 等操作。docs.github.com/en/actions

  4. GitHub Actions permissions 键文档。docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions

  5. GitHub Copilot 代理模式(交互式、异步编码代理和 CLI)。docs.github.com/copilot

  6. GitHub Copilot,最初的 AI 结对编程工具,于 2021 年作为技术预览版首次推出,由 GitHub、OpenAI 和 Microsoft 开发的生成式 AI 模型提供支持。github.com/features/copilot

  7. GitHub 合并队列文档:合并队列确保在合并前分支针对目标分支的最新版本进行测试,防止并发 PR 导致的集成失败。docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue

  8. Gitleaks,“使用 Gitleaks 查找机密”,github.com/gitleaks/gitleaks,访问于 2026 年 3 月。Gitleaks 是一款开源 SAST 工具,用于检测 Git 仓库中硬编码的机密(API 密钥、密码、令牌),截至 2026 年初,在 GitHub 上拥有超过 19,000 颗星和 2000 万次 Docker 下载。

  9. Google,“Agent Skills”,2026。github.com/google/skills

  10. Google,Gemini API 和 terminal-agent 文档。ai.google.dev/gemini-api/docs

  11. mgechev/skillgrade,“您的代理技能的单元测试”,github.com/mgechev/skillgrade,访问于 2026 年 6 月。

  12. Microsoft,“APM —— Agent Package Manager”,GitHub,2026。github.com/microsoft/apm

  13. Microsoft,“Playwright MCP”,GitHub。文档指出,编码代理越来越倾向于将作为技能暴露的令牌高效 CLI 工作流,而非 MCP,并引导用户使用 microsoft/playwright-cli,同时将 MCP 服务器定位为需要持久状态和页面内省的代理循环。github.com/microsoft/playwright-mcp

  14. NanoClaw,一个轻量级容器隔离的代理编排器:单个主机进程将通道消息路由到沙箱容器中的每会话代理,由 SQLite 任务和会话注册表以及计划作业提供支持。github.com/nanocoai/nanoclaw

  15. Nathan Onn,Skill Creator V2:具有并行变体比较的自动化技能基准测试。每次基准测试运行消耗约 74,000 个令牌。github.com/nathanonn/skill-creator-v2

  16. OpenAI,“skills”仓库,GitHub。系统和精选技能层级。github.com/openai/skills

  17. OpenCode,一个开源 CLI 代理,在宽松许可证下支持多种模型提供商。github.com/anomalyco/opencode

  18. ProAlexUSC,“cc-plugin-to-codex”,github.com/ProAlexUSC/cc-plugin-to-codex,访问于 2026 年 4 月。跨工具插件桥接,实现 Claude Code 和 Codex 生态系统之间的插件组件可移植性。

  19. RTK (Rust Token Killer),AI 编码代理的命令输出代理。README 报告常见开发者命令可实现 60% 到 90% 的令牌减少,并通过 rtk init -g --codex 进行 Codex 初始化;架构文档涵盖智能过滤、分组、截断、去重和令牌追踪;Issue #582 记录了一个输入令牌减少但总成本反而增加的案例。github.com/rtk-ai/rtk,github.com/rtk-ai/rtk/blob/master/docs/contributing/ARCHITECTURE.md,github.com/rtk-ai/rtk/issues/582

  20. Ruff 是一个用 Rust 编写的快速 Python linter 和格式化工具,由 Astral 开发。它重新实现了来自 Flake8、Black、isort 和 pyupgrade 的 800 多条 lint 规则,可在亚秒级时间内处理大型代码库。github.com/astral-sh/ruff

  21. skills.sh,社区技能 CLI 和注册表,skills.sh,访问于 2026 年 6 月。

  22. squeez,一个用于包括 Codex CLI 在内的 AI CLI 的基于钩子的令牌压缩器,其“原始人”人设会丢弃冠词和填充词,同时保留代码、技术术语和确切的错误消息。《Business Insider》的原始人语言实验是一个警示性轶事:节省了令牌但质量下降。github.com/claudioemmanuel/squeez 和 www.businessinsider.com/claude-caveman-speak-prompt-save-tokens-results-worse-2026-5

  23. Tessl,托管技能注册表和生命周期平台,tessl.io,访问于 2026 年 6 月。注册表视图见 tessl.io/registry/discover?contentType=skills。

  24. uv 是一个用 Rust 编写的快速 Python 包和项目管理器,由 Astral 开发。它以单个二进制文件替代了 pip、venv、pyenv、pipx 和 poetry,并生成 uv.lock 锁文件以实现可复现的环境。github.com/astral-sh/uv

作者已发表文章

  1. Codex CLI for Bazel Builds,Codex Resources,2026 年 5 月。远程执行、单体仓库模式、代理驱动的构建智能。danielvaughan.github.io/codex-resources/articles/2026-05-30-codex-cli-bazel-builds/

  2. Codex CLI Goal Mode 操作模型:生命周期状态(pursuing、paused、achieved、unmet、budget_limited)和基于审计的完成检查。blog.danielvaughan.com/codex-cli-goal-mode-define-done-not-next-c8d13213ea7c

  3. 合并的 codex exec CI/CD 模式参考。另见:Vaughan, D.,“Codex CLI Non-Interactive Pipelines”,codex-resources,2026 年 5 月。

  4. Hermetic codex exec 模式。另见:danielvaughan.com/codex-resources/articles/2026-04-25-codex-exec-hermetic-runs-isolation-flags-reproducible-ci-pipelines/。

  5. Codex CLI 的非交互式流水线模式。exec、resume、结构化输出和 JSONL 流式传输。见 “Codex CLI Non-Interactive Pipelines”,codex-resources,2026 年 5 月。

  6. MSR 2026 Mining Challenge(挖掘挑战赛) 产出了五项独立研究,分析了包含 61,000 个仓库中 933,000 多个代理式 PR 的 AIDev 数据集。Vaughan, D.,“What 33,000 Agentic Pull Requests Reveal: Empirical Lessons for Codex CLI Practitioners”,codex-resources,2026 年 4 月。

  7. Vaughan, D.,“Agent Fingerprints in Pull Requests: MSR 2026 Research and Git Hygiene”,codex-resources,2026 年 4 月。对 AI 生成代码中可检测模式的分析及对归因和审查校准的建议。

  8. Vaughan, D.,“AutoLoop with Codex CLI: Bounded Optimisation Loops for Measurable Codebase Improvement”,codex-resources,2026 年 5 月。将 Karpathy 的 autoresearch(21K 颗星)推广到具有路径作用域 Git 操作的代码库改进中。danielvaughan.com/codex-resources/articles/2026-05-10-autoloop-codex-cli-bounded-optimisation-loops-agent-agnostic-iterative-improvement/

参考文献

Vaughan 系列文章

  1. Vaughan, D., “Automated CI Failure Recovery with Codex CLI: Self-Healing Pipelines from GitHub Actions to GitLab CI,” codex-resources, April 2026. https://danielvaughan.com/codex-resources/articles/2026-04-20-codex-cli-ci-autofix-self-healing-pipelines-github-actions-gitlab/

  2. Vaughan, D., “Codex CLI for Day-Two Operations: Runbooks, Drift Detection, and Platform Engineering Automation,” codex-resources, May 2026. https://danielvaughan.com/codex-resources/articles/2026-05-15-codex-cli-day-two-operations-runbooks-drift-detection-platform-engineering/

  3. Vaughan, D., “Codex CLI for GitOps Workflows: ArgoCD Application Generation, Kustomize Overlay Management, and Environment Promotion Pipelines,” codex-resources, May 2026. https://danielvaughan.com/codex-resources/articles/2026-05-17-codex-cli-gitops-argocd-flux-kustomize-environment-promotion-pipelines/

  4. Vaughan, D., “Codex CLI for Terraform and Infrastructure as Code: The MCP Server, TerraShark, and Agent-Driven IaC Workflows,” codex-resources, June 2026. https://danielvaughan.com/codex-resources/articles/2026-06-10-codex-cli-terraform-infrastructure-as-code-mcp-server-terrashark-pulumi-agent-skills/; and “Codex CLI for Terraform Development: terraform-mcp-server, State Inspection, and Infrastructure Drift Detection,” codex-resources, May 2026. https://danielvaughan.com/codex-resources/articles/2026-05-25-codex-cli-terraform-development-mcp-server-state-inspection-drift-detection/

  5. Vaughan, D., “The Real Cost of Multi-Model Review Loops,” codex-resources, April 2026. Cost modelling across single, two, and three-model review architectures.

  6. Vaughan, D., “Codex Browser Use: Closing the Verification Loop,” codex-resources, April 2026. Agents can render, click, and visually verify frontend output in a headless browser.

其他来源

  1. 2to3 是 Python 标准库工具(在 lib2to3 包中),可自动将 Python 2 源代码转换为 Python 3 语法。它处理大多数机械转换(print 语句、unicode 与 str 以及整数除法),但不处理所有习惯用法更新或依赖兼容性问题。https://docs.python.org/3/library/2to3.html

  2. Add Memory to OpenAI Codex — Persistent Development Context — Basic Memory. Markdown-first approach with cross-client interoperability. https://docs.basicmemory.com/integrations/codex

  3. Amdahl 定律由 Gene Amdahl 于 1967 年提出,指出并行化程序的理论加速比受必须保持顺序执行的任务部分所限制。https://en.wikipedia.org/wiki/Amdahl's_law

  4. AngularJS(Angular 1.x)和 Angular(2+)在架构上不兼容。Angular 2 是一次完全重写,引入了基于组件的架构、TypeScript 和新的模块系统,与 AngularJS 的 MVC 控制器模式没有向后兼容性。https://angular.dev/guide/migration

  5. Anthropic, “Anthropic Opens Agent Skills Standard,” cited in Unite.AI, https://www.unite.ai/anthropic-opens-agent-skills-standard-continuing-its-pattern-of-building-industry-infrastructure/ , December 2025, accessed March 2026.

  6. Anthropic, “Claude Code documentation,” https://code.claude.com/docs/en/getting-started

  7. Anysphere, “Cursor – The AI Code Editor,” https://cursor.com

  8. Codex CLI 代理循环的架构概述:提交/事件队列模式、ToolRouter 分发、审批门控状态机,以及通过 Landlock LSM 和 Seatbelt 配置文件实现的内核级沙箱强制执行。https://deepwiki.com/openai/codex

  9. AWS, “Quotas for Amazon Bedrock.” AWS 账户拥有 Amazon Bedrock 的默认每账户配额。https://docs.aws.amazon.com/bedrock/latest/userguide/quotas.html

  10. Coasts:用于并行开发环境的运行时隔离工具。动态端口分配、特定服务的重新分配策略、数据拓扑控制和 Coastguard 可观测性 UI。https://coasts.dev and https://github.com/coast-guard/coasts

  11. Codex CLI 需要 Node.js 22.0.0 或更高版本。https://nodejs.org/en/about/previous-releases

  12. 静态分析和语言模型可检测的常见安全反模式包括:通过字符串拼接进行 SQL 注入、危险地使用 eval()、缺少认证中间件以及凭据泄露。这些类别在 OWASP Top 10 中有详细记录。https://owasp.org/www-project-top-ten/

  13. Context compaction regression documented in the Codex CLI issue tracker. Bug report documenting 2× more frequent compactions causing token usage explosion.

  14. Context Health Monitoring in Codex CLI, May 2026. Documents compaction telemetry gaps, degradation detection patterns, and configuration levers for long-session quality management.

  15. Conventional Commits specification. https://www.conventionalcommits.org/en/v1.0.0/

  16. Cursor harness testing note, April 2026. Industry convergence on harness-centric engineering patterns: bespoke per-model prompts/tools, mixed offline+online evals, context window as primary compute boundary.

  17. Dagger Container-Use MCP Server. Containerised build pipeline functions exposed as MCP tools. https://dagger.io

  18. Ehsani et al., “Why Do AI-Generated Pull Requests Get Rejected?,” MSR 2026 Mining Challenge. Analysis of 33,596 agentic PRs identifying a 28.52 per cent failure rate with reviewer abandonment as the dominant failure mode.

  19. Embiricos, A. “Advanced Codex Workflows.” How I AI podcast, Lenny’s Newsletter, 2026.

  20. FastAPI 是一个基于 Starlette 和 Pydantic 构建的高性能 Python Web 框架。The State of Python 2025 调查报告称 FastAPI 使用份额在一年内从 29% 增长至 38%。https://fastapi.tiangolo.com/

  21. Gauthier, P., “Aider: AI pair programming in your terminal,” https://aider.chat/

  22. Git 强制执行每个工作树一个分支的约束以防止索引冲突;尝试检出已在另一个工作树中检出的分支会返回错误。https://git-scm.com/docs/git-worktree

  23. GitLab Docs, “External agents.” https://docs.gitlab.com/user/duo_agent_platform/agents/external/

  24. GitLab Docs, “GitLab MCP server.” https://docs.gitlab.com/user/gitlab_duo/model_context_protocol/mcp_server/

  25. GitLab Inc., “GitLab Announces the General Availability of GitLab Duo Agent Platform,” 15 January 2026. https://ir.gitlab.com/news/news-details/2026/GitLab-Announces-the-General-Availability-of-GitLab-Duo-Agent-Platform/default.aspx

  26. IntuitionLabs, “Meta-Prompting: LLMs Crafting & Enhancing Their Own Prompts,” 2026. https://intuitionlabs.ai/articles/meta-prompting-llm-self-optimization

  27. Kleinloog/VIA Research, “The Complete Landscape of CLI-Based AI Coding Agents,” 2026, https://www.kleinloog.ch/articles/the-5-ai-coding-agents-worth-embedding-in-your-saas/the-complete-landscape-of-cli-based-ai-coding-agents.pdf. The SaaS readiness matrix scores eleven CLI agents across architecture, SDK availability, session management, MCP extensibility, air-gap capability, and licensing dimensions. Codex CLI is placed in Tier 2 with strong SDK and model ecosystem but gaps in session persistence and OSS licensing.

参考文献

  1. 内存系统 — DeepWiki / openai/codex。 从开源 Rust 实现衍生出的技术架构文档,涵盖双阶段流水线、存储架构、密钥清理边界、使用追踪和修剪机制。deepwiki.com/openai/codex/3.9-memories-system

  2. 微软,“Microsoft Foundry 模型中的 Azure OpenAI 配额和限制。” 每分钟令牌数和每分钟请求数限制按区域、订阅、模型或部署类型定义。learn.microsoft.com/azure/ai-services/openai/quotas-limits

  3. mypy 是一个符合 PEP 484 的 Python 静态类型检查器。它支持严格模式以实现最大覆盖率。mypy-lang.org/

  4. Nate Herk,“1 小时精通 Codex 97%”, 2026 年 5 月。手动构建再编码技能开发工作流的全程演示,包括全局与项目级决策规则、浏览器使用 QA 门控和模型选择指南。youtu.be/3TdD8Qv5Tk8

  5. NVIDIA DGX Spark GB10 Grace Blackwell 硬件、128 GB 统一内存及当前价格的市场列表。marketplace.nvidia.com/en-us/developer/dgx-spark/

  6. OpenAI Cookbook,“使用再训练循环构建自我进化智能体”, 2026 年 4 月。四阶段再训练循环(基线、评估、优化、部署)参考架构。

  7. Opsera,《AI 编码影响力 2026 基准报告》, 2026 年 1 月。对 60 多家企业组织中 25 万多名开发者的分析。opsera.ai/resources/report/ai-coding-impact-2026-benchmark-report/

  8. Penligent,“Git Worktrees 进行并行 AI 智能体开发需要运行时隔离”, 2026 年 3 月。识别出端口冲突、数据库碰撞、环境变量泄漏和 Docker 守护进程共享是基于 worktree 的并行智能体工作流中的结构性缺口。www.penligent.ai/hackinglabs/git-worktrees-need-runtime-isolation-for-parallel-ai-agent-development/

  9. PEP 604,在 Python 3.10 中被接受,引入了 X | Y 联合类型语法,允许将 str | None 作为 Optional[str] 的更简洁替代方案。在 Python 3.9 中配合 from __future__ import annotations 也可用。peps.python.org/pep-0604/

  10. Pham 和 Ghaleb,“智能体编写的 PR 描述质量与代码周转率”, MSR 2026 Mining Challenge。发现智能体编写代码的中位符号存活期为 3 天,而人类代码为 34 天。

  11. 提示注入风险 由 Simon Willison 记录在案。simonwillison.net/series/prompt-injection/

  12. 沙箱架构:Codex CLI 文档。 www.mintlify.com/openai/codex/architecture/sandboxing

  13. SigNoz,“使用 OpenTelemetry 进行 OpenAI Codex 可观测性与监控”, SigNoz 文档,2026 年。signoz.io/docs/codex-monitoring/

  14. 静默截断行为 记录在 Codex CLI 问题追踪器中。

  15. Simon Zhou,“调查 Codex 上下文压缩的工作原理”, simzhou.com/en/posts/2026/how-codex-compacts-context/,访问于 2026 年 4 月。

  16. Sourcery Intel,《AI 编码智能体现状 — 2026》。 AI 编码智能体领域的市场分析、基准数据和安全发现。sourceryintel.com/reports/the-state-of-ai-coding-agents-2026

  17. Terminal-Bench 2.0 是 Laude Institute 和斯坦福大学的联合项目,在 Docker 容器化的终端环境中评估 89 个精选任务。www.tbench.ai/ 以及排行榜 www.tbench.ai/leaderboard/terminal-bench/2.0

  18. Testing Library 的 @testing-library/user-event 包 模拟真实用户交互,包括完整的事件序列(pointerdown、mousedown、focus、click),而 fireEvent 仅分派单个合成 DOM 事件。这种区别对于测试依赖事件顺序的组件至关重要。testing-library.com/docs/user-event/intro

  19. 常量 PROJECT_DOC_MAX_BYTES 默认为 32 * 1024 (32 KiB)。记录在 Codex CLI 源代码中。

  20. 使用写入后钩子进行“每次保存即测试”的概念是持续测试工作流中的一种模式;例如,参见 pytest 文档中关于持续集成的部分 docs.pytest.org/en/stable/how-to/usage.html,访问于 2026 年 3 月。

  21. React Compiler(以前称为“React Forget”)在构建时自动记忆化组件和 Hook,在大多数情况下使手动 useMemo 和 useCallback 变得多余。在 React Compiler 代码库中添加这些 Hook 会导致双重记忆化。react.dev/learn/react-compiler/introduction

  22. 脚手架效应对基准分数的影响记录在 SWE-bench Pro 排行榜的讨论中,其中运行同一模型的不同智能体框架显示出 4-12 分的差异。www.morphllm.com/swe-bench-pro

  23. Scale AI SEAL 排行榜使用相同的工具和 250 轮限制托管标准化的 SWE-bench Pro 分数,以将模型能力与脚手架质量隔离开来。labs.scale.com/leaderboard/swe_bench_pro_public

  24. SWE-bench 排行榜及相关研究凸显了 Verified 分数与更抗污染评估表现之间的显著差距。www.swebench.com/

  25. 追踪与详细日志:Codex CLI 高级文档。 www.mintlify.com/openai/codex/advanced/tracing

  26. “为什么大家都在悄悄放弃 OpenClaw”, 2026 年 4 月。记录了每月 $86 的心跳消耗模式,即空闲智能体会话无声地消耗令牌。

  27. WinBuzzer,“OpenAI 推出带有企业控制功能的 Codex 插件市场”, 2026 年 3 月 31 日。winbuzzer.com/2026/03/31/openai-launches-plugin-marketplace-codex-enterprise-controls-xcxwbn/

索引

符号

  • 4-file pattern 362

  • /btw 215

  • /compact command 95

  • /fork 214, 215

  • /goal 215

  • commands 216

  • completion audit 217

  • example 218, 219

  • lifecycle 216

  • patterns 218

  • token budgets 218

  • /hooks browser 151, 152

  • /review command 376, 377

  • /side 215

A

  • AAR 497

  • 访问控制

    • 配置 323
  • 无障碍审计自动化 448, 449

  • 智能体通信 36

    • 常见工作流的配置文件 37

    • 元提示 37, 38

    • 官方工作流配方 39, 40

    • 推理摘要 36

    • 令牌预算感知 37

    • 冗长度 36

  • 智能体执行

    • 设计 353

    • 环境变量注入 354

    • 固件与模拟服务 353

    • 测试隔离模式 354

Agentic AI Foundation (AAIF) 384

Agentic DevOps Playbook 294

四大协作区 294

成熟度模型 295

三层流水线验证 294

Agentic Engineering(智能体工程)

对比 Vibe Coding(氛围编程) 549, 550

Agentic Engineering Pod(智能体工程小组)

最佳实践 574–577

Context Architect(上下文架构师) 561–565

分发,搭配插件 580–583

失效模式与反模式 577–580

目标 555, 556

Quality Engineer(质量工程师) 568–574

角色 556–560

订阅续订端点 565–568

Value Engineer(价值工程师)编排 565

Agentic Landscape(智能体全景) 6

GitHub Copilot Coding Agent 8

IDE-Integrated Agents(IDE 集成智能体) 7

Terminal Agents(终端智能体) 8

Terminal Agents(终端智能体) 7

Agentic Systems(智能体系统)

威胁建模 301, 302

Agent Package Manager (APM) 521

Agent Skills(智能体技能) 515

AGENTS.md 25, 34, 35, 384

作为 Context Architect(上下文架构师) 562

配置 434, 436

缺点 51, 53

Docstring 生成 416

文件映射模式 53

长度限制 50

覆盖文件,用于 CI/CD 流水线 51

模式,扩展 54–57

生产模式 54

推荐结构 50

编写审查清单 384, 385

风格,输入 416

AGENTS.md Failures(失效)

认证失败 338

诊断 337

使用 RUST_LOG 进行加载验证 337

静默失败模式 337, 338

AGENTS.md Files(文件) 11, 323

AGENTS.md, Sections(章节) 48

Commands(命令) 48

Commit Conventions(提交约定) 49

Constraints and Off-Limits Areas(约束与禁区) 49, 50

AGENTS.md TDD Convention(惯例) 361

AGENTS.md, with Codex CLI 44

Discovery Chain(发现链) 44, 45

File Structure(文件结构) 46

Tiers(层级) 47, 48

Agent Test Quality(智能体测试质量) 362

Code Review Agent Benchmark (c-CRAB) 364

配置 Codex CLI 以进行真实测试 363

Over-Mocking Problem (MSR 2026)(过度模拟问题) 363

Agent Work Back(智能体回溯工作)

Merge Queue(合并队列) 233

Merging(合并) 232

Rebase Merge(变基合并) 233

Sequential Merge(顺序合并) 232

设置 Worktree Scripts 和 Local Environments(工作树脚本与本地环境) 234

AI Code Review(AI 代码审查) 371

Agent PR Trust Deficit(智能体 PR 信任赤字) 374, 375

Benefits(收益) 371, 372

Checklist-Guided Review(清单指导审查) 373

Empirical Evidence(实证证据) 372

Limitations(局限性) 371, 372

PR Integration(PR 集成) 377

Aider 8

aigorahub/elves 180

Alternative Cloud Billing Path(替代云计费路径) 262

Amazon Bedrock 262

Azure OpenAI Service 263

Trade-off(权衡) 263

Amazing Agent Race (AAR) 366

Amazon Bedrock 262

Ansible 479

Anti-Patterns(反模式) 221

Approval Prompt(批准提示)

Pre-Session Diagnostics(预会话诊断) 336, 337

TUI Slash Commands for Live Diagnostics(用于实时诊断的 TUI 斜杠命令) 335, 336

Using as Diagnostic(用作诊断) 335

App Server JSON-RPC

For Custom Harness Clients(用于自定义 Harness 客户端) 540

Architecture Decision Records (ADRs)(架构决策记录) 33

Async Patterns(异步模式) 424

Audit Log(审计日志) 148

Augmenting Prompts(增强提示词) 135

Authentication(认证) 22

API Key 22

ChatGPT Subscription 22

Enterprise Configuration(企业配置) 22

Autocomplete Paradigm(自动补全范式)

Issues(问题) 5

AutoLoop 288, 289

Automated Agent Identity(自动化智能体身份) 309

Automated Review(自动化审查) 308

Automated Review, on PR(PR 上的自动化审查) 377

CI Review, with Codex-Action(搭配 Codex-Action 的 CI 审查) 378, 380

GitHub Cloud Review 377

Automatic Summarisation(自动摘要) 96

Azure OpenAI Service 263

B

Backend(后端)

Running(运行) 439

Background Prefix Compaction(后台前缀压缩) 98

Bazel Monorepos 292

Benchmark Hierarchy(基准层级) 499, 500

Benchmark Landscape(基准全景) 486

Benchmark Progression(基准演进) 486, 488

Benchmarks(基准测试)

Account for Scaffold Inflation(考虑脚手架膨胀) 493

Adoption Data(采用数据) 500

Code Review Benchmarks(代码审查基准) 500

Configuration Priorities(配置优先级) 498

Matching to Workload(匹配工作负载) 493

Model Selection, within Codex CLI(Codex CLI 内的模型选择) 494

Running(运行) 494, 496

Blind Spots(盲点) 382

Blocking Prompts(阻塞提示词) 136

Board(看板/板卡)

Building(构建) 442, 443

Browser Verification(浏览器验证) 452

Build-and-Verify Loop(构建与验证循环) 451

Build System Integration(构建系统集成) 292

C

Caveman Mode(原始人模式) 265

-CRAB Benchmark 372

CI Agents

安全策略 289

CI/CD 模式目录 295

CI/CD 流水线设计

实证证据 292, 293

CI/CD 会话可靠性 291

远程连接 291

WebSocket 保活心跳 291

CI 隔离 310

CI 审查,搭配 codex-action 378

CI 触发模式 291

CI 工作树生命周期 234

GitHub Actions 示例 236

GitHub Actions 矩阵作业 236

脚本 235

Claude Code 8

Claude Code,迁移至 Codex CLI 515

AGENTS.md 516

AGENTS.md 文件 516

配置 519

钩子 517, 519

技能 516

子代理 517

Claude 计算机使用 452

CLI 代理 507

Claude Code 511

Codex CLI 优势 510

Google 的终端代理 512

开源与厂商中立代理 512, 513

并行编排代理 513

Cline 7

CLI 工作树工作流 229

代理,运行 231

创建 229, 230

工作树状态,检查 231

云模型

优势 327

对比自托管模型 327

云提供商 81

Cloud Run

API 和镜像仓库 467, 468

容器入口点 465

部署至 464

预期 Checkov 发现项 471, 472

GKE 472

计划与审查 470

远程状态,认证 465

远程状态,引导 465, 466

规划前验证 470

Cloud Run 服务 469

海岸 229

CocoaBench 366, 497

CodeRabbit 387

代码审查代理基准测试 (c-CRAB) 364

Codex 浏览器使用 451, 452

Codex CLI 3, 10, 19

代理格局 6-10

感知 AGENTS.md 11

审计 356

自动补全,问题 5

从 Claude Code 迁移至 515

配置 24

核心主张 13, 14

无头且可编写脚本 11

密闭运行 274

历史 4, 5

启动 22

误区 23

目标 3

在 MCP 两侧 123

基于 Apache 2.0 开源 12

前置条件 19

内核层沙箱化 11

终端优先 10

终端工具,重要性 12, 13

使用它来审计测试套件 356

Codex CLI 擅长领域

迁移,规划 396

需求 394

转换规则,编码 397

Codex CLI 安装

二进制文件,下载 20

Homebrew 20

npm 20

Shell 补全 21

验证 21

Codex CLI 提示工程 27

运行规范 27, 28

Codex CLI 配额

API 定价 243

codex 专用席位 242

快速模式和积分倍率 244

分层成本对比 243

订阅 242

使用量 245, 246

运作方式 242

Codex CLI 的主要成本控制

限制工具输出和压缩 251

配置 250

通过配置文件路由模型 250

codex 调试模型

模型目录自省 343

codex exec

运行 272, 273

Codex,用于代码审查

配置 375

选择审查模型 375

校准严格度 376

Codex 插件,用于 Claude Code 383, 387

codex-pr-body 179, 280

codex remote-control 220

Codex 测试失败结构 360

合规框架映射 315

组件脚手架 441

配置规模

分发 320

消费者视角 158

agentskills.io 标准 158

目录与安装 159

选择原语 161, 162

技能与工作 158

安装技能 160, 161

管理技能 160, 161

技能版本控制 160, 161

污染问题 489

上下文 91, 93

Context7

使用它进行文档查找 117

上下文架构师 561

AGENTS.md 作为 562

自主阶梯 561

技艺,作为插件分发 563, 564

规范,作为强制函数 563

TOML 配置 564

上下文冲突 110

上下文混淆 110

上下文干扰 109

上下文溢出症状 340

索引

C

上下文投毒 109

上下文使用 100

上下文使用可见性 260

契约

  • 定义 440

汇聚层 515

对话分支 214

  • /btw 215

  • /fork 214, 215

  • 概览 215

  • /side 215

成本-质量决策矩阵 256

  • 决策框架 257

  • 推理税,用于高工作量配置 257

凭据隔离 121

跨智能体迁移工具 520

  • 检测/导入 API 520

  • Gemini CLI 日落/停止支持 522

  • Microsoft APM 521, 522

跨模型对抗性审查 382, 383

  • 五阶段工作流 382

跨模型审查循环 208–210

跨工具挽具可移植性 541

CSV 扇出 191–194

  • 报告结果 194

  • 结果聚合 195

精选目录 159

光标 7, 513

自定义指令

  • 通过配置文件 35

D

Dagger 容器使用 MCP 292

数据驻留 315

决策框架 509

防御模式 50

委托补丁批准 153

拒读策略 307

设计到代码工作流 450

桌面封装器 523

确定性 352

确定性工具

  • 用于闭环 461, 462

Devin 沙盒浏览器 452

诊断工作流清单 344

目录限制 307

Docker MCP 工具包 126

文档生成 33

  • 架构决策记录 (ADR) 33

  • 代码文档 33

  • 文档新鲜度,作为 CI 任务 34

  • 入职文档 34

  • README 34

点文件仓库 320

漂移检测 478

双工具审查工作流 523

E

八大经典模式 39, 40

引导/激发 121

工程团队 324

企业部署 320

企业生命周期治理

  • 使用 PostToolUse 149

  • 使用 PreToolUse 149

企业推广/发布 329, 330

  • 清单 330

环境变量 24

情景记忆 108

评估挽具

  • 构建 358

  • CI 集成 360

  • 结构 358

  • 连接到 SWE-bench 风格评估 359

显式调用 174

探索者/工作者子智能体模式 445, 447

扩展优先架构 178

F

反馈信号问题 355

门控命令模式 355

文件系统限制与沙盒 305

  • 拒读策略 307

  • 目录限制 307

  • 环境特定沙盒策略 308

  • 操作系统级沙盒概览 305, 306

分叉 91

框架和语言版本迁移 401, 402

前端项目

  • 创建 436–438

G

门控命令模式 355

GB10 盈亏平衡点 267

GitHub Action 381

  • openai/codex-action 操作 275

GitHub 云端审查 377

GitHub Copilot 7, 514

GitHub Copilot 编码智能体 8

GitLab CI/CD 382

GitLab CI/CD 集成 282

  • 代码质量,在 .gitlab-ci.yml 中 282, 283

GitOps

  • 应用边界 474, 475

git worktree 226

  • 用于智能体工作流 226

目标模式 261

Google Agent Skills 181

治理框架 327

护栏管道 328

  • 监控模型 328

H

即服务挽具 547

挽具工程 530

  • 最佳实践 542–544

  • 组件 538–541

  • 错误恢复与恢复执行 536, 537

  • 证据 544–548

  • 长期运行智能体 535, 536

  • 目标 529

  • 支柱 533

  • 工作量证明原则 537, 538

  • 三层框架 531, 532

  • WORKFLOW.md 模式 534, 535

密封测试 352, 533

HiL-Bench 366, 498

钩子生命周期事件 133

  • PermissionRequest 137

  • PostL1-Bullet 139–142

  • PostToolUse 138, 139

  • PreL1-Bullet 139–142

  • PreToolUse 136, 137

  • SessionStart 134, 135

  • Stop fires 144

  • SubagentStart 142–144

  • SubagentStop 142

索引

Hook 系统

  • UserPromptSubmit 135

  • hooks.json 对象 131

  • apply_patch 观察 132

  • 事件 130

  • 用于自动执行 420-423

  • 内联配置,在 config.toml 中 131

  • MCP 工具 132

  • 概述 129

  • 主机名模式沙箱策略 275

人机协同审查模式

  • 人机协同审查模式 385

I

  • IDE 智能体 507, 513

  • 编辑器,作为多智能体界面使用 514

  • IDE 集成智能体 7

  • 隐式调用 174

  • 基础设施代码

    • 智能体面临的挑战 456, 457
  • 基础设施仓库

    • 使用 AGENTS.md 文件 457-459

    • 基础设施配置,位置 460

  • 隔离原则 227, 228

  • 运行时隔离差距 228, 229

  • 迭代式提示

    • 会话中途修正 31
  • 迭代修复循环 210, 212

J

  • Jenkins 382

K

  • 内核级沙箱 68

    • Linux 68

    • macOS 68

    • Windows 68

L

  • L1-Bulletion 101, 103

  • L1-Bullet 生命周期钩子 97

  • 大型代码库

    • 策略 99
  • 大规模重写

    • 验证 403, 404
  • 遗留系统 394-396

  • Linux 沙箱 68

  • 本地模型提供商 82, 83

  • 长期成本 261

M

  • macOS 沙箱 68

  • MAESTRO 501

  • MCP 服务器 198

    • 构建 121

    • 测试 122, 367

  • 元提示 37, 38

  • 迁移模式 398, 400

    • 快照测试与安全 401

    • 验证策略 400, 401

  • 中间人攻击检测

    • 在网络操作上 147, 148
  • 移动设备管理 (MDM) 176, 320

  • 模型目录内省

    • 使用 codex debug models 343
  • 模型特征 76

  • 模型上下文协议 (MCP) 114, 115, 515

    • 认证 120

    • 浏览器自动化,配合 Playwright 117

    • Codex CLI,在双方 123

    • 连接,到 GitHub 117

    • 上下文成本 118, 120

    • 数据库访问 118

    • 文档查找,配合 Context7 117

    • 限制 120

    • 在生产环境中运行 124-127

    • 作用域 120

    • 使用三层架构 115

    • 工具注解 116

  • 模型弃用

    • 监控 86
  • 模型推理力度 29, 30

    • 检查点模式 31

    • 规划模式 30

    • PLANS.md,用于多小时任务 30, 31

  • 模型角色 76

  • 模型路由决策框架 78, 79

    • 路由 79
  • 单体应用

    • 分解 402
  • 多云供应商策略 325, 327

  • 多模型工作流 80

    • 编排者-工作者模式 80

    • 会话阶段路由 80

  • 多供应商韧性 83

    • AI 网关代理 84, 86

    • 内置重试与退避 83

    • 基于配置文件的供应商切换 84

  • 多工具模式 522

    • 工具切换 523

N

  • 命名配置文件 68, 78

    • 内置配置文件 70

    • 细粒度审批类别 71

    • 继承 71

    • TUI 权限选择器 69

  • NanoClaw 543

  • 网络准入列表 311

  • Nx 单体仓库智能体技能 178

O

  • OpenAI,构建插件

    • 参考链接 174
  • openai/codex-action 动作 275

    • 每个 PR 上的自动代码审查 276, 277

    • 依赖更新智能体 279

    • 项目技能 280

    • 扩展审查 280, 282

    • 堆叠 PR 281

    • 合并时的测试生成 278

  • OpenAI,codex 插件

    • 参考链接 174
  • OpenTelemetry 指标 152

  • 运维考量 198

    • MCP 服务器 198

    • 子智能体 198

    • 子智能体,拒绝 199

  • Opsera 502

  • Opus 383

  • 编排故障

    • 调试 220, 221
  • 编排模式

    • 对比 213, 214
  • 编排者-工作者模式 80

  • 操作系统级沙箱概述 305, 306

  • 过度模拟问题 (MSR 2026) 363

P

  • 并行化 190

  • 并行编排智能体 513

  • 权限阶梯 72

  • PermissionRequest 137

  • 按推理力度划分的 Token 消耗 258

    • 双峰分布 259

    • KV 缓存经济学 258

    • 工具悖论 259

  • 持久上下文 106, 108

管道医生模式 285

修正循环 286, 287

管道可观测性 289

操向元数据 290

线程上下文反规范化 290

Token 使用量追踪 290

计划模式 103, 104

PLANS.md 技巧 31

Playwright

  • 浏览器自动化 117

插件捆绑钩子 153

插件

  • 用于分发智能体工程 Pod 580–583

  • 插件打包与分发 172

  • 架构 173, 174

  • 扩展优先架构 178

  • 生命周期,通过 app-server RPC 安装 176

  • 生命周期,通过 app-server RPC 移除 176

  • 市场发现与分发 174

  • 插件捆绑钩子 178

  • 策略与企业治理,安装 174, 176

  • 可复用工作流模式 177

PostL1-Bullet 139–142

PostToolUse 138, 149

PRDBench 500, 501

PreL1-Bullet 139–142

PreToolUse 136, 137, 149

PR-MCI 503

生产者视角 163

  • agents/openai.yaml 文件 166, 167

  • 描述字段,编写 165

  • 技能,构建 167, 168

  • SKILL.md 格式 163, 164

  • 技能,发布 167, 168

  • 三层加载模型 165

生产者视角

  • 技能,评估 170, 172

  • 技能,规模划分 168, 169

  • 工作流,编写 169

项目 README 479, 480

提示词

  • 风格检查 146

提示词缓存 104, 259

  • 缓存命中 260

  • 结构化提示词,以实现最大缓存命中 105, 106

提示词注入

  • 攻击模式 303

  • 防御措施 304, 305

常用任务的提示词模式

  • Bug 修复 32

  • 可并行化工作 32

  • 重构 32

提示词

  • 高效提示词结构 28

Pulumi 479

pyproject.toml

  • 作为单一事实来源 417–420

Pytest

  • 集成与测试生成 414–416

Python 专用 AGENTS.md 412, 413

  • 嵌套覆盖,随服务增长 414

Python,搭配 FastAPI

  • 异步模式 424

  • 对 AI 智能体的挑战 410, 411

  • 钩子,用于自动执行 420–423

  • 现代 Python 工具链 417

  • 目标 408

  • pyproject.toml,作为单一事实来源 417–420

  • Pytest 集成与测试生成 414–416

  • Python 专用 AGENTS.md 412–414

  • Ruff 417

  • Run or Relax API,构建 424–430

  • 服务,构建 408–410

  • 服务约定 423

  • 类型提示与文档字符串自动化 416, 417

  • uv 417

Q

二次增长问题 90

质量工程师 568

  • 确定性工具接口设计 569

  • 钩子 569–572

  • 插件强制钩子 572

  • TOML 配置 573, 574

  • 验证经济学 573

R

Ralph 循环 202

棘轮原则 547

RBAC 322

React 组件

  • 测试生成 444, 445

推理力度 77

  • 快速推理控制 77

远程连接

  • 作为 CI 触发器模式 291

requirements.toml 策略 321

  • 策略层级设计 321

  • 运行时控制 322

审查清单

  • 在 AGENTS.md 中编写 384, 385

审查-修复循环

  • 自主停止钩子 386

  • 人工审查 386

  • 多 AI 治理 387

  • 三级成熟度模型 386

健壮钩子

  • 编写 145

ROI 指标

  • 测量 324

Ruff 417

失控会话

  • 恢复 341

运行手册 478

运行时累积 91

运行时隔离鸿沟 228

RUST_LOG

  • Codex 调试命令 343

  • 模块级追踪 342

  • 结构化日志 342

S

SaaS

  • 就绪与生产环境嵌入 541

安全护栏

  • 应用边界 477

  • 审批模式配置 476

  • CI/CD 集成 476

沙箱命令

  • 执行策略规则 339, 340

  • 离线验证执行策略规则 340

  • 测试 338, 339

沙箱 66, 524, 525

  • 组合快捷标志 67

  • 网络访问 67

  • 在 config.toml 中配置沙箱 66

索引

W

  • web search(Web 搜索) 67

S

  • sandbox modes(沙箱模式)

    • capping, per environment(按环境设限) 275
  • Sandbox Profile Language (SBPL) script(沙箱配置文件语言 (SBPL) 脚本) 68

  • scaffolding(脚手架/搭建基础结构) 492

  • seccomp 68

  • secret management(密钥管理) 312

    • accidental secret exposure, detecting(检测意外密钥泄露) 313

    • environment variable leakage, preventing(防止环境变量泄露) 312, 313

  • secret scanner(密钥扫描器) 146

  • security checklist(安全清单) 316

  • self-containment(自包含性) 31

  • self-evolving agent pattern(自我进化智能体模式) 150, 151

  • self-healing CI/CD maturity model(自愈 CI/CD 成熟度模型) 284

    • gatekeeper(看门人/守门组件) 284

    • healer(修复者/修复组件) 284

    • observer(观察者/观测组件) 284

  • self-hosted model(自托管模型)

    • advantages(优势) 327

    • versus cloud model(对比云模型) 327

  • Sequential Gated Chain(顺序门控链) 203–205

  • server scoping(服务器作用域/范围界定) 120

  • server-side operation(服务端操作) 101

  • session-phase routing(会话阶段路由) 80

  • SessionStart(会话开始) 134, 135

  • session transcripts(会话记录/转录)

    • reading(读取) 334, 335
  • shell fan-out(Shell 扇出/并行分发)

    • with worktree isolation(配合工作树隔离) 197
  • simplest autonomous pattern(最简自主模式) 285

  • single command(单条命令) 352, 353

  • slack notification(Slack 通知)

    • on session end(会话结束时) 148
  • SlopCodeBench 499

  • SLUMP framework(SLUMP 框架)

    • specification drift, detecting(检测规范漂移) 344
  • Sourcery Intel 2026 Reports 502

  • spec-driven agents(规格驱动智能体) 513

  • specification drift(规范漂移) 344

    • detecting, with SLUMP framework(使用 SLUMP 框架检测) 344
  • static prefix(静态前缀) 91

  • Stop hook(停止钩子)

    • alerting(告警) 252

    • monitoring(监控) 252

    • registering(注册) 252, 254

    • token threshold check(令牌阈值检查) 255

    • webhook for team aggregation(用于团队聚合的 Webhook) 254

  • structural memory(结构化记忆) 108

  • structured audit logging(结构化审计日志) 314

  • structured output code review(结构化输出代码审查) 381

    • cross-model adversarial review(跨模型对抗性审查) 382, 383

    • platform-specific implementations(平台特定实现) 381

  • structured output schema(结构化输出模式) 381

  • sub-agent delegation(子智能体委托)

    • as context management(作为上下文管理) 98
  • Sub-Agent Model(子智能体模型) 186

    • built-in agents(内置智能体) 186

    • custom agent, defining(定义自定义智能体) 187

    • session(会话) 189

    • threads, switching(线程,切换) 186

    • working(工作原理/运作方式) 189

  • SubagentStart(子智能体启动) 142–144

  • SubagentStop(子智能体停止) 142

  • supply-chain injection risk(供应链注入风险) 49

  • SWE-bench 488

  • SWE-bench Pro 489

  • SWE-bench Verified 488

  • system prompt(系统提示词)

    • customizing(自定义) 94, 95
  • system skills(系统技能) 159

T

  • task decomposition(任务分解) 189

    • parallelisation(并行化) 189, 190

    • parallelisation, avoiding(避免并行化) 190, 191

  • TDD agent feedback loop(TDD 智能体反馈循环) 360

    • AGENTS.md TDD Convention(AGENTS.md TDD 约定) 361

    • bug fixes, testing(缺陷修复,测试) 361

    • Codex tests failure structure(Codex 测试失败结构) 360

  • team costs(团队成本)

    • agentic PR failure rate(智能体 PR 失败率) 248

    • billing-transparency problem(账单透明度问题) 247

    • estimating(估算) 246

    • projection variables(预测变量) 249, 250

    • scenario(场景) 246

    • skill-evaluation costs(技能评估成本) 249

    • SLM-as-judge triage layer for review loops(用于审查循环的 SLM 裁判分流层) 249

  • Terminal agents(终端智能体) 7, 8

  • Terminal-Bench 2.0 490

    • current scores(当前分数) 490, 491

    • motivation(动机/背景) 490

    • running(运行) 492

    • structure(结构) 490

    • template, for building micro-benchmark(用于构建微基准测试的模板) 494

  • Terraform MCP Server

    • used, for hardening generation(用于加固生成) 473, 474
  • Terraform workflows(Terraform 工作流)

    • module generation(模块生成) 463

    • plan review(计划审查) 463, 464

    • refactoring(重构) 464

  • test coverage checklist(测试覆盖率清单)

    • failure taxonomy, using(使用失败分类法) 365
  • thread(线程) 91

  • three approval modes(三种审批模式) 64

    • never(从不) 65

    • on-request(按需/请求时) 65

    • untrusted(不受信) 64

  • three-layer architecture(三层架构)

    • interface layer(接口层) 508

    • mechanism layer(机制层) 508

    • multi-agent scaling layer(多智能体扩展层) 508

  • three-layer pipeline verification(三层流水线验证)

    • provenance(溯源/来源验证) 294

    • semantic(语义) 294

    • structural(结构) 294

  • three-tier observability stack(三层可观测性栈) 345, 346

    • debugging workflows, with traces(使用追踪调试工作流) 347

    • rollout-trace debug reducer(发布追踪调试归约器/聚合器) 346

  • three-tier stack(三层栈/三层技术栈) 196, 197

  • token-compression proxy(Token 压缩代理) 264

    • caveman mode(原始人模式/极简模式) 265

    • concept(概念) 264

    • context health(上下文健康度) 266

    • layer investigation(层级调查/分层排查) 266

  • tooling(工具/工具链) 151

    • delegated patch approval(委托补丁审批) 153

    • /hooks browser(/hooks 浏览器) 151, 152

    • OpenTelemetry metrics(OpenTelemetry 指标) 152

    • plugin-bundled hooks(插件捆绑钩子) 153

  • trust ladder for adoption(采用信任阶梯) 308

  • trust model(信任模型) 64

  • TUI permission picker mapping(TUI 权限选择器映射) 70

  • two-phase memory pipeline(双阶段记忆流水线) 106, 108

U

  • unit test evaluation(单元测试评估) 357

    • integration test strategy, for agentic workflows(面向智能体工作流的集成测试策略) 357

    • property-based tests for agents(面向智能体的基于属性的测试) 357

    • sampling-based tests for tasks(面向任务的基于采样的测试) 357

  • Unix tools(Unix 工具)

    • composability with(与之的可组合性) 12
  • UserPromptSubmit(用户提示提交) 135

    • augmenting prompts(增强提示词) 135

    • blocking prompts(拦截提示词) 136

  • uv 417

V

索引

V

价值工程师 565

B

最佳实践 565

C

Codex 会话模式 566

R

责任 565

T

TOML 配置 567, 568

V

氛围编程

对比 代理式工程 549, 550

V

Visual Studio Code (VS Code) 7

W

基于波次的混合模式 206, 207

WebSocket 保活心跳包 291

Windows 沙箱隔离 68

worktree 工作流模式 237

W

write_stdin 非 TTY

限制 274

W

WSL2 20


参考文献

  1. ^(1) GitHub Copilot,最初的 AI 结对编程工具,于 2021 年作为技术预览版首次推出,由 GitHub、OpenAI 和 Microsoft 开发的生成式 AI 模型提供支持。 https://github.com/features/copilot↩︎

  2. ^(2) 官方 Codex CLI 文档描述了代理的工具使用能力,包括文件读/写、Shell 命令执行和 API 调用。 https://developers.openai.com/codex/cli↩︎

  3. ^(1) Chen, M. et al., "Evaluating Large Language Models Trained on Code," arXiv:2107.03374, OpenAI, July 2021. https://arxiv.org/abs/2107.03374↩︎

  4. ^(2) Chen, M. et al., "Evaluating Large Language Models Trained on Code," arXiv:2107.03374, OpenAI, July 2021. https://arxiv.org/abs/2107.03374↩︎

  5. ^(3) GitHub, "Introducing GitHub Copilot: your AI pair programmer," GitHub Blog, 29 June 2021. https://github.blog/news-insights/product-news/introducing-github-copilot-ai-pair-programmer/↩︎

  6. GitHub, "GitHub Copilot is generally available to all developers," GitHub Blog, June 2022. https://github.blog/news-insights/product-news/github-copilot-is-generally-available-to-all-developers/↩︎

  7. ^(5) OpenAI, "Introducing ChatGPT," OpenAI Blog, 30 November 2022. https://openai.com/blog/chatgpt↩︎

  8. ^(6) JetBrains, "Which AI Coding Tools Do Developers Actually Use at Work?," JetBrains Research Blog, 2026. https://blog.jetbrains.com/research/2026/04/which-ai-coding-tools-do-developers-actually-use-at-work/↩︎

  9. ^(7) JetBrains, "Which AI Coding Tools Do Developers Actually Use at Work?," JetBrains Research Blog, 2026. https://blog.jetbrains.com/research/2026/04/which-ai-coding-tools-do-developers-actually-use-at-work/↩︎

  10. ^(8) Anysphere, "Cursor: The AI Code Editor," https://cursor.com/↩︎

  11. ^(9) Cline 贡献者, "Cline: Autonomous coding agent for VS Code," GitHub, https://github.com/cline/cline↩︎

  12. ^(10) Anthropic, "Claude Code documentation," https://code.claude.com/docs/en/getting-started↩︎

  13. ^(11) Gauthier, P., "Aider: AI pair programming in your terminal," https://aider.chat/↩︎

  14. GitHub, "GitHub Copilot Coding Agent," GitHub Blog, 2025. https://github.blog/news-insights/product-news/github-copilot-workspace/↩︎

  15. ^(13) Cognition Labs, "Introducing Devin, the first AI software engineer," Cognition Blog, 12 March 2024. https://www.cognition.ai/blog/introducing-devin↩︎

  16. ^(14) JetBrains, "Which AI Coding Tools Do Developers Actually Use at Work?," JetBrains Research Blog, 2026. https://blog.jetbrains.com/research/2026/04/which-ai-coding-tools-do-developers-actually-use-at-work/↩︎

  17. ^(15) Matin, F. and Bolin, M., "openai/codex," GitHub, released 16 April 2025. https://github.com/openai/codex↩︎

  18. ^(16) Andrej Karpathy, "From Vibe Coding to Agentic Engineering," Sequoia Capital, April 2026. 将代理式工程定义为一门学科,代理作为实习生,而工具链是关键投资。↩︎

  19. ^(17) OpenAI, "Codex CLI for CI/CD: codex exec and non-interactive mode," OpenAI Developers, https://developers.openai.com/codex/guides/non-interactive↩︎

  20. ^(18) OpenAI, "Agent approvals and security: Codex CLI," OpenAI Developers, https://developers.openai.com/codex/agent-approvals-security↩︎

  21. ^(19) OpenAI, "Custom instructions with AGENTS.md: Codex CLI," OpenAI Developers, https://developers.openai.com/codex/guides/agents-md↩︎

  22. ^(1) 四表面架构在 OpenAI 开发者文档中有描述。 https://developers.openai.com/codex/cli↩︎

  23. ^(2) Codex CLI 需要 Node.js 22.0.0 或更高版本。 https://nodejs.org/en/about/previous-releases↩︎

  24. 平台支持记录在 Codex CLI 概览中。 https://developers.openai.com/codex/cli↩︎

  25. ^(4) macOS 13 Ventura 或更高版本,适用于 Apple Silicon 或 Intel。 https://developers.openai.com/codex/quickstart↩︎

  26. 预构建二进制文件和发布说明发布在 Codex GitHub 发布页面。 https://github.com/openai/codex/releases↩︎

  27. ^(6) codex completion 子命令支持 bash、zsh、fish、powershell 和 elvish。 https://developers.openai.com/codex/cli/reference↩︎

  28. ^(7) ChatGPT Plus 和 Pro 订阅的 Codex 使用限制。 https://openai.com/pricing↩︎

  29. ^(8) Codex 遵循的环境变量完整列表记录在 https://developers.openai.com/codex/environment-variables↩︎

参考文献

  1. 1 Codex CLI 代理循环可自主执行多步工具调用。参见 Yao 等人,“ReAct: Synergizing Reasoning and Acting in Language Models”,arXiv:2210.03629 (2022)。 https://arxiv.org/abs/2210.03629↩︎

  2. 2 AGENTS.md 文件会被 Codex CLI 自动读取。 https://developers.openai.com/codex/guides/agents-md↩︎

  3. 3 分层解析顺序在 AGENTS.md 文档中有规定。 https://github.com/openai/codex/blob/main/docs/agents_md.md↩︎

  4. 4 OpenAI,“Codex 提示指南:用于改进的元提示”,OpenAI Cookbook,2026。 https://developers.openai.com/cookbook/examples/gpt-5/codex_prompting_guide↩︎

  5. 5 OpenAI,“最佳实践:Codex”,OpenAI Developers,2026。 https://developers.openai.com/codex/learn/best-practices↩︎

  6. IntuitionLabs,“元提示:LLM 编写并优化自身的提示”,2026。 https://intuitionlabs.ai/articles/meta-prompting-llm-self-optimization↩︎

  7. 7 “工作流:Codex”,OpenAI Developers。 https://developers.openai.com/codex/workflows↩︎

  8. 8 “最佳实践:Codex”,OpenAI Developers。 https://developers.openai.com/codex/learn/best-practices↩︎

  9. ^(1) 每次 Codex CLI 运行时,AGENTS.md 文件都会在用户提示词之前被注入模型上下文。 https://developers.openai.com/codex/guides/agents-md↩︎

  10. ^(2) PROJECT_DOC_MAX_BYTES 常量默认为 32 * 1024 (32 KiB)。记录于 Codex CLI 源代码中。↩︎

  11. ^(3) Vasilopoulos, A. (2026)。“Codified Context: Infrastructure for AI Agents in a Complex Codebase”。arXiv:2602.20478v1。 https://arxiv.org/abs/2602.20478↩︎

  12. ^(4) 约定式提交规范。 https://www.conventionalcommits.org/en/v1.0.0/↩︎

  13. ^(5) NVIDIA AI 红队,“通过恶意依赖进行间接 AGENTS.md 注入”,2026 年 4 月。使用 Go 模块在 go mod tidy 期间写入恶意 AGENTS.md 的概念验证。↩︎

  14. ^(6) 静默截断行为记录在 Codex CLI 问题追踪器中。↩︎

  15. ^(7) AGENTS.md 捐赠给 Linux 基金会下的 Agentic AI 基金会 (AAIF)。 https://openai.com/index/agentic-ai-foundation/↩︎

  16. ^(8) AGENTS.md 官方规范站点。 https://agents.md/↩︎

  17. ^(9) Gloaguen 等人,“评估 AGENTS.md:仓库级上下文文件对编码代理有帮助吗?”,ETH Zurich SRI Lab,arXiv:2602.11988 (2026)。 https://arxiv.org/abs/2602.11988↩︎

  18. ^(10) AAR (The Amazing Agent Race) 研究,arXiv:2604.10261,2026 年 4 月。导航错误占试验的 27% 至 52%。该基准测量谜题和基于检索的导航;将其应用于代码库导航属于类比推断。↩︎

  19. ^(11) OpenAI,“AGENTS.md, openai/codex”,GitHub, https://github.com/openai/codex/blob/main/AGENTS.md/↩︎

  20. ^(12) Embiricos, A.“高级 Codex 工作流。”How I AI 播客,Lenny’s Newsletter,2026。↩︎

  21. ^(1) Microsoft,“Microsoft Foundry Models 中 Azure OpenAI 的配额和限制”:“每分钟令牌数 (TPM) 和每分钟请求数 (RPM) 限制按区域、订阅以及模型或部署类型定义。” https://learn.microsoft.com/azure/ai-services/openai/quotas-limits↩︎

  22. ^(2) AWS,“Amazon Bedrock 配额”:“您的 AWS 账户拥有 Amazon Bedrock 的默认配额,以前称为限制。” https://docs.aws.amazon.com/bedrock/latest/userguide/quotas.html↩︎

  23. ^(1) include_apps_instructions 和 include_permissions_instructions 被 Codex CLI 接受(已针对工作配置验证),但尚未列在 https://developers.openai.com/codex/config-reference 的公共配置参考中。在依赖它们之前,请针对最新文档进行验证。↩︎

  24. ^(2) Codex CLI 命令行选项和功能文档,涵盖自动压缩阈值配置和 /compact 行为。 https://developers.openai.com/codex/cli/features↩︎

  25. ^() 该事件记录在 Squintist,“Why Everyone Is Quietly Quitting OpenClaw”,2026 年 4 月。Meta 超级智能实验室对齐负责人 Summer Yu 报告称,她的代理的上下文压缩将“执行前始终确认”规则总结掉了,随后该代理开始自主删除邮件。 https://www.youtube.com/watch?v=urAMvpPhtqo↩︎

  26. ^(4) Tony Lee,“Codex 如何以不同方式解决 L1-Bulletion 问题”, https://tonylee.im/en/blog/codex-compaction-encrypted-summary-session-handover/,访问于 2026 年 4 月↩︎

  27. ^(5) Simon Zhou,“研究 Codex 上下文压缩的工作原理”, https://simzhou.com/en/posts/2026/how-codex-compacts-context/,访问于 2026 年 4 月↩︎

  28. GPT-5.4 和 GPT-5.5:1,000,000 令牌。GPT-5.4-mini:400,000 令牌。来源: https://developers.openai.com/api/docs/models↩︎

  29. ^(7) Michael Bolin,“展开 Codex 代理循环”,OpenAI Engineering Blog,2026 年 4 月, https://openai.com/index/unrolling-the-codex-agent-loop/。记录了仅追加提示架构及其与前缀缓存的交互。↩︎

  30. ^(8) OpenAI API 定价(标准处理模式),截至 2026 年 6 月:GPT-5.5 输入为 $5.00 / 1M 令牌,缓存输入为 $0.50 / 1M;GPT-5.4 为 $2.50 对 $0.25;GPT-5.4 mini 为 $0.75 对 $0.075。 https://openai.com/api/pricing/↩︎

参考文献

  1. ^(9) 记忆系统,DeepWiki / openai/codex。源自开源 Rust 实现的技术架构文档,涵盖双阶段流水线、存储架构、密钥清理边界、使用情况追踪和修剪机制。 deepwiki.com/openai/codex/3.9-memories-system↩︎

  2. ^(10) 记忆系统,DeepWiki / openai/codex。第一阶段提取的架构细节,包括并发限制、SQLite 存储模式和陈旧输出修剪。 deepwiki.com/openai/codex/3.9-memories-system↩︎

  3. ^(11) 为 OpenAI Codex 添加记忆:持久化开发上下文,Basic Memory。采用 Markdown 优先方法,支持跨客户端互操作。 docs.basicmemory.com/integrations/codex↩︎

  4. ^(12) codebase-memory-mcp:高性能代码智能 MCP 服务器,GitHub。基于 Tree-Sitter AST 的知识图谱,覆盖 66 种语言,查询延迟亚毫秒级。 github.com/DeusData/codebase-memory-mcp↩︎

  5. ^(1) 微软,“Playwright MCP” README,github.com/microsoft/playwright-mcp:“现代编码代理越来越倾向于将基于 CLI 的工作流作为 SKILL 暴露于 MCP 之上,因为 CLI 调用更加 Token 高效。” 微软引导用户前往 microsoft/playwright-cli 以获取现代编码代理方案,并将 MCP 服务器定位为用于“受益于持久状态、丰富内省以及对页面结构进行迭代推理的专业代理循环,例如探索性自动化、自愈测试或长期运行的自主工作流。” github.com/microsoft/playwright-mcp↩︎

  6. ^(1) 使用写入后钩子的“每次保存即测试”模式源自持续测试工作流;参见 pytest 关于持续集成的文档 docs.pytest.org/en/stable/how-to/usage.html,访问于 2026 年 3 月。↩︎

  7. ^(2) Gitleaks,“使用 Gitleaks 发现密钥”,github.com/gitleaks/gitleaks,访问于 2026 年 3 月。Gitleaks 是一款开源 SAST 工具,用于检测 Git 仓库中硬编码的密钥(API 密钥、密码、令牌),截至 2026 年初拥有超过 19,000 个 GitHub Star 和 2000 万次 Docker 下载。↩︎

  8. ^(3) Codex CLI 钩子生命周期治理:PreToolUse 和 PostToolUse 企业级强制执行模式。请参阅钩子配置文档 developers.openai.com/codex/hooks↩︎

  9. ^(4) OpenAI Cookbook,“使用重训练循环构建自我进化代理”,2026 年 4 月。四阶段重训练循环(基线、评估、优化、部署)参考架构。↩︎

  10. ^(1) Agent Skills 采用目录,agentskills.io,访问于 2026 年 4 月。↩︎

  11. ^(2) Anthropic,“Agent Skills 标准”,agentskills.io/specification,2025 年 12 月 18 日,访问于 2026 年 3 月。↩︎

  12. Anthropic,“Anthropic 开放 Agent Skills 标准”,引用自 Unite.AI,www.unite.ai/anthropic-opens-agent-skills-standard-continuing-its-pattern-of-building-industry-infrastructure/,2025 年 12 月,访问于 2026 年 3 月。↩︎

  13. ^(4) Agent Skills 采用目录,agentskills.io,访问于 2026 年 4 月。↩︎

  14. ^(5) OpenAI,“Skills 文档”,developers.openai.com/codex/skills,访问于 2026 年 6 月。系统技能和精选技能层级可见于 openai/skills 仓库 github.com/openai/skills。↩︎

  15. ^(6) Agent Skills 采用目录,agentskills.io,访问于 2026 年 4 月。↩︎

  16. ^(7) skills.sh,社区技能 CLI 和注册表,skills.sh,访问于 2026 年 6 月。↩︎

  17. ^(8) Tessl,托管技能注册表和生命周期平台,tessl.io,访问于 2026 年 6 月。注册表视图见 tessl.io/registry/discover?contentType=skills。↩︎

  18. ^(9) Agent Skills 规范,“SKILL.md 格式”,agentskills.io/specification,访问于 2026 年 3 月。↩︎

  19. ^(10) Agent Skills 规范,“渐进式披露加载模型”,agentskills.io/specification,访问于 2026 年 3 月。↩︎

  20. ^(11) OpenAI,关于 agents/openai.yaml 策略和 MCP 依赖的 Codex CLI 文档,github.com/openai/codex,访问于 2026 年 3 月。↩︎

  21. ^(12) Agent Skills,skills-ref 参考验证器(Python,从源码安装),github.com/agentskills/agentskills/tree/main/skills-ref,访问于 2026 年 6 月。↩︎

  22. ^(13) Nate Herk,“1 小时掌握 97% 的 Codex”,2026 年 5 月。完整课程演示了手动构建再编码的技能开发工作流,包括全局与项目本地决策规则、浏览器使用 QA 门控和模型选择指南。 youtu.be/3TdD8Qv5Tk8↩︎

  23. ^(14) Nate Herk,“1 小时掌握 97% 的 Codex”,2026 年 5 月。完整课程演示了手动构建再编码的技能开发工作流,包括全局与项目本地决策规则、浏览器使用 QA 门控和模型选择指南。 youtu.be/3TdD8Qv5Tk8↩︎

  24. ^(15) OpenAI,“为 Codex CLI 构建和测试自定义技能”,developers.openai.com/codex/skills,访问于 2026 年 4 月。描述了三层评估方法论↩︎

  25. ^(16) mgechev/skillgrade,“你的 Agent 技能单元测试”,github.com/mgechev/skillgrade,访问于 2026 年 6 月。↩︎

  26. ^(17) Nathan Onn,Skill Creator V2:具有并行变体对比的自动化技能基准测试。 github.com/nathanonn/skill-creator-v2↩︎

  27. ^(18) Tessl,托管技能注册表和生命周期平台, https://tessl.io ,访问于 2026 年 6 月。注册表视图见 tessl.io/registry/discover?contentType=skills。↩︎

参考资料

Codex 插件市场

  1. WinBuzzer, “OpenAI Launches Plugin Marketplace for Codex with Enterprise Controls,” 2026 年 3 月 31 日。winbuzzer.com/2026/03/31/openai-launches-plugin-marketplace-codex-enterprise-controls-xcxwbn/

  2. OpenAI, “Build Plugins — Codex,” OpenAI Developers, 2026 年 4 月。developers.openai.com/codex/plugins/build

  3. OpenAI, “Build Plugins — Codex Plugins documentation,” developers.openai.com/codex/plugins/build,访问于 2026 年 5 月

  4. OpenAI, “Codex Plugin Marketplace,” developers.openai.com/codex/plugins,访问于 2026 年 5 月

  5. Codex CLI 市场移除与跨仓库插件发现。openai/codex 源代码:codex-rs/core-plugins/src/installed_marketplaces.rs 和 codex-rs/cli/src/marketplace_cmd.rs。github.com/openai/codex

  6. Codex CLI 市场移除与跨仓库插件发现。openai/codex 源代码:codex-rs/core-plugins/src/installed_marketplaces.rs 和 codex-rs/cli/src/marketplace_cmd.rs。github.com/openai/codex

  7. Codex CLI 市场移除与跨仓库插件发现。openai/codex 源代码:codex-rs/core-plugins/src/installed_marketplaces.rs 和 codex-rs/cli/src/marketplace_cmd.rs。github.com/openai/codex

  8. OpenAI, “Build Plugins — Codex Plugins documentation,” developers.openai.com/codex/plugins/build,访问于 2026 年 5 月

  9. 插件捆绑钩子与工作区共享,Codex CLI,2026 年 5 月。developers.openai.com/codex/changelog

Agent 技能与框架

  1. aigorahub, “Elves: Autonomous Multi-Batch Development Skill,” 2026。github.com/aigorahub/elves

  2. Google, “Agent Skills,” 2026。github.com/google/skills

理论基础

  1. 阿姆达尔定律,由 Gene Amdahl 于 1967 年提出,指出并行化程序的理论加速比受限于必须保持顺序执行的任务部分所占的比例。en.wikipedia.org/wiki/Amdahl%27s_law

  2. Xu 等人,“From Multi-Agent to Single-Agent: When Is Skill Distillation Beneficial?”,arXiv:2604.01608。引入了“指标自由度”作为先验预测指标,用于判断将多 Agent 工作流折叠为单 Agent 技能何时有益。arxiv.org/abs/2604.01608

Ralph 循环模式

  1. Geoffrey Huntley, “The Ralph Wiggum as a Software Engineer,” 2025 年 7 月 14 日。Ralph 循环模式的起源,命名灵感源自《辛普森一家》中的 Ralph Wiggum。ghuntley.com/ralph/

  2. OpenAI, “Build iterative repair loops with Codex,” OpenAI Cookbook, 2026 年 5 月 11 日。使用结构化输出模式和收敛检测,将 Review-Repair-Validate(审查-修复-验证)模式形式化。developers.openai.com/cookbook/examples/codex/build_iterative_repair_loops_with_codex

Goal Mode 运行模型

  1. Goal Mode 运行模型,包含生命周期状态(pursuing、paused、achieved、unmet、budget_limited)以及基于审计的完成检查,源自主要版本发布说明及一篇扩展撰写文章:blog.danielvaughan.com/codex-cli-goal-mode-define-done-not-next-c8d13213ea7c。

  2. 目标陈述的实战模式(迁移战役、覆盖率冲刺、性能排查、规格到实现),包含弱/强对比及 CI 用法,源自同一篇扩展撰写文章。blog.danielvaughan.com/codex-cli-goal-mode-define-done-not-next-c8d13213ea7c

Git Worktrees 与运行时隔离

  1. git worktree 子命令在 Git 2.5(2015 年 7 月)中引入,允许多个工作树连接到单个对象数据库。官方文档:git-scm.com/docs/git-worktree

  2. Git 强制执行“每个工作树一个分支”的约束以防止索引冲突;尝试检出已在另一个工作树中检出的分支将返回错误。git-scm.com/docs/git-worktree

  3. GitHub 博客上的 Git 2.5 发布公告,描述了多工作树功能及其相对于克隆的性能优势。github.blog/open-source/git/git-2-5-including-multiple-worktrees-and-triangular-workflows/

  4. Penligent, “Git Worktrees Need Runtime Isolation for Parallel AI Agent Development,” 2026 年 3 月。指出了基于工作树的并行 Agent 工作流中的结构性缺口:端口冲突、数据库碰撞、环境变量泄漏和 Docker 守护进程共享。www.penligent.ai/hackinglabs/git-worktrees-need-runtime-isolation-for-parallel-ai-agent-development/

  5. Penligent, “Git Worktrees Need Runtime Isolation for Parallel AI Agent Development,” 2026 年 3 月。指出了基于工作树的并行 Agent 工作流中的结构性缺口:端口冲突、数据库碰撞、环境变量泄漏和 Docker 守护进程共享。www.penligent.ai/hackinglabs/git-worktrees-need-runtime-isolation-for-parallel-ai-agent-development/

  6. Coasts:用于 git worktrees 的开源(MIT)本地服务隔离与编排工具。具备动态端口分配与规范端口镜像、特定服务重分配策略、每个 coast 的数据隔离,以及“Coast Guard”可观测性 UI。github.com/coast-guard/coasts 和 coasts.dev

  7. Codexia:一个基于 Tauri v2 构建的轻量级 Agent 工作站,适用于 Codex CLI 和 Claude Code,内置 git worktree 管理、任务调度器、远程控制和技能管理。github.com/milisp/codexia

参考文献

  1. ^(8) GitHub 合并队列文档:合并队列确保分支在合并前针对目标分支的最新版本进行测试,防止并发 PR 导致的集成失败。 docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue↩︎

  2. ^(9) GitHub Actions actions/checkout 文档指出,fetch-depth: 0 是获取完整历史记录以进行 git rebase 和 git worktree 等操作所必需的。 docs.github.com/en/actions↩︎

  3. ^(1) OpenAI Codex 定价与速率限制,为信用成本、各模型额度、五小时窗口、周限制以及 Plus/Pro/Business/Enterprise/Edu 分层结构的权威来源。团队规模规划前请核实当前数值。 developers.openai.com/codex/pricing↩︎

  4. ^(2) OpenAI API 所有模型的定价发布在 OpenAI 定价页面。本章所示价格为近似值且会变动。财务预测前请务必核实当前价格。 openai.com/pricing↩︎

  5. ^(3) OpenAI API 所有模型的定价发布在 OpenAI 定价页面。本章所示价格为近似值且会变动。财务预测前请务必核实当前价格。 openai.com/pricing↩︎

  6. ^(4) GPT-5.5 API 定价为输入 $5.00/M tokens、输出 $30.00/M tokens,约为 GPT-5.4 的 $2.50/$15.00 费率(输入/输出均约 2 倍)。OpenAI 报告称更好的 token 效率可在许多任务中抵消价格上涨。 openai.com/index/gpt-5-5/↩︎

  7. ^(5) 对于目标明确的智能体编码任务,gpt-5.4-mini 在公开基准测试中以约 30% 的成本达到了 gpt-5.4 约 85% 至 90% 的性能。在承诺路由规则前请在自己的工作负载上验证。↩︎

  8. ^(6) OpenAI,“Codex CLI Speed: Increase speed without sacrificing intelligence.” 文档描述了快速模式(斜杠命令加 service_tier/features.fast_mode 设置)、约 1.5 倍吞吐量、gpt-5.4 上 2 倍信用费率与 gpt-5.5 上 2.5 倍费率、API-key 计费不可用快速模式信用额度,以及相关的 gpt-5.3-codex-spark 模型。 developers.openai.com/codex/speed↩︎

  9. ^(7) OpenAI 社区论坛,“Codex CLI token consumption significantly exceeds expectations.” 长期讨论帖;用户反馈配额消耗速度比预期快 5 到 10 倍,主要归因于智能体会话中累积的对话历史。 community.openai.com/t/codex-token-consumption↩︎

  10. ^(8) Codex CLI 社区论坛,“Token billing transparency and agent-initiated requests.” 记录了将 API 成本归因于特定智能体动作与用户发起请求的普遍困难,并报告了后台工作流中的失控消耗。 community.openai.com/t/codex-billing-transparency↩︎

  11. ^(9) Ehsani, R. 等,“Where Do AI Coding Agents Fail? An Empirical Study of Failed Agentic Pull Requests in GitHub,” MSR 2026。 arxiv.org/abs/2601.15195↩︎

  12. ^(10) Pham, D. 和 Ghaleb, T. A.,“Code Change Characteristics and Description Alignment: A Comparative Study of Agentic versus Human Pull Requests,” MSR 2026。 arxiv.org/abs/2601.17627↩︎

  13. ^(11) Vaughan, D.,“The Real Cost of Multi-Model Review Loops.” 单模型、双模型及三模型审查架构的成本建模。↩︎

  14. ^(12) Crupi 等,“Improving Code Generation via Small Language Model-as-a-judge,” IEEE/ACM ICSE 2026。 arxiv.org/abs/2602.11911↩︎

  15. ^(13) 社区撰写记录了某第三方智能体框架因后台心跳持续发起无实际工作的 API 请求,导致每空闲会话月消耗约 $86。作为主动成本遥测重要性的例证引用;不代表对该特定框架的背书。↩︎

  16. ^(14) 斯坦福开发者生产力研究覆盖约 12 万开发者;数据汇总自多次会议演示。生产力增益分布呈双峰:中位数 10% 至 15%,上四分位 40% 至 60%,下四分位可忽略或为负。↩︎

  17. ^(15) OpenAI,“Prompt Caching,” API 文档。缓存输入 tokens 享受大幅折扣(最高减 90%,视模型而定);对于前缀超过 1,024 tokens 且在请求前沿窗口匹配的请求,该机制自动生效。引用前请核对实时文档中的当前折扣与匹配窗口。 developers.openai.com/api/docs/guides/prompt-caching↩︎

  18. ^(16) OpenAI,“Prompt Caching,” API 文档。缓存输入 tokens 享受大幅折扣(最高减 90%,视模型而定);对于前缀超过 1,024 tokens 且在请求前沿窗口匹配的请求,该机制自动生效。引用前请核对实时文档中的当前折扣与匹配窗口。 developers.openai.com/api/docs/guides/prompt-caching↩︎

  19. ^(17) RTK (Rust Token Killer) 是面向 AI 编码智能体的命令输出代理。其 README 描述常见开发命令可减少 60% 至 90% tokens,通过 rtk init -g --codex 初始化 Codex,并提供 rtk read file.rs -l aggressive 等显式命令;架构文档描述智能过滤、分组、截断、去重与 token 追踪。警示性失效模式源自 RTK issue #582,某 Claude Code 调试任务显示输入 tokens 减少但总成本上升,因模型为补全缺失上下文而补偿。 github.com/rtk-ai/rtk github.com/rtk-ai/rtk/blob/master/docs/contributing/ARCHITECTURE.md github.com/rtk-ai/rtk/issues/582↩︎

参考文献

  1. ^(18) squeez 是一个基于 Hook 的 AI CLI 令牌压缩器(支持 Codex CLI 等),其“原始人”角色会要求模型去掉冠词、填充词和客套话,同时保留技术术语、代码块和准确的错误信息。github.com/claudioemmanuel/squeez

另一篇《Business Insider》关于“原始人语”实验的报道可作警示:作者发现该风格虽能省 Token,但降低质量,不敢用于严肃代码。www.businessinsider.com/claude-caveman-speak-prompt-save-tokens-results-worse-2026-5↩︎

  1. ^(19) Codex CLI 的上下文健康监控实践笔记。记录了压缩遥测缺口、退化检测模式和长会话质量管理的配置杠杆。↩︎

  2. ^(20) NVIDIA DGX Spark 市场列表:GB10 Grace Blackwell 硬件、128 GB 统一内存及现价。marketplace.nvidia.com/en-us/developer/dgx-spark/↩︎

  3. ^(21) Addy Osmani,“Agentic Coding 中的 80% 问题”。报告称高采用团队的个人产出激增,但 PR 审查时间随之上升,因为概念性失败在累积。addyo.substack.com/p/the-80-problem-in-agentic-coding↩︎

  4. ^(1) Codex CLI 的非交互式流水线模式。涉及 exec、resume、结构化输出和 JSONL 流式传输。参见 “Codex CLI Non-Interactive Pipelines,” codex-resources, 2026 年 5 月。↩︎

  5. ^(2) 合并的 codex exec CI/CD 模式参考。另见:Vaughan, D., “Codex CLI Non-Interactive Pipelines,” codex-resources, 2026 年 5 月。↩︎

  6. ^(3) 面向 Fork PR 的 GitHub Actions 安全加固。docs.github.com/en/actions↩︎

  7. ^(4) 合并的 codex exec CI/CD 模式参考。另见:Vaughan, D., “Codex CLI Non-Interactive Pipelines,” codex-resources, 2026 年 5 月。↩︎

  8. ^(5) 密闭的 codex exec 模式。另见:danielvaughan.com/codex-resources/articles/2026-04-25-codex-exec-hermetic-runs-isolation-flags-reproducible-ci-pipelines/.↩︎

  9. ^(6) openai/codex-action GitHub Action。github.com/openai/codex-action↩︎

  10. ^(7) GitLab Inc., “GitLab Announces the General Availability of GitLab Duo Agent Platform,” 2026 年 1 月 15 日。ir.gitlab.com/news/news-details/2026/GitLab-Announces-the-General-Availability-of-GitLab-Duo-Agent-Platform/default.aspx↩︎

  11. ^(8) GitLab 文档,“External agents。”docs.gitlab.com/user/duo_agent_platform/agents/external/↩︎

  12. ^(9) OpenAI Cookbook,“Automating Code Quality and Security Fixes with Codex CLI on GitLab。”developers.openai.com/cookbook/examples/codex/secure_quality_gitlab↩︎

  13. ^(10) OpenAI Cookbook,“Automating Code Quality and Security Fixes with Codex CLI on GitLab。”developers.openai.com/cookbook/examples/codex/secure_quality_gitlab↩︎

  14. ^(11) GitLab 文档,“GitLab MCP server。”docs.gitlab.com/user/gitlab_duo/model_context_protocol/mcp_server/↩︎

  15. ^(12) Vaughan, D., “Automated CI Failure Recovery with Codex CLI: Self-Healing Pipelines from GitHub Actions to GitLab CI,” codex-resources, 2026 年 4 月。danielvaughan.com/codex-resources/articles/2026-04-20-codex-cli-ci-autofix-self-healing-pipelines-github-actions-gitlab/↩︎

  16. ^(13) Vaughan, D., “Automated CI Failure Recovery with Codex CLI: Self-Healing Pipelines from GitHub Actions to GitLab CI,” codex-resources, 2026 年 4 月。danielvaughan.com/codex-resources/articles/2026-04-20-codex-cli-ci-autofix-self-healing-pipelines-github-actions-gitlab/↩︎

  17. ^(14) Vaughan, D., “AutoLoop with Codex CLI: Bounded Optimisation Loops for Measurable Codebase Improvement,” codex-resources, 2026 年 5 月。将 Karpathy 的 autoresearch(21K stars)推广为带路径作用域 Git 操作的代码库改进。danielvaughan.com/codex-resources/articles/2026-05-10-autoloop-codex-cli-bounded-optimisation-loops-agent-agnostic-iterative-improvement/↩︎

  18. ^(15) Simon Willison 记录的提示注入风险。simonwillison.net/series/prompt-injection/↩︎

  19. ^(16) GitHub Actions permissions 键文档。docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions↩︎

  20. ^(17) Codex CLI 分析管道功能(令牌用量追踪、引导元数据、线程上下文反规范化),2026 年 4 月。github.com/openai/codex↩︎

  21. ^(18) OpenAI,“Remote Connections,” Codex 开发者文档,GA 2026 年 5 月 14 日。移动端 ChatGPT 中继和 SSH 主机连接,用于远程智能体控制。developers.openai.com/codex/remote-connections↩︎

  22. ^(19) Codex CLI for Bazel Builds, Codex Resources, 2026 年 5 月。远程执行、单体仓模式、智能体驱动的构建智能。danielvaughan.github.io/codex-resources/articles/2026-05-30-codex-cli-bazel-builds/↩︎

  23. ^(20) Dagger Container-Use MCP Server。将容器化构建管道函数作为 MCP 工具暴露。dagger.io↩︎

参考文献

  1. ^(21) MSR 2026 Mining Challenge(采矿挑战赛)产出了五项独立研究,分析了包含 61,000 个仓库中 933,000+ 个智能体 PR 的 AIDev 数据集。Vaughan, D., “What 33,000 Agentic Pull Requests Reveal: Empirical Lessons for Codex CLI Practitioners,” codex-resources, 2026 年 4 月。↩︎

  2. ^(22) Ehsani 等人,《Why Do AI-Generated Pull Requests Get Rejected?》(AI 生成的 Pull Request 为何被拒绝?),MSR 2026 Mining Challenge。对 33,596 个智能体 PR 的分析显示失败率为 28.52%,审查者放弃审查是主要失败模式。↩︎

  3. ^(23) Pham 和 Ghaleb,《Agentic PR Description Quality and Code Churn》(智能体 PR 描述质量与代码更动率),MSR 2026 Mining Challenge。发现智能体编写代码的中位数符号存活期为 3 天,而人类编写的代码为 34 天。↩︎

  4. ^(24) David Sanchez (Microsoft),《DevOps Practices and Principles for the Agentic Era: Strategic Direction》(智能体时代的 DevOps 实践与原则:战略方向),Microsoft DevBlogs,2026 年 4 月 15 日。四大协作区域、三层流水线验证及智能体采纳成熟度模型。 https://devblogs.microsoft.com/all-things-azure/agentic-devops-practices-principles-strategic-direction/↩︎

  5. Gitleaks,一款用于检测 Git 仓库、文件和 stdin 中硬编码密钥的开源工具。 https://github.com/gitleaks/gitleaks↩︎

  6. ^(1) RolloutItem 事件类型定义 (openai/codex 源码):https://github.com/openai/codex/blob/main/codex-rs/protocol/src/protocol.rs。会话存储位置 (~/.codex/sessions/):https://developers.openai.com/codex/configuration。ccusage Token 用量工具:https://github.com/ryoppippi/ccusage。↩︎

  7. ^(2) RolloutItem 事件类型定义 (openai/codex 源码):https://github.com/openai/codex/blob/main/codex-rs/protocol/src/protocol.rs。会话存储位置 (~/.codex/sessions/):https://developers.openai.com/codex/configuration。ccusage Token 用量工具:https://github.com/ryoppippi/ccusage。↩︎

  8. ^(3) Codex CLI 中的斜杠命令。 https://developers.openai.com/codex/cli/slash-commands↩︎

  9. 配置参考:Codex CLI 文档。 https://developers.openai.com/codex/config-reference↩︎

  10. ^(5) 命令行选项:Codex CLI 参考。 https://developers.openai.com/codex/cli/reference↩︎

  11. [6] 沙箱架构:Codex CLI 文档。 https://www.mintlify.com/openai/codex/architecture/sandboxing↩︎

  12. 沙箱架构:Codex CLI 文档。 https://www.mintlify.com/openai/codex/architecture/sandboxing↩︎

  13. ^(8) 执行策略 说明文件: https://github.com/openai/codex/blob/main/codex-rs/execpolicy/README.md↩︎

  14. ^(9) 追踪与详细日志:Codex CLI 高级文档。 https://www.mintlify.com/openai/codex/advanced/tracing↩︎

  15. ^(10) 追踪与详细日志:Codex CLI 高级文档。 https://www.mintlify.com/openai/codex/advanced/tracing↩︎

  16. ^(11) 追踪与详细日志:Codex CLI 高级文档。 https://www.mintlify.com/openai/codex/advanced/tracing↩︎

  17. ^(12) 追踪与详细日志:Codex CLI 高级文档。 https://www.mintlify.com/openai/codex/advanced/tracing↩︎

  18. ^(13) 命令行选项:Codex CLI 参考。 https://developers.openai.com/codex/cli/reference↩︎

  19. ^(14) 卢岩、陈萱、张翔宇,《When the Specification Emerges: Benchmarking Faithfulness Loss in Long-Horizon Coding Agents》(当规范浮现:长视野编码智能体忠实度损失基准测试),arXiv:2603.17104,2026 年 3 月。 https://arxiv.org/abs/2603.17104↩︎

  20. OpenAI,《Evaluate agent workflows》(评估智能体工作流),OpenAI API 指南,2026 年。 https://developers.openai.com/api/docs/guides/agent-evals↩︎

  21. ^(16) SigNoz,《OpenAI Codex Observability & Monitoring with OpenTelemetry》(使用 OpenTelemetry 进行 OpenAI Codex 可观测性与监控),SigNoz 文档,2026 年。 https://signoz.io/docs/codex-monitoring/↩︎

  22. ^(1) van Riel, Z., “I Quit My GitHub Job Because AI Breaks Software”(我因 AI 破坏软件而辞去 GitHub 工作),2026 年 4 月。Van Riel 是一名前 GitHub 高级工程师,他指出当一名开发者产出的代码量是原来的 100 倍时,“他们无法再有意义地审查所生成的内容”,从而在统计上保证了未被发现的 Bug 的存在。 https://www.youtube.com/watch?v=aEL384kTznk↩︎

  23. ^(2) SWE-bench 是一个用于评估语言模型和智能体在源自 GitHub Issues 的真实软件工程任务上表现的基准测试。该基准测试的方法论和排行榜发布于 swebench.com。Jimenez, C. E., Yang, J., Wettig, A., Yao, S., Pei, K., Press, O., & Narasimhan, K. (2024). SWE-bench: Can Language Models Resolve Real-World GitHub Issues? https://arxiv.org/abs/2310.06770↩︎

  24. ^(3) Hora, A. & Robbes, R., “Are Coding Agents Generating Over-Mocked Tests? An Empirical Study”(编码智能体是否在生成过度模拟的测试?一项实证研究),MSR 2026。 https://arxiv.org/abs/2602.00409↩︎

  25. ^(4) Zhang 等人,“Code Review Agent Benchmark (c-CRAB)”(代码审查智能体基准测试),arXiv:2603.23448,2026 年 3 月。测试的审查智能体(开源 PR-agent、Devin、Claude Code 和 Codex)合计仅能解决约 40% 的 c-CRAB 任务。 https://arxiv.org/abs/2603.23448↩︎

  26. ^(5) “The Amazing Agent Race: Strong Tool Users, Weak Navigators”(AAR,神奇智能体竞赛:强工具使用者,弱导航者),arXiv:2604.10261,2026 年 4 月。最佳智能体准确率 37.2%;导航错误占主导(占试验的 27% 至 52%)。该基准测试使用谜题和基于检索的导航;将其应用于代码库导航属于类比推断。↩︎

脚注

  1. 常见的静态分析和语言模型可检测的安全反模式包括:通过字符串拼接进行 SQL 注入、eval() 的危险用法、缺失认证中间件以及凭据泄露。这些类别在 OWASP Top 10 中有详细记录。owasp.org/www-project-top-ten/↩︎

  2. ^(2) Zhang, Pan, Yusuf, Ruan, Shariffdeen, Roychoudhury, “c-CRAB: Code Review Agent Benchmark,” arXiv:2603.23448, National University of Singapore, March 2026. arxiv.org/abs/2603.23448↩︎

  3. ^(3) Zhang, Pan, Yusuf, Ruan, Shariffdeen, Roychoudhury, “c-CRAB: Code Review Agent Benchmark,” arXiv:2603.23448, National University of Singapore, March 2026. arxiv.org/abs/2603.23448↩︎

  4. ^(4) Gong et al., “Analyzing Message-Code Inconsistency in AI Coding Agent-Authored Pull Requests,” arXiv:2601.04886, accepted at MSR 2026 Mining Challenge Track. 23,247 PRs analysed; 1.7 per cent high-MCI rate; 51.7 per cent lower acceptance for inconsistent PRs. arxiv.org/abs/2601.04886↩︎

  5. ^(5) CodeRabbit, “State of AI vs Human Code Generation Report,” December 2025. AI PRs contain 1.7x more issues than human PRs across logic, quality, security, and readability categories. www.coderabbit.ai/blog/state-of-ai-vs-human-code-generation-report↩︎

  6. ^(6) CI 环境中的提示词注入是一个已记录的威胁向量,存储库文件(PR 差异、源代码、提交信息)中的恶意内容试图劫持 AI 代理的指令。在只读沙箱模式下运行代码审查可防止代理在被重定向时修改任何文件,从而缓解此风险。github.com/openai/codex-action↩︎

  7. ^(7) 此处使用的 0 到 3 整数优先级刻度(P0 严重,P3 建议)是本章采用的模式约定,通过 output-schema-file 提供给 openai/codex-action。codex-action 本身不定义发现模式;由用户提供。该刻度映射到安全漏洞分类中广泛使用的严重性层级。github.com/openai/codex-action↩︎

  8. ^(8) OpenAI Cookbook, “Build Code Review with the Codex SDK,” developers.openai.com/cookbook/examples/codex/build_code_review_with_codex_sdk, October 2025. CI/CD 环境中通过 codex exec --output-schema 进行结构化 JSON 代码审查的官方模式。↩︎

  9. ^(9) Mejba Ahmed, “I Ran Codex Inside Claude Code: Cross-Model Adversarial Review,” March 2026. 从业者实验报告了 Codex 和 Claude Code Opus 4.6 之间互补的盲点,且 API token 成本适中。www.mejba.me/blog/codex-plugin-claude-code-adversarial-review↩︎

  10. ^(10) AGENTS.md 是由 Linux 基金会下的 Agentic AI Foundation (AAIF) 维护的开放标准,由 Anthropic、Block 和 OpenAI 于 2025 年 12 月共同创立,旨在跨工具标准化 AI 代理配置。www.linuxfoundation.org/press/linux-foundation-announces-the-formation-of-the-agentic-ai-foundation↩︎

  11. Vaughan, D., “Agent Fingerprints in Pull Requests and Git Hygiene,” codex-resources, April 2026. 从业者对 AI 生成代码中可检测模式的分析及对归因和审查校准的建议。非同行评审的主要研究。↩︎

  12. ^(1) Strangler Fig 模式(绞杀榕模式)是一种软件迁移策略,在现有系统旁增量构建新系统,逐步将功能从旧系统路由到新系统,直到原系统可被退役。Martin Fowler 将其描述为优于大爆炸式重写,因为它能持续交付价值并保持回滚路径。martinfowler.com/bliki/StranglerFigApplication.html↩︎

  13. ^(2) Martin Fowler 于 2004 年在一篇博客文章中首次描述了 Strangler Fig Application 模式,将其比作绞杀榕树缠绕并最终取代宿主。后来名称更新为“Strangler Fig Application”以强调隐喻起源。martinfowler.com/bliki/StranglerFigApplication.html↩︎

  14. 2to3 是 Python 标准库工具(位于 lib2to3 包中),可自动将 Python 2 源代码转换为 Python 3 语法。它处理大多数机械转换(print 语句、unicode 与 str 以及整数除法),但不处理所有习惯用法更新或依赖兼容性问题。docs.python.org/3/library/2to3.html↩︎

  15. ^(4) AngularJS (Angular 1.x) 和 Angular (2+) 是架构上不兼容的框架。Angular 2 是完全重写,引入了基于组件的架构、TypeScript 和新的模块系统,与 AngularJS 的 MVC 控制器模式没有向后兼容性。angular.dev/guide/migration↩︎

  16. ^(5) 忠实转译与惯用重设计之间的对比,在关于将语言工具和运行时从一种系统语言大规模机器辅助重写为另一种语言的公开讨论中可见一斑。据报告的逃逸舱数量(如 unsafe 块)因来源和统计方式而异,因此任何具体数字应视为模式的指示而非精确测量。↩︎

  17. ^(1) PEP 604 于 Python 3.10 引入,增加了 X | Y 联合类型语法,允许使用 str | None 作为 Optional[str] 的更简洁替代。在 Python 3.9 中可通过 from __future__ import annotations 使用。peps.python.org/pep-0604/↩︎

  18. ^(2) mypy 是符合 PEP 484 的 Python 静态类型检查器。它支持严格模式以实现最大覆盖率。mypy-lang.org/↩︎

  19. ^(3) uv 是由 Astral 开发的用 Rust 编写的快速 Python 包和项目管理器。它以单一二进制文件替代了 pip、venv、pyenv、pipx 和 poetry,并生成 uv.lock 锁文件以实现可复现环境。github.com/astral-sh/uv↩︎

  20. ^(4) Ruff 是由 Astral 开发的用 Rust 编写的快速 Python linter 和格式化工具。它从 Flake8、Black、isort 和 pyupgrade 重新实现了 900 多条 lint 规则,可在亚秒级时间内处理大型代码库。github.com/astral-sh/ruff↩︎

  21. ^(5) FastAPI 是一个建立在 Starlette 和 Pydantic 之上的高性能 Python Web 框架。根据《The State of Python 2025》调查(2025 年 8 月发布),FastAPI 的使用份额在一年内从 29% 增长至 38%。fastapi.tiangolo.com/↩︎

  22. ^(1) React 19 于 2024 年 12 月发布稳定版。React Compiler 可执行自动记忆化,这是一项关键特性,它改变了围绕 useMemo 和 useCallback 的推荐模式。react.dev/blog/2024/12/05/react-19↩︎

  23. ^(2) React Compiler(前称 “React Forget”)可在构建时自动对组件和 Hook 进行记忆化,在大多数情况下使手动编写 useMemo 和 useCallback 变得没有必要。在已启用 React Compiler 的代码库中添加这些 Hook 会导致双重记忆化。react.dev/learn/react-compiler/introduction↩︎

  24. ^(3) Testing Library 的 @testing-library/user-event 包模拟真实的用户交互,包括完整的事件序列(pointerdown、mousedown、focus、click),而 fireEvent 仅分发单个合成 DOM 事件。对于依赖事件顺序的组件测试,这一区别至关重要。testing-library.com/docs/user-event/intro↩︎

  25. ^(4) Codex 子代理(多代理工作流)允许父 Codex 会话生成并行运行任务的子代理,并将结果返回给协调器。这一能力实现了本章所述的探索者/工作者模式。developers.openai.com/codex/subagents↩︎

  26. ^(5) axe-core 是由 Deque Systems 维护的开源无障碍测试引擎,于 2015 年开源。它涵盖 WCAG 2.0、2.1 和 2.2 的 A、AA、AAA 级别,也是 Google Lighthouse 无障碍审计的底层引擎。github.com/dequelabs/axe-core↩︎

  27. ^(6) Figma 宣布其官方 Dev Mode MCP 服务器进入测试阶段,向兼容 MCP 的客户端暴露设计文件数据,包括组件、变量和布局约束。该服务器面向拥有 Figma Dev 或 Full 座位的用户开放。www.figma.com/blog/introducing-figma-mcp-server/↩︎

  28. ^(7) Vaughan, D., ‘Codex Browser Use: Closing the Verification Loop,’ codex-resources, 2026 年 4 月,供延伸阅读;请参考 OpenAI 的 Codex 发行说明核实当前可用性。代理可在无头浏览器中渲染、点击并以视觉方式验证前端输出。↩︎

  29. ^(1) 《Cloud Native Development with Google Cloud》是对本章有意保持浅显的 Cloud Run、Cloud Storage 和 Terraform 技术的配套深度探讨,内容涵盖使用 buildpacks 部署多服务应用、GCS 托管静态网站、按服务配置服务账号,以及配合 GCS 远程后端使用 Terraform。↩︎

  30. ^(2) Vaughan, D., “Codex CLI for Terraform and Infrastructure as Code: The MCP Server, TerraShark, and Agent-Driven IaC Workflows,” codex-resources, 2026 年 6 月, danielvaughan.com/codex-resources/articles/2026-06-10-codex-cli-terraform-infrastructure-as-code-mcp-server-terrashark-pulumi-agent-skills/; “Codex CLI for Terraform Development: terraform-mcp-server, State Inspection, and Infrastructure Drift Detection,” codex-resources, 2026 年 5 月, danielvaughan.com/codex-resources/articles/2026-05-25-codex-cli-terraform-development-mcp-server-state-inspection-drift-detection/。HashiCorp 官方 Terraform MCP 服务器暴露了注册表、模块和策略查找工具,以及 HCP Terraform 和 Terraform Enterprise 工作区操作。↩︎

  31. “TerraFormer,” arXiv:2601.08734, 2026 年 1 月. 基准测试了最先进的语言模型在 Terraform 合成任务上的表现,并记录了幻觉资源类型和属性名为基线模型的主要失效模式。arxiv.org/abs/2601.08734↩︎

  32. ^(4) Vaughan, D., “Codex CLI for Terraform and Infrastructure as Code: The MCP Server, TerraShark, and Agent-Driven IaC Workflows,” codex-resources, 2026 年 6 月, danielvaughan.com/codex-resources/articles/2026-06-10-codex-cli-terraform-infrastructure-as-code-mcp-server-terrashark-pulumi-agent-skills/; “Codex CLI for Terraform Development: terraform-mcp-server, State Inspection, and Infrastructure Drift Detection,” codex-resources, 2026 年 5 月, danielvaughan.com/codex-resources/articles/2026-05-25-codex-cli-terraform-development-mcp-server-state-inspection-drift-detection/。HashiCorp 官方 Terraform MCP 服务器暴露了注册表、模块和策略查找工具,以及 HCP Terraform 和 Terraform Enterprise 工作区操作。↩︎

  33. ^(5) Vaughan, D., “Codex CLI for Terraform and Infrastructure as Code: The MCP Server, TerraShark, and Agent-Driven IaC Workflows,” codex-resources, 2026 年 6 月, danielvaughan.com/codex-resources/articles/2026-06-10-codex-cli-terraform-infrastructure-as-code-mcp-server-terrashark-pulumi-agent-skills/; “Codex CLI for Terraform Development: terraform-mcp-server, State Inspection, and Infrastructure Drift Detection,” codex-resources, 2026 年 5 月, danielvaughan.com/codex-resources/articles/2026-05-25-codex-cli-terraform-development-mcp-server-state-inspection-drift-detection/。HashiCorp 官方 Terraform MCP 服务器暴露了注册表、模块和策略查找工具,以及 HCP Terraform 和 Terraform Enterprise 工作区操作。↩︎

参考文献

  1. Vaughan, D., “Codex CLI for Terraform and Infrastructure as Code: The MCP Server, TerraShark, and Agent-Driven IaC Workflows,” codex-resources, 2026 年 6 月, https://danielvaughan.com/codex-resources/articles/2026-06-10-codex-cli-terraform-infrastructure-as-code-mcp-server-terrashark-pulumi-agent-skills/; and “Codex CLI for Terraform Development: terraform-mcp-server, State Inspection, and Infrastructure Drift Detection,” codex-resources, 2026 年 5 月, https://danielvaughan.com/codex-resources/articles/2026-05-25-codex-cli-terraform-development-mcp-server-state-inspection-drift-detection/. HashiCorp 官方 Terraform MCP 服务器公开了注册表、模块和策略查找工具,以及 HCP Terraform 和 Terraform Enterprise 工作区操作。↩︎

  2. Vaughan, D., “Codex CLI for Terraform and Infrastructure as Code: The MCP Server, TerraShark, and Agent-Driven IaC Workflows,” codex-resources, 2026 年 6 月, https://danielvaughan.com/codex-resources/articles/2026-06-10-codex-cli-terraform-infrastructure-as-code-mcp-server-terrashark-pulumi-agent-skills/; and “Codex CLI for Terraform Development: terraform-mcp-server, State Inspection, and Infrastructure Drift Detection,” codex-resources, 2026 年 5 月, https://danielvaughan.com/codex-resources/articles/2026-05-25-codex-cli-terraform-development-mcp-server-state-inspection-drift-detection/. HashiCorp 官方 Terraform MCP 服务器公开了注册表、模块和策略查找工具,以及 HCP Terraform 和 Terraform Enterprise 工作区操作。↩︎

  3. Vaughan, D., “Codex CLI for GitOps Workflows: ArgoCD Application Generation, Kustomize Overlay Management, and Environment Promotion Pipelines,” codex-resources, 2026 年 5 月, https://danielvaughan.com/codex-resources/articles/2026-05-17-codex-cli-gitops-argocd-flux-kustomize-environment-promotion-pipelines/.↩︎

  4. Vaughan, D., “Codex CLI for GitOps Workflows: ArgoCD Application Generation, Kustomize Overlay Management, and Environment Promotion Pipelines,” codex-resources, 2026 年 5 月, https://danielvaughan.com/codex-resources/articles/2026-05-17-codex-cli-gitops-argocd-flux-kustomize-environment-promotion-pipelines/.↩︎

  5. Vaughan, D., “Codex CLI for Day-Two Operations: Runbooks, Drift Detection, and Platform Engineering Automation,” codex-resources, 2026 年 5 月, https://danielvaughan.com/codex-resources/articles/2026-05-15-codex-cli-day-two-operations-runbooks-drift-detection-platform-engineering/.↩︎

  6. Vaughan, D., “Codex CLI for Day-Two Operations: Runbooks, Drift Detection, and Platform Engineering Automation,” codex-resources, 2026 年 5 月, https://danielvaughan.com/codex-resources/articles/2026-05-15-codex-cli-day-two-operations-runbooks-drift-detection-platform-engineering/.↩︎

  7. Vaughan, D., “Codex CLI for Day-Two Operations: Runbooks, Drift Detection, and Platform Engineering Automation,” codex-resources, 2026 年 5 月, https://danielvaughan.com/codex-resources/articles/2026-05-15-codex-cli-day-two-operations-runbooks-drift-detection-platform-engineering/.↩︎

posted @ 2026-09-23 20:35  绝不原创的飞龙  阅读(41)  评论(0)    收藏  举报