feat(config): add Zhipu and MiniMax China Anthropic presets - #455
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for two new Anthropic-compatible providers: Zhipu (GLM China) and MiniMax China (minimax-cn). The changes introduce new presets, blueprints, CLI configurations, and extensive multi-language documentation across English, Japanese, Korean, and Chinese. The review feedback suggests reordering the navigation items in the i18n configuration to place 'MiniMax China' immediately after 'MiniMax' for improved readability and logical grouping.
| { | ||
| label: "Zhipu (GLM China)", | ||
| translations: { ko: "Zhipu (GLM 중국)", ja: "Zhipu(GLM 中国版)", "zh-cn": "智谱(GLM 国内版)" }, | ||
| slug: "providers/zhipu", | ||
| }, | ||
| { | ||
| label: "MiniMax China", | ||
| translations: { ko: "MiniMax 중국", ja: "MiniMax 中国版", "zh-cn": "MiniMax 国内版" }, | ||
| slug: "providers/minimax-cn", | ||
| }, |
There was a problem hiding this comment.
For better readability and to group related providers, it would be clearer to place MiniMax China immediately after MiniMax in the navigation list.
| { | |
| label: "Zhipu (GLM China)", | |
| translations: { ko: "Zhipu (GLM 중국)", ja: "Zhipu(GLM 中国版)", "zh-cn": "智谱(GLM 国内版)" }, | |
| slug: "providers/zhipu", | |
| }, | |
| { | |
| label: "MiniMax China", | |
| translations: { ko: "MiniMax 중국", ja: "MiniMax 中国版", "zh-cn": "MiniMax 国内版" }, | |
| slug: "providers/minimax-cn", | |
| }, | |
| { | |
| label: "MiniMax China", | |
| translations: { ko: "MiniMax 중국", ja: "MiniMax 中国版", "zh-cn": "MiniMax 国内版" }, | |
| slug: "providers/minimax-cn", | |
| }, | |
| { | |
| label: "Zhipu (GLM China)", | |
| translations: { ko: "Zhipu (GLM 중국)", ja: "Zhipu(GLM 中国版)", "zh-cn": "智谱(GLM 国内版)" }, | |
| slug: "providers/zhipu", | |
| }, |
There was a problem hiding this comment.
All reported issues were addressed across 30 files
Architecture diagram
sequenceDiagram
participant CC as Claude Code Client
participant G as shunt Gateway
participant P as Preset Registry
participant B as Blueprint Store
participant Z as Zhipu API
participant M as MiniMax China API
Note over CC,M: Provider Configuration Flow
CC->>G: shunt init --upstream zhipu
G->>P: Lookup zhipu preset
P-->>G: kind=anthropic, base_url=open.bigmodel.cn, auth=ApiKey, env=ZHIPUAI_API_KEY
G->>B: Fetch zhipu blueprint
B-->>G: Configuration guidance
G-->>CC: Generate shunt.toml with zhipu upstream
CC->>G: shunt init --upstream minimax-cn
G->>P: Lookup minimax-cn preset
P-->>G: kind=anthropic, base_url=api.minimax.cn, auth=ApiKey, env=MINIMAX_API_KEY
G->>B: Fetch minimax-cn blueprint
B-->>G: Configuration guidance
G-->>CC: Generate shunt.toml with minimax-cn upstream
Note over CC,M: Runtime Request Flow
CC->>G: POST /v1/messages (model=glm-5.3-flash)
G->>G: Strip [1m] suffix from model
G->>G: Match route to zhipu provider
alt Route to zhipu
G->>Z: Forward Anthropic request with ZHIPUAI_API_KEY
Z-->>G: Anthropic response
G-->>CC: Response with x-gateway-upstream: zhipu
else Route to minimax-cn
G->>M: Forward Anthropic request with MINIMAX_API_KEY
M-->>G: Anthropic response
G-->>CC: Response with x-gateway-upstream: minimax-cn
else No route match
G->>G: Use default anthropic passthrough
G-->>CC: Response via default provider
end
Note over G,Z: Missing API Key
alt ZHIPUAI_API_KEY not set
Z-->>G: 401 Authentication Error
G-->>CC: Authentication error response
end
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Greptile SummaryThe PR adds built-in Anthropic-compatible presets and blueprints for Zhipu and MiniMax’s China endpoints.
Confidence Score: 5/5The PR appears safe to merge, with the new presets, blueprints, and localized documentation remaining consistent with existing configuration and routing behavior. The preset fields flow through established normalization and credential-resolution paths, blueprint instructions produce valid configurations when followed, and all added localized navigation targets exist.
|
| Filename | Overview |
|---|---|
| src/config/presets.rs | Adds aligned Zhipu and MiniMax China preset definitions and focused table assertions without changing protocol behavior. |
| src/blueprints.rs | Registers the two embedded upstream guides, aliases, and availability-test expectations consistently. |
| blueprints/upstream/zhipu.md | Provides a valid preset-based Zhipu setup with credential, fallback, model-routing, and validation guidance. |
| blueprints/upstream/minimax-cn.md | Provides a valid preset-based MiniMax China setup with credential, fallback, model-routing, and validation guidance. |
| site/src/lib/i18n.ts | Adds localized navigation entries whose slugs match the new provider pages in every maintained locale. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Operator selects zhipu or minimax-cn] --> B[Preset normalization]
B --> C[Anthropic provider kind]
B --> D[China endpoint]
B --> E[API key environment variable]
C --> F[Model route]
D --> G[Upstream request]
E --> G
F --> G
Reviews (1): Last reviewed commit: "feat(config): add Zhipu and MiniMax Chin..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0a3e6d2761
ℹ️ 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".
| Claude Code では `ANTHROPIC_MODEL`、`ANTHROPIC_CUSTOM_MODEL_OPTION`、またはサブエージェントの | ||
| `model:` frontmatter でルーティングされた ID を選択します。 |
There was a problem hiding this comment.
Translate the missing model-picker guidance
For Japanese, Korean, and Chinese readers, both new provider pages stop after explaining direct model selection, while the English pages also explain how to expose an alias in the /model picker through [models.upstream_model]; the MiniMax page additionally warns that a mapped ID ending in [1m] is invalid. Add equivalent localized guidance and links to all six locale pages so they remain current with the English sources, as required by the repository documentation policy.
AGENTS.md reference: AGENTS.md:L57-L66
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5a5d11035
ℹ️ 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".
| api_key_env: None, | ||
| }, | ||
| ProviderPreset { | ||
| name: "zhipu", |
There was a problem hiding this comment.
Update the preset implementation contracts
Adding this preset and minimax-cn makes both names valid for [[upstreams]] and shunt init --upstream, but docs/init-command.md:9 still says the accepted set ends at kimi-code, while the implementation-contract table in docs/upstreams-failover.md:36-45 omits both presets. Update both engineering documents with the new names and metadata so they do not contradict the implemented CLI and configuration schema.
AGENTS.md reference: src/AGENTS.md:L34-L38
Useful? React with 👍 / 👎.
|
The automated review feedback has been addressed in |
Summary
ko/ja/zh-cntranslations.Details
zhipuhttps://open.bigmodel.cn/api/anthropicZHIPUAI_API_KEYminimax-cnhttps://api.minimax.cn/anthropicMINIMAX_API_KEYThe presets use the existing Anthropic provider kind, so no protocol behavior changes are required. Ordered upstream configurations still explicitly preserve the Anthropic passthrough/default.
Testing
cargo fmt --all --checkcargo clippy --all-targets --all-features -- -D warningscargo test --all-features --workspaceI also validated the China endpoints end to end with real provider traffic from two newly connected clients.
Summary by cubic
Adds built-in
zhipuandminimax-cnprovider presets so users can route to Zhipu's China BigModel and MiniMax's China Anthropic-compatible endpoints. Both reuse the existing Anthropic provider kind, so no protocol behavior changes.zhiputargetshttps://open.bigmodel.cn/api/anthropicand readsZHIPUAI_API_KEY.minimax-cntargetshttps://api.minimax.cn/anthropicand readsMINIMAX_API_KEY.shunt init --upstreamnames and ships matching upstream blueprints.en,ko,ja, andzh-cndocs.Written for commit b5a5d11. Summary will update on new commits.