Repository navigation
Conversation
Opening the installation_id file read-write at startup fails with EPERM inside an enclosing sandbox that allows reading the id but denies writing it, even though the file already holds a valid UUID. Add a read-only fast path that reuses an existing, valid installation id without requesting write access; missing, unreadable, or invalid ids fall through to the existing locked create/repair path unchanged. Fixes a startup blocker for nested `codex exec` under a read-only codex home. Adds a regression test that makes an existing valid id read-only and asserts reuse still succeeds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
codexopens itsinstallation_idfile withread(true).write(true).create(true)at startup. When the CLI runs inside an enclosing sandbox that allows reading~/.codex/installation_idbut denies opening it for writing, this writable open fails withEPERMeven though the file already holds a valid UUID — blockingcodex execfrom starting in-process app-server.This adds a read-only fast path that reuses an existing, valid installation id without requesting write access. Missing, unreadable, or invalid ids fall through to the existing locked create/repair path unchanged, preserving the original creation/repair/concurrency semantics.
Related Issue
Closes openai#42398
Tests
codex-coreinstallation_id unit tests)The new test
resolve_installation_id_reuses_existing_uuid_when_writes_deniedsets the id file's permissions to0o444(which makes a read-write open fail with EACCES, as verified) and asserts that resolution still returns the existing UUID via the read-only fast path.