Skip to content

fix(server): Codex V2 sessions expand ~ in the binary path - #13470

Merged
juliusmarminge merged 2 commits into
t3code/codex-turn-mappingfrom
v2/codex-binary-home
Sep 24, 2026
Merged

juliusmarminge merged 2 commits into
t3code/codex-turn-mappingfrom
v2/codex-binary-home

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Stacked on #13467.

A Codex binary path like ~/bin/codex passed the provider readiness probe, but every real V2 session then failed to spawn. CodexDriver builds the probe's settings with binaryPath: expandHomePath(config.binaryPath). createCodexAdapterV2 spread the raw config into the adapter's settings and fixed up only homePath, so the app-server spawn got the literal ~/bin/codex. Child processes don't get shell expansion.

Change

createCodexAdapterV2 now sets binaryPath: expandHomePath(config.binaryPath) where it builds the adapter's settings, next to the existing homePath resolution. It uses the same helper the driver uses.

Verification

  • New test in CodexAdapterV2.test.ts ("expands ~ in the configured binary path before spawning"). It builds the adapter through createCodexAdapterV2 with binaryPath: "~/bin/codex" and the real codexAppServerClientFactoryFromSettingsLayer, opens a session, and asserts that a recording spawner saw <homedir>/bin/codex.
  • Revert check: without the fix, the test fails with 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 . in apps/server: no errors.
  • vp lint on the two touched files: no new warnings. The two existing unused-variable warnings in CodexAdapterV2.ts are unrelated.
  • Not run: repo-wide checks, and a live Codex run. The test already records the exact spawn command.

Model: Claude Opus 5.5 (Claude Code)

🤖 Generated with Claude Code


Devin Review

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Sep 24, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at b055608

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:

  • No code objects were reviewed. Approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire — 4.9 KiB — 6.8 KiB ✅
Codex Thread snapshot wire — 3.7 KiB — 4.9 KiB ✅
Codex Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Codex Live turn WebSocket decoded — 20.4 KiB — 29.3 KiB ✅
Codex Live turn messages — 2 — 8 ✅
Claude Total thread wire — 4.9 KiB — 6.8 KiB ✅
Claude Thread snapshot wire — 3.7 KiB — 4.9 KiB ✅
Claude Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Claude Live turn WebSocket decoded — 20.8 KiB — 29.3 KiB ✅
Claude Live turn messages — 2 — 8 ✅

Baseline: unavailable · PR result: d5fbd4f · Source CI: failure

Scenario and decoded snapshot size

10 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.

  • Codex decoded thread snapshot: 106.1 KiB
  • Claude decoded thread snapshot: 106.4 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Base automatically changed from v2/codex-launch-args to t3code/codex-turn-mapping September 24, 2026 19:34
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>
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>
@juliusmarminge
juliusmarminge merged commit 5239fe0 into t3code/codex-turn-mapping Sep 24, 2026
22 of 23 checks passed
@juliusmarminge
juliusmarminge deleted the v2/codex-binary-home branch September 24, 2026 19:49
juliusmarminge added a commit that referenced this pull request Sep 24, 2026
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 24, 2026
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 25, 2026
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant