Repository navigation
Drop transient Codex launcher paths before running loop-zero - #1613
Conversation
Architecture-Review: unchanged; existing account selection and sandbox environment boundaries are preserved. Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero primary review by claude on 267938c4bf9c252c6b298127bc4d1541a56c0a78, 17.1s: approve (0 critical, 0 important, 2 suggestion)
Settings per native call (launch configuration and CLI claims, not backend attestation):
- Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)
Native Claude output is retained in the restricted local review receipt.
| if name == "loopzero": | ||
| # Codex's transient launcher shims are hidden in the check sandbox. | ||
| arg0 = Path(os.environ.get("CODEX_HOME") or Path.home() / ".codex") / "tmp/arg0-linux" | ||
| rest = [d for d in rest if Path(d).parent != arg0 or not Path(d).name.startswith("codex-arg0")] |
There was a problem hiding this comment.
suggestion: Filter compares paths lexically, so a symlinked or non-normalized CODEX_HOME will not match
Path(d).parent != arg0 is a plain string-level comparison. Codex canonicalizes its home directory before it builds the tmp/arg0-linux/codex-arg0* PATH entry. If CODEX_HOME is set to a symlink, a relative path, or a path containing .., the PATH entry will be the canonical path, the comparison fails, and the transient directory stays in PATH. The receipt fingerprint then changes from session to session, which is the bug this change is meant to fix. Smallest fix: compare resolved paths, e.g. compute arg0 = (...).resolve() once and test Path(d).parent.resolve() == arg0, or use os.path.realpath on both sides. Resolving does not touch the filesystem in a way that matters here, and it keeps the filter narrow.
| codex.chmod(0o755 if pin_state != 'nonexecutable' else 0o644) | ||
| monkeypatch.setenv('PATH', f'{shims}:{binaries}') | ||
| codex_home = tmp_path / 'codex-home' | ||
| arg0 = codex_home / 'tmp/arg0-linux/codex-arg0ABC123' |
There was a problem hiding this comment.
suggestion: Test only covers the positive match; the narrowness of the filter is not pinned
The task says the filter matches only a named Codex launcher inside the active CODEX_HOME. The test adds one matching directory, but no test checks that near-misses survive: a codex-arg0* directory under a different home, or a directory under arg0-linux whose name does not start with codex-arg0. If someone loosens the predicate later (for example to a substring match on arg0), it could silently drop legitimate PATH entries and no test would fail. Add one or two decoy PATH entries to the loopzero case and assert they stay in env['PATH'].
|
@Mergifyio queue |
✅ Merged into
|
|
No description provided. |
Closes #1594
The
ai-accountsshim now strips Codex’s session-specific launcher directory before resolving and invoking loop-zero. It leaves ordinary tool paths, provider launches, reviewer pinning, and receipt validation as configured.The deployed check writer at
72f087e4and current main use the same fingerprint construction. In a real Bubblewrap probe, both invocations resolved the same Git and uv. Changing the transient path still caused receipt rejection before this patch. The patched shim produced a compatible receipt across both launches.The five loop-zero shim cases failed before the fix. The full
test_ai_accounts.pyfile now passes. Test lines grow by three, with both size caps passing. No host installation was changed.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Review
Validation
Recorded for
267938c4bf9cuv run --group dev ruff check src tests: exit 0uv run --group dev tach check: exit 0uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0scripts/size_budget.sh: exit 0uv run --group dev pytest -q: exit 0