Skip to content

Drop transient Codex launcher paths before running loop-zero - #1613

Merged
mergify[bot] merged 1 commit into
mainfrom
lean178/1594-pin-local-check-path
Nov 26, 2026
Merged

mergify[bot] merged 1 commit into
mainfrom
lean178/1594-pin-local-check-path

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1594

The ai-accounts shim 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 72f087e4 and 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.py file 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-bot with what you need.

Review

  • primary, claude, 267938c, approve

Validation

Recorded for 267938c4bf9c

  • uv run --group dev ruff check src tests: exit 0
  • uv run --group dev tach check: exit 0
  • uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0
  • scripts/size_budget.sh: exit 0
  • uv run --group dev pytest -q: exit 0

Architecture-Review: unchanged; existing account selection and sandbox environment boundaries are preserved.

Co-Authored-By: Codex <noreply@openai.com>

@loopzero-feder-positronics loopzero-feder-positronics Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread tests/test_ai_accounts.py
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'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'].

@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@Mergifyio queue

@mergify

mergify Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

✅ Merged into main as 9b38ad8 at 07:49 UTC

6 min in the queue, 3 min of it CI.

So far

  • ✅ Entered the queue Thu 26 Nov, 07:43 · rule main · triggered by @eowca with the @mergifyio queue command
  • ✅ Passed · draft #1667
  • ✅ Merged 07:49 · 9b38ad8 · squash
3 merge conditions met
  • github-review-approved · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = checks
    • check-neutral = checks
    • check-skipped = checks
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = Loop-zero Eligibility
    • check-neutral = Loop-zero Eligibility
    • check-skipped = Loop-zero Eligibility

Times in UTC · dashboard · how the merge queue works

@mergify mergify Bot added the queued label Nov 26, 2026
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

No description provided.

@mergify
mergify Bot merged commit 9b38ad8 into main Nov 26, 2026
18 checks passed
@mergify mergify Bot removed the queued label Nov 26, 2026
@eowca
eowca deleted the lean178/1594-pin-local-check-path branch November 26, 2026 07:51
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.

Keep transient Codex launcher directories out of loop-zero’s check PATH

1 participant