Read one more Codex auth cache#134
Merged
Merged
Conversation
Codex accounts cached by opencode-anthropic-auth do not expose reusable OAuth tokens, so discovery now preserves cached usage snapshots as a low-priority fallback source. Constraint: opencode-anthropic-auth codex-accounts.json contains usage snapshots rather than live credentials. Rejected: Treating the cache entries as token-bearing accounts | the file does not contain access tokens. Confidence: high Scope-risk: moderate Directive: Keep cache-backed Codex accounts lower priority than live auth sources. Tested: xcodebuild test -project CopilotMonitor/CopilotMonitor.xcodeproj -scheme CopilotMonitor -only-testing:CopilotMonitorTests/TokenManagerTests -destination 'platform=macOS' Not-tested: Full app test suite.
The parser now has regression coverage for enabled cache entries, disabled-account filtering, and cached quota fields from opencode-anthropic-auth. Constraint: The cache file is a local JSON source with mixed numeric field representations. Confidence: high Scope-risk: narrow Directive: Update this test when the opencode-anthropic-auth codex-accounts.json schema changes. Tested: xcodebuild test -project CopilotMonitor/CopilotMonitor.xcodeproj -scheme CopilotMonitor -only-testing:CopilotMonitorTests/TokenManagerTests -destination 'platform=macOS' Not-tested: Full app test suite.
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
~/.config/opencode/opencode-anthropic-auth/codex-accounts.jsonin addition to codex-lb.Root Cause
Codex account discovery only considered token-bearing sources such as codex-lb and oc-chatgpt-multi-auth. The opencode-anthropic-auth
codex-accounts.jsonfile stores cached usage snapshots instead of reusable access tokens, so those accounts were previously invisible to OpenCode Bar.Validation
make setupxcodebuild test -project CopilotMonitor/CopilotMonitor.xcodeproj -scheme CopilotMonitor -only-testing:CopilotMonitorTests/TokenManagerTests -destination 'platform=macOS'xcodebuild clean build -project CopilotMonitor/CopilotMonitor.xcodeproj -scheme CopilotMonitor -destination 'platform=macOS'OpenAI accounts discovered: 5.origin/main; logs includedLoaded 4 cached Codex account(s) from opencode-anthropic-auth at /Users/kargnas/.config/opencode/opencode-anthropic-auth/codex-accounts.json.