fix(auth): kimi-coding pool base_url seeding + PKCE endpoint fallback#5669
Closed
teknium1 wants to merge 1 commit into
Closed
fix(auth): kimi-coding pool base_url seeding + PKCE endpoint fallback#5669teknium1 wants to merge 1 commit into
teknium1 wants to merge 1 commit into
Conversation
Contributor
|
1. credential_pool._seed_from_env() now calls _resolve_kimi_base_url() for kimi-coding provider, matching the runtime resolver logic. Previously, sk-kimi- prefixed keys were seeded with the default moonshot.ai URL, causing 401 on first request. Fixes #5561. 2. Hermes-native PKCE OAuth login (run_hermes_oauth_login_pure) now tries platform.claude.com first with console.anthropic.com fallback, consistent with refresh_anthropic_oauth_pure(). The old _OAUTH_TOKEN_URL constant hardcoded console.anthropic.com only.
ee3b3f6 to
1e36185
Compare
This was referenced Apr 8, 2026
Closed
Contributor
Author
|
Closing during PR triage — not pursuing this approach. |
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
Two auth reliability fixes:
1. kimi-coding credential pool seeds correct base_url (fixes #5561)
_seed_from_env()incredential_pool.pynow calls_resolve_kimi_base_url()for kimi-coding, matching the runtime resolver logic inauth.py. Previously,sk-kimi-prefixed keys were seeded with the defaultapi.moonshot.ai/v1URL (frompconfig.inference_base_url), causing HTTP 401 on the first request. The pool would mark the entry exhausted, and the second request would bypass the pool and succeed via the runtime resolver.2. PKCE OAuth token exchange uses endpoint fallback
The Hermes-native PKCE login flow (
run_hermes_oauth_login_pure) now triesplatform.claude.comfirst withconsole.anthropic.comfallback for the token exchange, consistent withrefresh_anthropic_oauth_pure()which was fixed in PR #3246. The old_OAUTH_TOKEN_URLconstant hardcoded onlyconsole.anthropic.com.Test plan
tests/test_credential_pool.py— 145 passedtests/test_api_key_providers.py— all passedtests/test_anthropic_adapter.py— 107 passed_OAUTH_TOKEN_URLSlist has platform.claude.com first, old constant removedRelated issues closed