feat(providers): add the MiMo token-plan preset on the Chat wire (#1158) - #1211
Conversation
|
✅ Deterministic PR hygiene checks passed. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: acde7a4005
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Both environment variables are also writable by the process that launched us, | ||
| which makes the principal attacker-influenceable in a permissions path. |
There was a problem hiding this comment.
Remove the unfixed ACL security plan from tracked devlog
Because this commit does not fix the Windows ACL defect, this tracked plan publicly discloses an attacker-influenceable credential-permission path together with affected environments, bypass reasoning, and a detailed pre-disclosure patch strategy. Remove this file from the commit and keep it in .tmp/ or another scratch directory until the fix has shipped publicly.
AGENTS.md reference: AGENTS.md:L61-L68
Useful? React with 👍 / 👎.
| baseUrl: "https://token-plan-cn.xiaomimimo.com/v1", | ||
| adapter: "openai-chat", |
There was a problem hiding this comment.
Document the new MiMo token-plan preset
This new user-facing preset is absent from docs-site/src/content/docs/guides/providers.md, whose lines 273–280 still list only MiMo's Anthropic endpoint and explicitly describe Xiaomi MiMo as Anthropic-only; the translated provider guides repeat that claim. Users following the documentation therefore cannot discover this token-plan endpoint and may continue choosing the incompatible wire this change is intended to prevent. Add the token-plan URL and its openai-chat distinction to the English guide and keep the locale copies consistent.
AGENTS.md reference: AGENTS.md:L231-L232
Useful? React with 👍 / 👎.
acde7a4 to
aa27ba5
Compare
e916ec7 to
6db8e6a
Compare
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
aa27ba5 to
36936da
Compare
6db8e6a to
1b4d7c8
Compare
36936da to
86b31f2
Compare
1b4d7c8 to
6b7635b
Compare
Xiaomi MiMo's paid endpoint answers the Responses wire for plain turns, so a
user configuring it by hand picks `openai-responses` — MiMo documents Responses
support. But its gateway rejects `type: "custom"` tools with
`400 responses_feature_not_supported`, and `apply_patch` is a custom tool. The
result is a provider where chat works and every agentic turn fails.
Only `xiaomi` (Anthropic wire) and `mimo-free` (free tier, own adapter) existed,
so token-plan users had no preset to start from. This adds one pinned to
`openai-chat`, which is the wire the reporter confirmed works end to end. The
Chat path already lowers custom tools to `{input: string}` functions and
restores them as `custom_tool_call`, so the capability survives intact.
Stripping the custom tools instead would stop the 400 and disable the Codex
agent loop — a provider that no longer errors and no longer edits files.
Reasoning tiers above `high` are clamped: the gateway validates the ladder
strictly and rejects anything higher.
`preserveCustomDestination` is set because a user may already have a hand-rolled
provider under this id. Without it, routing canonicalizes their base URL onto
ours and sends their key to a host they never chose — the hazard the
`zhipu-bigmodel` comment documents.
That last property is the one worth testing rather than asserting: the preset
shape assertions do not exercise it at all, since the mechanism only engages
when endpoint, adapter, or auth differ. A routing-level regression covers it,
and both it and the adapter pin were confirmed to fail when reverted.
… plan Audit found resolveTrustedWindowsPowerShellExe() already resolves and validates the executable through GetSystemDirectoryW. Writing a third SystemRoot/PATH lookup would reintroduce the substitution surface the plan exists to close.
6b7635b to
aabee91
Compare
86b31f2 to
355640d
Compare
Summary
Closes #1158. Stacked on #1208.
Xiaomi MiMo's paid token-plan endpoint answers the Responses wire for plain turns, so a user configuring it by hand picks
openai-responses— MiMo documents Responses support. But its gateway rejectstype: "custom"tools with400 responses_feature_not_supported, andapply_patchis a custom tool. The result is a provider where chat works and every agentic turn fails.Only
xiaomi(Anthropic wire) andmimo-free(free tier, bespoke adapter) existed, so token-plan users had no preset to start from and naturally landed on the one wire that breaks.This adds a preset pinned to
openai-chat, the wire the reporter confirmed works end to end. The Chat path already lowers custom tools to{input: string}functions and restores them ascustom_tool_call, soapply_patchsurvives the round trip — nothing needed building, the provider just had to point at the wire that works.Two decisions worth reviewing
Not stripping the custom tools. That would stop the 400 and disable the Codex agent loop — a provider that no longer errors and no longer edits files.
apply_patchis the custom tool.preserveCustomDestination: true, and it is tested rather than asserted. Someone may already have a hand-rolled provider under this id; without the flag, routing canonicalizes their base URL onto ours and sends their key to a host they never chose. That is the hazard thezhipu-bigmodelcomment documents.The preset-shape assertions do not exercise that flag at all — it only engages when endpoint, adapter, or auth differ. So there is a separate routing-level regression: a pre-existing
mimoprovider pointing elsewhere with a different adapter, routed through, asserting its URL, key, and adapter are untouched and that it does not inherit the registry's effort clamp.Reasoning tiers above
highare clamped; the gateway validates the ladder strictly.Verification
The full
prepushgate ran and passed on push. No frontend files are touched.Both mechanisms ablation-confirmed:
openai-responsespreserveCustomDestinationremovedThe parity list needed
mimoinserted in registry-definition order, not alphabetically — worth knowing if you add an entry.Planning record:
devlog/_plan/260807_untouched_bug_stack/070_mimo_token_plan_preset.md. This plan failed its first independent audit for claiming collision preservation while never testing it; the routing regression is that correction.Checklist