Skip to content

fix(agents-login): codex config.toml optional — fixes ENOENT after entering device code#748

Merged
ExtraToast merged 1 commit into
mainfrom
fix/agents-login-codex-optional-config
Jun 27, 2026
Merged

fix(agents-login): codex config.toml optional — fixes ENOENT after entering device code#748
ExtraToast merged 1 commit into
mainfrom
fix/agents-login-codex-optional-config

Conversation

@ExtraToast

Copy link
Copy Markdown
Owner

After entering the device code, codex sign-in failed with ENOENT … /home/agent/.codex/config.toml. codex login --device-auth writes auth.json but not config.toml, yet captureCodex read config.toml with readUtf8 (throws if missing) → the whole session failed at finalize.

Fix: read config.toml with readUtf8OrUndefined and include it only when present; payloadForApi requires only auth_json. Pairs with agents-api #135 (accepts auth-only codex credential; runner self-provisions a config.toml).

Tests: 105 pass, branch 84.26%.

🤖 Generated with Claude Code

… 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>
@ExtraToast ExtraToast merged commit 91b9c33 into main Jun 27, 2026
22 checks passed
@ExtraToast ExtraToast deleted the fix/agents-login-codex-optional-config branch June 27, 2026 13:27
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