Skip to content

fix(install-cli): match Codex's temp-home warning, not our own temp root - #36

Merged
rldyourmnd merged 1 commit into
mainfrom
fix/temp-home-warning-under-redirected-tmpdir
Aug 1, 2026
Merged

fix(install-cli): match Codex's temp-home warning, not our own temp root#36
rldyourmnd merged 1 commit into
mainfrom
fix/temp-home-warning-under-redirected-tmpdir

Conversation

@rldyourmnd

Copy link
Copy Markdown
Contributor

Problem

install-cli failed for every installation whose Codex home sits under a temporary directory:

{"error": "installed Codex returned unexpected version diagnostics", "schema_version": 1}

is_expected_temporary_codex_home_warning rebuilt the whole warning locally from tempfile.gettempdir() and compared it for string equality. Codex reports the temporary root it resolved. Captured from a real run of the pinned rust-v0.146.0:

WARNING: proceeding, even though we could not create PATH aliases: Refusing to create
helper binaries under temporary dir "/tmp" (codex_home: AbsolutePathBuf(
"/tmp/nddev-nddev-codex-app-platform-caurg4ub/tmp/nddev-codex-runtime-proof-evv6839w/targets/codex"))

Codex says /tmp; the manager computed the caller's redirected TMPDIR. Any caller that redirects it — every harness lane does, for isolation — made the two disagree permanently.

Change

Read the root out of the warning instead of assuming it matches ours.

Strictness is preserved by binding the message to the invocation rather than to a guessed temp root: the codex_home it names must be exactly our resolved target, and that target must genuinely sit under the root it named. A lookalike message about a different directory still fails.

The failure path also quoted nothing at all. A mismatch against an unseen string, on a stream produced by a third-party binary whose wording is outside our control, is a bisect rather than a fix — it now includes the diagnostics, already bounded by VERSION_OUTPUT_MAX_BYTES.

Verification

python3 scripts/run_harnesses.py --module nddev-codex-app --lane platform --platform ubuntu against the pinned release:

  • before: exit 2, codex runtime proof: FAIL
  • after: validate_platform.sh (ubuntu) — nddev-codex-app: PASS

ruff check and ruff format --check clean.

https://claude.ai/code/session_017fG88hR3mfP7YMFABzbKPB

install-cli rejected every installation whose Codex home sits under a
temporary directory:

  installed Codex returned unexpected version diagnostics

The check rebuilt Codex's warning locally from tempfile.gettempdir() and
compared the whole string for equality. Codex reports the temporary root it
resolved -- "/tmp" -- while any caller that redirects TMPDIR for isolation
makes gettempdir() return something else. Every harness lane redirects it, so
the two never agreed and a warning that is entirely expected was treated as
unknown output.

Read the root out of the warning instead of assuming it. Strictness is kept by
binding the message to this invocation: the codex_home it names must be
exactly our resolved target, and that target must genuinely sit under the root
it named, so a lookalike message about some other directory still fails.

The failure also quoted nothing. A mismatch against an unseen string, on a
stream produced by a third-party binary whose wording we do not control, is a
bisect rather than a fix; it now includes the diagnostics, already bounded by
VERSION_OUTPUT_MAX_BYTES.

Verified: `run_harnesses.py --module nddev-codex-app --lane platform
--platform ubuntu` goes from exit 2 to PASS.

Claude-Session: https://claude.ai/code/session_017fG88hR3mfP7YMFABzbKPB
@rldyourmnd
rldyourmnd merged commit 4ed17d4 into main Aug 1, 2026
9 checks passed
@rldyourmnd
rldyourmnd deleted the fix/temp-home-warning-under-redirected-tmpdir branch August 1, 2026 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant