[Bug]: Codex text generation fails with "invalid transport" when launch args define an MCP server
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 半天
- 新手友好度
- 58/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- shell, typescript
- 领域
- backend
调研方向
Start in apps/server/src/textGeneration/CodexTextGeneration.ts, where codexMcpServersOff builds the inline mcp_servers={...} override and codexExecLaunchArgs supplies the earlier -c flags. The issue's shell snippets reproduce the override conflict with the plain Codex CLI, so run them first. Done means text generation succeeds with a launch-arg MCP server present and that server is disabled for the run. Server names containing a dot need the table form kept, so account for that case.
由索引模型根据 Issue 内容生成。
描述
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- Give a Codex provider instance launch args that define an MCP server with
-cflags, for example:-c 'mcp_servers.t3-code.url="http://127.0.0.1:1/mcp"' -c 'mcp_servers.t3-code.enabled_tools=["t3_thread_list"]' - Use that instance for text generation.
- Start a new thread in a worktree.
The cause reproduces with plain Codex CLI, without T3:
A=(-c 'mcp_servers.t3-code.url="http://127.0.0.1:1/mcp"')
codex "${A[@]}" -c 'mcp_servers={"t3-code"={enabled=false}}' mcp list --json # invalid transport in `mcp_servers.t3-code`
codex "${A[@]}" -c 'mcp_servers.t3-code.enabled=false' mcp list --json # works: enabled=false, transport kept
codex -c 'mcp_servers={"t3-code"={enabled=false}}' "${A[@]}" mcp list --json # works: table first, launch args merge into it
Expected behavior
The thread gets a generated title and the worktree branch is renamed, with the launch-arg MCP server turned off for the text-generation run like any other server.
Actual behavior
Every text-generation run fails before Codex starts, so threads keep no generated title and branches keep their t3/xxxxxxxx name:
Could not rename the worktree branch, so it stays t3/cbad53ab. Text generation failed in generateBranchName:
Codex CLI command failed: Error loading config.toml: invalid transport
in `mcp_servers.t3-code`
generateThreadTitle fails with the same error.
Cause. In apps/server/src/textGeneration/CodexTextGeneration.ts, codexMcpServersOff turns the listed servers off with one inline table:
`mcp_servers={${names.map((name) => `${JSON.stringify(name)}={enabled=false}`).join(",")}}`
Since #32597, the launch args' -c flags also reach codex exec through codexExecLaunchArgs, ahead of this table. Within Codex's CLI override layer, the later mcp_servers={...} replaces the mcp_servers table that the earlier -c mcp_servers.t3-code.* flags built. That leaves t3-code = {enabled=false} with no transport. Servers defined in config.toml are unaffected, because the CLI layer merges with the file layer.
A quoted dotted path, -c 'mcp_servers."t3-code".enabled=false', also failed, with invalid transport in mcp_servers."t3-code", so Codex does not seem to read quoted segments in -c keys.
Suggested change. Emit one --config mcp_servers.<name>.enabled=false per server instead of one table, because a dotted override merges with whatever earlier flags defined. Server names that contain a . cannot be written that way. Those could keep the table form, placed before codexExecLaunchArgs(launchArgs) so that the launch args merge into it instead of being replaced.
Impact
Major degradation or frequent failure
Version or commit
0.1.10-nightly.20261113.4616
Environment
Linux (WSL2), Codex CLI 0.169.0-alpha.6
Logs or stack traces
TextGenerationError: Text generation failed in generateThreadTitle: Codex CLI command failed: Error loading config.toml: invalid transport
in `mcp_servers.t3-code`
at runCodexJson.runCodexCommand (.../t3:355300:20)
Workaround
A wrapper set as the provider's binary path that rewrites the mcp_servers={"NAME"={enabled=false},...} argument into one mcp_servers.NAME.enabled=false flag per server, in the same position.
- 主要语言
- TypeScript
- 星标
- 24.8k
- 派生
- 6.4k
- 平均合并
- 59 分钟
- 30 天内合并 PR
- 418
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pingdotgg/t3code 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
via-triage
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 68/100
维护者通常 1 天内回复
-
Question card options show LaTeX as raw source, though the question text renders it可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
[Bug]: Settings inheritance popover shows raw slugs for branch naming, default permissions and response streaming可能已有人在做 @juliusmarminge 于 1 天前认领。 未关闭vouch:denounced
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
相似的 Issue
-
bug platform:mobile root-cause:found
难度 2/5 1-3 小时 新手友好度 72/100
openchamber/openchamber#6926 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
push-based/user-flow#356 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
Cygnux-Labs/Tracekit#827 ·
维护者通常 1 天内回复
-
www build: a refused import shows only "ENOENT scandir <outDir>", never the build-audience error未关闭kind:defect
难度 1/5 1 小时以内 新手友好度 91/100
维护者通常 1 天内回复
-
type:bug
难度 2/5 1-3 小时 新手友好度 72/100
nightgauge/nightgauge#3266 ·
维护者通常 1 天内回复