Skip to content

test(#4511): Kimi live tests — honor KIMI_BASE_URL + skip on auth mismatch#229

Merged
Skobeltsyn merged 1 commit into
mainfrom
test/kimi-platform-skip
Jun 16, 2026
Merged

test(#4511): Kimi live tests — honor KIMI_BASE_URL + skip on auth mismatch#229
Skobeltsyn merged 1 commit into
mainfrom
test/kimi-platform-skip

Conversation

@Skobeltsyn

Copy link
Copy Markdown
Contributor

Summary

Kills the recurring "Kimi again" red. Root cause: Moonshot runs two platforms — api.moonshot.cn (China) and api.moonshot.ai (International) — and a key from one is rejected by the other. The local/dropped .secrets/kimi-key are International keys, but KimiClient.DEFAULT_BASE_URL is .cn, so they auth-fail.

Changes (test-only)

  • Honor KIMI_BASE_URL in the agentic-loop test — it built the agent via model { kimi(...) } without kimiBaseUrl, so it always hit .cn and failed no matter the env. Now sets kimiBaseUrl = baseUrl. → with KIMI_BASE_URL=https://api.moonshot.ai the suite is 4/4 green (was 3/4).
  • skipIfEnvironmental { } around the live calls (mirrors the Gemini geo-block guard): invalid_authentication / quota / 429 now 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.
  • default .cn with an .ai key → 3 skip + 1 empty-stream assertion (no auth-failure reds).

Test-only; live-llm-tagged so it's not in CI's build gate. Full ./gradlew build green.

CodeQL java-kotlin expected-red on Kotlin 2.4 (codeql#21938); build is the gate.

🤖 Generated with Claude Code

…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>
@Skobeltsyn Skobeltsyn merged commit 21f4fe3 into main Jun 16, 2026
3 of 4 checks passed
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