Codex IDE 扩展Codex (IDE extension)
Codex IDE 扩展是装进 VS Code / Cursor / Windsurf 的扩展,不是独立 IDE —— 它通过 app server 与 CLI 共享同一套会话机制。
The Codex IDE extension is an extension you install into VS Code / Cursor / Windsurf, not a standalone IDE — it shares the same session mechanism with the CLI through the app server.
适合与不适合When to use it, when not to
适合两类人:
- 已在用 VS Code / Cursor / Windsurf 等编辑器,希望在同一环境里用 Codex 而不切换工具的人
- 需要 IDE 与 CLI 共享会话的人(app server 架构)
不适合需要独立编辑器的人 —— 本形态必须依附已有编辑器,无法单独使用。
另需注意:本地任务依赖编辑器进程常驻。
要「关机后继续跑」,须改用云委派(Codex Cloud)。
A fit for two groups:
- People already in VS Code / Cursor / Windsurf who want Codex in the same environment without switching tools
- People who need the IDE and the CLI to share sessions (the app server architecture)
Not a fit for people who need a standalone editor — this form must attach to an existing editor and cannot be used alone.
Also note: local tasks depend on the editor process staying alive, so "keep running after shutdown" requires cloud delegation (Codex Cloud).
中文生态China availability 国产 / 国内可直接用 / 备案状态 · 快照domestic / direct access / CAC filing · snapshot 2026-10-20
- 出品属地Origin
- 国外出品foreign-made 国外主体(网信办公示名单未见对应备案主体)。foreign entity (no matching filing entity in the CAC registry).
- 国内使用Direct access
- 直连不可达direct blocked developers.openai.com 大陆直连被拦(403),走代理 200——拦截发生在网络层,不是反爬。developers.openai.com returns 403 direct from mainland but 200 via proxy — the block is at the network layer, not anti-bot.
- 备案状态CAC filing
- 未见于备案名单not in filing list:未见于网信办公示名单(2026-10-20 检索 13 批附件,https://www.cac.gov.cn/2024-04/02/c_1713729983803145.htm);该产品未面向大陆公众提供服务,备案不适用。not in the CAC public registry (13 batch attachments searched 2026-10-20, https://www.cac.gov.cn/2024-04/02/c_1713729983803145.htm); the product does not serve the mainland public, so filing does not apply.
备案信息以网信办《生成式人工智能服务已备案信息》公示名单为准(按批次滚动更新,本站只抄编号不解读);「大陆可直连」是本站从大陆网络直连实测的结果,不是厂商承诺。GitHub 类站点当日实测有波动,口径写在依据里。Filing status is quoted from the CAC public registry (updated batch by batch; this site copies the number and does not interpret it). "Direct access" is this site's own reachability measurement from a mainland network, not a vendor promise. GitHub-hosted sites fluctuated on the measurement day — the note says so.
固定坐标系Fixed coordinate system
8 个维度dimensions, 与同分区其他对象逐项可比each comparable item by item against others in the same section.
- 模型与开放条件Model & openness
用的是 CLI 那套 agent 和配置,模型可以换。
官方 IDE 页原文:"It uses the same agent as the Codex CLI and shares the same configuration"
官方定价页列出的可用模型:
- GPT-5.5
- GPT-5.4
- GPT-5.4 mini
- Pro 另有 GPT-5.3-Codex-Spark(research preview)
聊天输入框下有 模型切换器,可以调 reasoning effort(
low/medium/high)。默认模型在共享的
config.toml里设(model = "..."),IDE 与 CLI 共用, 所以自定义 provider 也走同一套model_providers配置(见 CLI / SDK 档案)。BYOK 可用:官方支持用 API key 登录;JetBrains 集成还可走 JetBrains AI 订阅。 API key 路径下,模型可用范围跟随该 key 的 API 模型。
It uses the CLI's agent and configuration; the model is switchable.
Official IDE page wording: "It uses the same agent as the Codex CLI and shares the same configuration"
Models listed on the official pricing page:
- GPT-5.5
- GPT-5.4
- GPT-5.4 mini
- Pro additionally has GPT-5.3-Codex-Spark (research preview)
Below the chat input there is a model switcher, with reasoning effort adjustable (
low/medium/high).The default model is set in the shared
config.toml(model = "..."), shared by IDE and CLI, so custom providers go through the samemodel_providersconfiguration (see the CLI / SDK dossiers).BYOK works: the official supports logging in with an API key; the JetBrains integration can also ride a JetBrains AI subscription. On the API-key path, the usable model range follows that key's API models.
- 运行位置Where it runs
它是扩展,不是独立编辑器。
官方 README 原文:"If you want Codex in your code editor (VS Code, Cursor, Windsurf), install in your IDE."
也就是装进 VS Code / Cursor / Windsurf 这类已有编辑器。
这和 Zed(独立编辑器)、Cline Desktop(原生应用)是不同形态。
It is an extension, not a standalone editor.
Official README wording: "If you want Codex in your code editor (VS Code, Cursor, Windsurf), install in your IDE."
That is: install into an existing editor such as VS Code / Cursor / Windsurf.
This is a different form from Zed (standalone editor) and Cline Desktop (native app).
- 本地文件Local files
通过宿主编辑器访问工作区文件。
上下文来自打开的文件、选区与
@file引用。 另有 Auto Context:自动带入最近文件与 IDE 上下文 (见/auto-context)。官方口径:工作区 = 当前目录加临时目录(如
/tmp),写入默认限工作区。Windows 上可以原生运行(走 Windows 沙箱),也可以改用 WSL2 (设置项
chatgpt.runCodexInWindowsSubsystemForLinux)。官方 IDE 文档没有描述独立语义索引 —— 本地文件检索由同一 agent 的工具完成。
核验:已查官方 features 与 settings 两页。
Accesses workspace files through the host editor.
Context comes from open files, selections and
@filereferences. There is also Auto Context: automatically pulling in recent files and IDE context (see/auto-context).Official stance: workspace = current directory plus temp directories (e.g.
/tmp); writes default to the workspace.On Windows it can run natively (via the Windows sandbox) or switch to WSL2 (setting
chatgpt.runCodexInWindowsSubsystemForLinux).The official IDE docs describe no standalone semantic index — local file retrieval is done by the same agent's tools.
Verification: checked the official features and settings pages.
- 关机后的任务Tasks after shutdown
有云端形态:官方称可以从 IDE 委派任务到 Codex Cloud。
IDE 页原文:"delegate tasks to Codex Cloud"
功能页原文:"Offload longer jobs to a cloud environment"
用
/cloud与/local切换。云任务在 OpenAI 托管的容器里后台运行(含并行), 所以本地编辑器关掉之后云任务还会继续。 本地任务依赖宿主编辑器进程,关掉就停。
云任务与本地消息共享套餐用量(官方定价页称共用 5 小时窗口)。
There is a cloud form: the official says tasks can be delegated from the IDE to Codex Cloud.
IDE page wording: "delegate tasks to Codex Cloud"
Features page wording: "Offload longer jobs to a cloud environment"
Switch with
/cloudand/local.Cloud tasks run in the background (including in parallel) inside OpenAI-managed containers, so cloud tasks keep going after the local editor is closed. Local tasks depend on the host editor process — close it and they stop.
Cloud tasks and local messages share plan usage (the official pricing page says a shared 5-hour window).
- 工具与扩展Tools & extensions
内置第一方工具与命令都已核验。
工具:
- 网页搜索 —— 官方称默认启用,走 OpenAI 维护的搜索缓存,可配
web_search = "live" | "disabled" - 图像生成 ——
$imagegen,模型gpt-image-2,计入用量且更快耗尽额度 - 代码审查 ——
/review - 编辑器上下文 ——
@file、选区、拖拽图片
命令面板命令:
chatgpt.newChat/addToThread/addFileToThread/implementTodo, 另有 TODO CodeLens。MCP 官方明确支持 IDE 扩展。
支持 STDIO 与 Streamable HTTP;CLI 与 IDE 共享
config.toml里的[mcp_servers.<name>](含enabled_tools,以及逐 server、逐 tool 的approval_mode)。原文:"Codex supports MCP servers in both the CLI and the IDE extension"
Built-in first-party tools and commands are all verified.
Tools:
- web search — the official says enabled by default, via an OpenAI-maintained search cache, configurable
web_search = "live" | "disabled" - image generation —
$imagegen, modelgpt-image-2, counts against usage and drains quota faster - code review —
/review - editor context —
@file, selections, drag-in images
Command-palette commands:
chatgpt.newChat/addToThread/addFileToThread/implementTodo, plus TODO CodeLens.MCP is explicitly supported in the IDE extension officially.
STDIO and Streamable HTTP supported; CLI and IDE share
[mcp_servers.<name>]inconfig.toml(includingenabled_tools, and per-server, per-toolapproval_mode).Original wording: "Codex supports MCP servers in both the CLI and the IDE extension"
- 网页搜索 —— 官方称默认启用,走 OpenAI 维护的搜索缓存,可配
- 上下文与记忆Context & memory
app server 架构仍是关键设计 —— 线程可以启动、续接与恢复, IDE 与 CLI 共享同一套会话机制和同一份配置。
官方另外补了三点:
- 从本地会话发起云任务会记住会话上下文(云任务转回本地续聊也保留上下文)
/status显示 thread ID、上下文用量与速率限额/goal可设持久目标
上下文窗口的具体数值与自动压缩策略,官方未在 IDE 文档单列。
压缩在 CLI / SDK 侧经
compact_prompt等配置项;核验:已查官方 features 与 slash-commands 两页。
The app-server architecture remains the key design — threads can be started, resumed and recovered; IDE and CLI share the same session mechanics and the same configuration.
The official adds three more points:
- launching a cloud task from a local session remembers the session context (and context is kept when a cloud task returns to local to continue)
/statusshows the thread ID, context usage and rate limits/goalcan set a persistent goal
Concrete context-window numbers and the automatic compaction policy are not given separately in the IDE docs.
Compaction on the CLI / SDK side goes through config keys such as
compact_prompt;Verification: checked the official features and slash-commands pages.
- 权限与限制Permissions & limits
IDE 与 CLI 共用同一套沙箱与审批。
官方 settings 页原文:"The Codex IDE extension uses the Codex CLI"
同页:审批与沙箱在共享的
~/.codex/config.toml里配置。UI 侧有三档审批模式:
Chat/Agent/Agent (Full Access)。- 默认
Agent—— 在工作目录内自动读写并执行命令,工作目录外或联网仍需审批 - 只有
Full Access才免审批联网
官方安全页口径(含 IDE extension): 默认 无网络 + 写入限当前工作区;
.git/.agents/.codex递归只读。审批与沙箱键同 CLI:
approval_policy/sandbox_mode/[sandbox_workspace_write] network_access与network_proxy域名清单。 Windows 原生沙箱默认elevated。IDE and CLI share the same sandbox and approvals.
Official settings page wording: "The Codex IDE extension uses the Codex CLI"
Same page: approvals and sandbox are configured in the shared
~/.codex/config.toml.The UI side has three approval modes:
Chat/Agent/Agent (Full Access).- default
Agent— reads/writes and executes commands automatically inside the working directory, but outside the working directory or for networking it still asks - only
Full Accessskips approval for networking
Official security page stance (covering the IDE extension): by default no network + writes limited to the current workspace;
.git/.agents/.codexrecursively read-only.Approval and sandbox keys are the same as the CLI:
approval_policy/sandbox_mode/[sandbox_workspace_write] network_accessand thenetwork_proxydomain list. The Windows native sandbox defaults toelevated.- 默认
- 适合什么任务Best for
适合两类人:
- 已在用 VS Code / Cursor / Windsurf 等编辑器,希望在同一环境里用 Codex 而不切换工具的人
- 需要 IDE 与 CLI 共享会话的人(app server 架构)
Fits two kinds of people:
- those already using VS Code / Cursor / Windsurf-style editors who want Codex in the same environment without switching tools
- those who need IDE and CLI to share sessions (the app-server architecture)
头号误解Top misconception
- 把它当成独立 IDE,其实质是装进已有编辑器的扩展Treating it as a standalone IDE — it is really an extension installed into an existing editor
- 以为 IDE 扩展与 CLI 是两套独立系统,app server 架构让它们共享会话Assuming the IDE extension and the CLI are two separate systems — the app server architecture lets them share sessions
- 以为 IDE 扩展的权限体系与 CLI 不同——两者共用 config.toml,沙箱与审批一致Assuming the IDE extension has its own permission model — both share config.toml, and the sandbox and approvals are the same
未知项清单Known unknowns
- 沙箱在 Windows / macOS / Linux 的逐平台实现差异
- 上下文窗口的具体数值与自动压缩触发阈值
- app server 的并发写与跨机迁移语义
- 换用非 OpenAI provider 后工具调用的质量对齐度
- Per-platform sandbox implementation differences on Windows / macOS / Linux
- Concrete context-window numbers and the automatic-compaction trigger threshold
- Concurrency-write and cross-machine migration semantics of the app server
- Tool-call quality alignment after switching to a non-OpenAI provider
证据来源Evidence sources
判断可回到以下一手源复核。本站核验日Every judgement can be rechecked against the primary sources below. Verified on 2026-10-23,内容更新日content updated on 2026-10-08。
| 类型Type | 名称Name | 链接Link |
|---|---|---|
| docs | OpenAI · Codex IDE 文档(扩展形态、云委派总览)OpenAI · Codex IDE docs (extension form, cloud-delegation overview) | https://developers.openai.com/codex/ide |
| docs | OpenAI · Codex IDE Features(模型切换、审批模式、云委派、web search、图像生成)OpenAI · Codex IDE Features (model switching, approval modes, cloud delegation, web search, image generation) | https://developers.openai.com/codex/ide/features |
| docs | OpenAI · Codex IDE Settings(共享 config.toml、Windows/WSL 设置)OpenAI · Codex IDE Settings (shared config.toml, Windows/WSL settings) | https://developers.openai.com/codex/ide/settings |
| docs | OpenAI · Codex IDE Slash commands(/cloud /local /status /goal)OpenAI · Codex IDE Slash commands (/cloud /local /status /goal) | https://developers.openai.com/codex/ide/slash-commands |
| docs | OpenAI · Codex Cloud(云任务后台运行、@codex、PR)OpenAI · Codex Cloud (cloud tasks run in background, @codex, PRs) | https://developers.openai.com/codex/cloud |
| docs | OpenAI · Codex Cloud environments(托管容器、setup/agent 两阶段)OpenAI · Codex Cloud environments (managed containers, setup/agent two phases) | https://developers.openai.com/codex/cloud/environments |
| docs | OpenAI · Codex Agent approvals & security(沙箱默认、审批策略、受保护路径)OpenAI · Codex Agent approvals & security (sandbox defaults, approval policies, protected paths) | https://developers.openai.com/codex/agent-approvals-security |
| docs | OpenAI · Codex MCP(CLI 与 IDE extension 支持 STDIO/Streamable HTTP)OpenAI · Codex MCP (CLI and IDE extension support STDIO/Streamable HTTP) | https://developers.openai.com/codex/mcp |
| docs | OpenAI · Codex Config basics(默认模型、approval_policy、sandbox_mode)OpenAI · Codex Config basics (default model, approval_policy, sandbox_mode) | https://developers.openai.com/codex/config-basic |
| pricing | OpenAI · Codex Pricing(可用模型与套餐)OpenAI · Codex Pricing (usable models and plans) | https://developers.openai.com/codex/pricing |
| repo | OpenAI · Codex 仓库 README(含 IDE 安装说明)OpenAI · Codex repository README (includes IDE install instructions) | https://github.com/openai/codex |
| changelog | OpenAI · Codex CLI ReleasesOpenAI · Codex CLI Releases | https://github.com/openai/codex/releases |
实测记录Measured runs
本档未跑端到端编码任务;能力结论来自官方文档,编码向测量协议见 protocols/coding/_protocol.md。
实测建议:重点测 app server 的会话续接 —— 在 IDE 开会话、切到 CLI 继续,看状态是否完整保留。
这是它架构上最有价值也最需要验证的点。
This site has not completed measured runs. The test protocol is at protocols/coding/_protocol.md.
Suggested measurement: focus on app-server session continuity — open a session in the IDE, switch to the CLI to continue, and check whether state is fully preserved.
That is architecturally its most valuable and most verification-worthy point.
形态澄清(这一条最容易被误解)Form clarification (the most easily misunderstood point)
它明确列出支持的三种宿主编辑器。
官方 README 原文:"If you want Codex in your code editor (VS Code, Cursor, Windsurf), install in your IDE."
关键信息:这说明 Codex IDE 形态是「扩展」而不是「编辑器」。
IDE 形态三种对比
| 形态 | 代表 | 含义 |
|---|---|---|
| 独立编辑器 | Zed | 自带完整编辑器,AI 是其中一部分 |
| 原生桌面应用 | Cline Desktop | 不依附于任何编辑器 |
| 编辑器扩展 | Codex IDE、Copilot、Cline 扩展 | 装进已有编辑器 |
这个区分很重要:
- 扩展形态的「索引策略」「上下文构建」往往由宿主编辑器决定,而不是由这个工具自己决定
- 所以本条目与 Zed 不完全可比 —— 一个是独立编辑器,一个是扩展
It explicitly lists three supported host editors.
Official README wording: "If you want Codex in your code editor (VS Code, Cursor, Windsurf), install in your IDE."
Key information: this shows the Codex IDE form is an "extension", not an "editor".
Comparing the three IDE-class forms
| Form | Example | Meaning |
|---|---|---|
| Standalone editor | Zed | ships a full editor; AI is part of it |
| Native desktop app | Cline Desktop | attaches to no editor |
| Editor extension | Codex IDE, Copilot, the Cline extension | installs into an existing editor |
This distinction matters:
- in the extension form, "indexing strategy" and "context building" are often decided by the host editor, not by this tool itself
- so this entry is not fully comparable with Zed — one is a standalone editor, the other an extension
与 CLI 形态的关系Relationship with the CLI form
两个条目,不同分区,但共享后端:
| CLI 形态 | IDE 形态(本条目) | |
|---|---|---|
| 形态 | 终端进程 | 编辑器扩展 |
| 授权 | 随 ChatGPT 订阅 | 同一授权 |
| 后端 | app server | 同一个 app server |
app server 架构的实际意义:线程可启动、续接与恢复。
所以在 IDE 里开的会话可以在 CLI 里续上,反过来也一样。
这是本工具最有价值的架构特点,也是 CLI 与 IDE 两个条目必须交叉引用的原因。
Two entries, different categories, but a shared backend:
| CLI form | IDE form (this entry) | |
|---|---|---|
| Form | terminal process | editor extension |
| Authorization | rides the ChatGPT subscription | the same authorization |
| Backend | app server | the same app server |
The practical meaning of the app-server architecture: threads can be started, resumed and recovered.
So a session opened in the IDE can be continued in the CLI, and vice versa.
This is the tool's most valuable architectural feature, and the reason the CLI and IDE entries must cross-reference each other.
采集限制Collection limits
本次(2026-10-08)已取到官方 IDE 文档站正文 developers.openai.com/codex/ide 及其 features / settings / slash-commands 子页, 并交叉核对了 cloud、config-basic、安全与 MCP 页。
此前一度取不到,属取证故障,非官方缺页。
已核验:
- 工具集(web search、图像生成、code review、编辑器上下文)与 MCP 支持
- 三档审批模式(Chat / Agent / Agent Full Access)与沙箱默认值
- 云委派(Codex Cloud)与本地 / 云端会话上下文保留
- 模型切换器、可用模型清单与 API key 登录
- 授权随 ChatGPT 订阅;许可证 Apache-2.0
官方未说明:
- IDE 与 CLI 沙箱的逐平台实现差异(官方只说 OS 级强制)
2026-10-08 fetched the official IDE docs-site body at developers.openai.com/codex/ide and its features / settings / slash-commands subpages, and cross-checked the cloud, config-basic, security and MCP pages.
Earlier fetches failed — that was an evidence-gathering fault, not a missing official page.
Verified:
- the tool set (web search, image generation, code review, editor context) and MCP support
- the three approval modes (Chat / Agent / Agent Full Access) and sandbox defaults
- cloud delegation (Codex Cloud) and local/cloud session-context retention
- the model switcher, the usable-model roster and API-key login
- authorization rides the ChatGPT subscription; license Apache-2.0
Not stated by the official:
- per-platform implementation differences of the IDE vs CLI sandbox (the official only says OS-level enforcement)
相关条目Related entries
- Claude CodeClaude Code (IDE extension)同为「扩展 + CLI」双形态架构Also an "extension + CLI" dual-form architecture
- ZedZed同分区的另一端:独立编辑器The other end of this category: a standalone editor
- ClineCline三形态全覆盖的另一实现The other implementation covering all three forms
- Codex SDKCodex SDK另一层 · 框架与运行时Other layer · Frameworks & runtimes
本页由This page is generated from the ai-handbook 数据层生成(CC BY 4.0)。data layer (CC BY 4.0).
方法论与坐标系定义见仓库内For the methodology and coordinate definitions, see METHODOLOGY.md.