feat(auth): add AWS Bedrock Mantle platform support to /login flow#1784
feat(auth): add AWS Bedrock Mantle platform support to /login flow#1784nimit2801 wants to merge 3 commits intoMoonshotAI:mainfrom
Conversation
- Add Bedrock Mantle platform to PLATFORMS with openai_legacy provider type - Add interactive region selection for Bedrock Mantle in setup flow - Handle OpenAI-compatible model listing for Mantle endpoints - Add documentation and examples for Bedrock Mantle usage - Add tests for Bedrock Mantle URL construction and model parsing
|
|
||
| **`/login` flow:** choose **AWS Bedrock Mantle (OpenAI-compatible)**, pick a region, enter the API key, then select a model. This writes a managed provider `managed:bedrock-mantle` and clears Moonshot search/fetch (those tools are Kimi Code–specific). | ||
|
|
||
| **Environment overrides** (optional): `OPENAI_BASE_URL` and `OPENAI_API_KEY` override the saved `base_url` and `api_key` for `openai_legacy` providers only when set; they do not change other providers’ URLs. |
There was a problem hiding this comment.
🟡 Documentation incorrectly states env overrides apply to openai_legacy only, but code also applies them to openai_responses
The new documentation in three places claims that OPENAI_BASE_URL and OPENAI_API_KEY environment variable overrides apply exclusively to openai_legacy providers. However, src/kimi_cli/llm.py:87 shows case "openai_legacy" | "openai_responses":, meaning these env vars also override openai_responses providers. The Chinese source-of-truth doc at docs/zh/configuration/providers.md:71 explicitly states 不会影响其他供应商 ("will not affect other providers"), which is factually wrong for openai_responses users. The same incorrect claim appears in the English providers doc and examples/bedrock-mantle.md:44.
Prompt for agents
The documentation in three files claims that OPENAI_BASE_URL and OPENAI_API_KEY env var overrides apply only to openai_legacy providers. But the actual implementation at src/kimi_cli/llm.py:87 applies them to both openai_legacy and openai_responses via a combined match case. Update the wording in all three locations:
1. docs/en/configuration/providers.md:71 — change 'for openai_legacy providers only' to 'for openai_legacy and openai_responses providers'
2. docs/zh/configuration/providers.md:71 — change the Chinese text similarly, updating the 不会影响其他供应商 claim to reflect that openai_responses is also affected
3. examples/bedrock-mantle.md:44 — change 'For any openai_legacy provider' to 'For any openai_legacy or openai_responses provider'
Alternatively, if the intent is to restrict the override scope to openai_legacy only (excluding openai_responses), then the code in src/kimi_cli/llm.py:87 should be changed to separate the two cases.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3010c6d0b7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| Platform( | ||
| id=BEDROCK_MANTLE_PLATFORM_ID, | ||
| name="AWS Bedrock Mantle (OpenAI-compatible)", |
There was a problem hiding this comment.
Keep Kimi Code as the default /login platform choice
Placing Bedrock first in PLATFORMS changes the default selection in /login, because the prompt uses choices[0] as the default option. Users who hit Enter immediately now get routed into the Bedrock region/API-key flow instead of the Kimi Code OAuth flow, which is a regression in the common onboarding path. Keep Kimi Code first (or set an explicit default) to preserve prior behavior.
Useful? React with 👍 / 👎.
Made-with: Cursor
Summary
This PR adds AWS Bedrock Mantle (OpenAI-compatible API) as a first-class platform in the interactive
/loginsetup flow.Changes
BedrockMantleplatform withopenai_legacyprovider type, dynamic region-based base URL construction, and OpenAI-compatible model listing/login, handle model fetching with custom base URLs, and disable Kimi-specific services (search/fetch) for this platformexamples/bedrock-mantle.mdwith setup guidetests/auth/test_bedrock_mantle_platform.pyfor URL construction and model parsingFeatures
https://bedrock-mantle.{region}.api.aws/v1Testing
/loginand select "AWS Bedrock Mantle (OpenAI-compatible)"Made with Cursor