fix(claude): authenticate gateway model cache refresh - #1755
Conversation
|
✅ Deterministic PR hygiene checks passed. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe gateway model cache refresh now accepts an options object, authenticates ChangesGateway cache authentication
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Claude Code only refreshes its gateway-model cache when it holds a credential, so the launch path pre-writes that cache for it. The pre-write fetch sent no admission credential, so on a listener that requires data-plane admission it got 401 and the picker kept showing yesterday's aliases. Attach the admission credential in its own header domain (never Authorization, which belongs to upstream providers on other data-plane surfaces), following the same precedence the opencode launcher already uses: environment token, hardened service-token file, then a configured admission key. Closes #1713 Co-authored-by: Ingwannu <ingwannu@users.noreply.github.com>
cded875 to
a9024c9
Compare
Summary
x-opencodex-api-keyadmission headerOPENCODEX_API_AUTH_TOKEN, then fall back to the first usable configured API keyScope
The default loopback listener remains unchanged and still works without a token. This fixes the 401/stale cache path only for configurations whose data plane requires admission.
Validation
bun test tests/claude-gateway-cache.test.ts(5 passed)bun run typecheckbun run privacy:scangit diff --checkFixes #1713
Summary by CodeRabbit
Bug Fixes
Tests