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
Approvability#
Verdict: Approved at
b055608Macroscope'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](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).