Skip to content

feat: Claude subscription integration with podman compose support - #5

Merged
0xPuncker merged 3 commits into
mainfrom
0xPuncker/cc-proxy-v3
Jun 21, 2026
Merged

feat: Claude subscription integration with podman compose support#5
0xPuncker merged 3 commits into
mainfrom
0xPuncker/cc-proxy-v3

Conversation

@0xPuncker

Copy link
Copy Markdown
Owner

Changes

  • Add Claude OAuth subscription token support as primary for Claude models
  • Update model mappings for latest models (claude-opus-4-8, claude-haiku-4-6, glm-5.2)
  • Migrate Makefile from docker-compose to podman compose
  • Improve error handling for auth errors (no fallback for configuration issues)
  • Add context window error logging hints
  • Remove adminer service from docker-compose

Fixes

  • Fixed credentials volume mount path (claude-credentials.json, not .credentials.json directory)
  • Fixed Makefile podman-restart target to use correct podman-stop/podman-run

Tests

All 82 tests passing

0xPuncker added 3 commits June 7, 2026 17:05
- 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
@0xPuncker
0xPuncker merged commit 1e86cb7 into main Jun 21, 2026
2 checks passed
@0xPuncker
0xPuncker deleted the 0xPuncker/cc-proxy-v3 branch June 21, 2026 19:49
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