fix(server): Codex V2 sessions expand ~ in the binary path - #13470
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This narrowly scoped fix normalizes home-relative Codex V2 binary paths before process spawning, while preserving existing behavior for other paths. Focused regression coverage verifies the exact executable passed to the spawner, and no product defaults or static-analysis suppressions are changed. Notes:
You can add or adjust custom eligibility rules. Learn more. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
The Codex driver expands a leading ~ in binaryPath for the readiness probe, but the V2 adapter spread the raw config into its settings, so a path like ~/bin/codex passed the probe and then failed to spawn for every real session. Expand it where the adapter builds its settings, next to the home path resolution. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2fa748f to
d5fbd4f
Compare
The nodeBuiltinImport rule does not apply to this test file, so the directive tripped TS377000 in the typecheck step. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
5239fe0
into
t3code/codex-turn-mapping
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Stacked on #13467.
A Codex binary path like
~/bin/codexpassed the provider readiness probe, but every real V2 session then failed to spawn.CodexDriverbuilds the probe's settings withbinaryPath: expandHomePath(config.binaryPath).createCodexAdapterV2spread the rawconfiginto the adapter's settings and fixed up onlyhomePath, so the app-server spawn got the literal~/bin/codex. Child processes don't get shell expansion.Change
createCodexAdapterV2now setsbinaryPath: expandHomePath(config.binaryPath)where it builds the adapter's settings, next to the existinghomePathresolution. It uses the same helper the driver uses.Verification
CodexAdapterV2.test.ts("expands ~ in the configured binary path before spawning"). It builds the adapter throughcreateCodexAdapterV2withbinaryPath: "~/bin/codex"and the realcodexAppServerClientFactoryFromSettingsLayer, opens a session, and asserts that a recording spawner saw<homedir>/bin/codex.expected [ '~/bin/codex' ] to deeply equal [ '/home/julius/bin/codex' ].vp test run src/orchestration-v2/Adapters/CodexAdapterV2.test.ts: 115 passed.vp exec tsc --noEmit -p .inapps/server: no errors.vp linton the two touched files: no new warnings. The two existing unused-variable warnings inCodexAdapterV2.tsare unrelated.Model: Claude Opus 5.5 (Claude Code)
🤖 Generated with Claude Code