fix(rotator): read codex CLI's nested auth.json shape#368
Merged
Conversation
…ners PR #366 was supposed to move codex-cli from initContainers to containers, but the awk move only added the new entry and didn't delete the old one. Result: spec had codex-cli in both lists, k8s rejected with "spec.template.spec.initContainers[1].name: Duplicate value". Strip the leftover container + its comment block. Final structure: containers = [litellm, codex-auth-rotator, codex-cli], initContainers = [codex-auth-seed]. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
codex CLI 0.125 writes auth.json as {tokens: {access_token, refresh_token,
id_token}, auth_mode, OPENAI_API_KEY, last_refresh}. The rotator's
_read_pod_auth_file only looked at top-level access_token, missed the
nested shape, returned None, and fell back to env-var candidates (which
are the laptop-bound dead tokens we're trying to escape).
Read either shape — nested wins, flat is the legacy rotator-written
fallback.
Co-Authored-By: Claude Opus 4.7 (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.
codex CLI 0.125 writes nested {tokens: {...}}; rotator only looked at top-level. Read either shape.