feat: Claude subscription integration with podman compose support - #5
Merged
Conversation
- Change context window error detection from DEBUG to WARN level
- Add clearer message: "Context window error from {PROVIDER} - message too long"
- Log specific warning for Claude subscription context window errors
This makes it easier to identify when Z.AI or other providers
hit context window limits during fallback scenarios.
…UTH_TOKEN The keychain→file sync (launchd) is unreliable inside containers: the agent runs outside the GUI login session and can't reliably read the macOS Keychain, so the mounted credentials file goes stale and the ~8h subscription token expires, causing repeated subscription auth failures. Add support for a static, long-lived OAuth token minted once with `claude setup-token` (~1-year lifetime) and passed via the CLAUDE_CODE_OAUTH_TOKEN env var. The proxy prefers this token over the credentials file, so containers no longer depend on the keychain at all. - readClaudeOAuthToken: early-return the static token when set (always-valid; revoked tokens still fall through the existing 401 re-read + fallback path) - /config exposes claudeSubscription.authMode (static-token | credentials-file) - startup banner annotates the subscription line with "(static token)" - docker-compose passes CLAUDE_CODE_OAUTH_TOKEN through - .env.docker.example + docs/CREDENTIAL_SYNC.md document the recommended flow; keychain/launchd sync demoted to legacy fallback The credentials-file path is fully preserved when the env var is unset.
- Fix docker-compose.yml volume mount to use ~/.claude/claude-credentials.json (not .credentials.json which is a directory) - Fix Makefile podman-restart target to use podman-stop/podman-run - Update Makefile comments for clarity
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.
Changes
Fixes
Tests
All 82 tests passing