fix(agents-login): codex config.toml optional — fixes ENOENT after entering device code#748
Merged
Merged
Conversation
… entering the device code `codex login --device-auth` writes auth.json but NOT config.toml, so captureCodex's readUtf8(config.toml) threw "ENOENT ... /home/agent/.codex/config.toml" right after the user entered their code, failing the whole sign-in. Read config.toml with readUtf8OrUndefined and include it only when present; payloadForApi requires only auth_json. (agents-api now accepts an auth_json-only codex credential and the runner self-provisions a config.toml.) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
After entering the device code, codex sign-in failed with
ENOENT … /home/agent/.codex/config.toml.codex login --device-authwritesauth.jsonbut notconfig.toml, yetcaptureCodexreadconfig.tomlwithreadUtf8(throws if missing) → the whole session failed at finalize.Fix: read
config.tomlwithreadUtf8OrUndefinedand include it only when present;payloadForApirequires onlyauth_json. Pairs with agents-api #135 (accepts auth-only codex credential; runner self-provisions aconfig.toml).Tests: 105 pass, branch 84.26%.
🤖 Generated with Claude Code