test(#4511): Kimi live tests — honor KIMI_BASE_URL + skip on auth mismatch#229
Merged
Conversation
…t + skip on auth mismatch
The recurring "Kimi again" red is the Moonshot two-platform trap: the local/dropped
.secrets/kimi-key are International (api.moonshot.ai) keys, but KimiClient.DEFAULT_BASE_URL
is China (api.moonshot.cn), which rejects them with invalid_authentication.
- The full-agentic-loop test built the agent via `model { kimi(...) }` WITHOUT setting
kimiBaseUrl, so it always hit .cn and failed regardless of KIMI_BASE_URL. Now it sets
`kimiBaseUrl = baseUrl`. With KIMI_BASE_URL=https://api.moonshot.ai the suite is 4/4 green
(was 3/4).
- Added skipIfEnvironmental { } around the live calls (mirrors the Gemini geo-block guard):
invalid_authentication / quota / 429 now SKIP rather than fail, so a platform/key mismatch
stops reddening the live suite. (The streaming test on the wrong platform still asserts on
empty output — correct signal when misconfigured.)
Verified: KIMI_BASE_URL=https://api.moonshot.ai -> 4/4 pass; default .cn with an .ai key ->
3 skip + 1 empty-stream assertion (no auth-failure reds). Test-only; not in CI's build gate.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Kills the recurring "Kimi again" red. Root cause: Moonshot runs two platforms —
api.moonshot.cn(China) andapi.moonshot.ai(International) — and a key from one is rejected by the other. The local/dropped.secrets/kimi-keyare International keys, butKimiClient.DEFAULT_BASE_URLis.cn, so they auth-fail.Changes (test-only)
KIMI_BASE_URLin the agentic-loop test — it built the agent viamodel { kimi(...) }withoutkimiBaseUrl, so it always hit.cnand failed no matter the env. Now setskimiBaseUrl = baseUrl. → withKIMI_BASE_URL=https://api.moonshot.aithe suite is 4/4 green (was 3/4).skipIfEnvironmental { }around the live calls (mirrors the Gemini geo-block guard):invalid_authentication/ quota /429now skip instead of fail, so a platform/key mismatch stops reddening the live suite.Verified
KIMI_BASE_URL=https://api.moonshot.ai→ 4/4 pass..cnwith an.aikey → 3 skip + 1 empty-stream assertion (no auth-failure reds).Test-only;
live-llm-tagged so it's not in CI'sbuildgate. Full./gradlew buildgreen.🤖 Generated with Claude Code