Repository navigation
fix(core): map MiniMax Messages effort ladders to variants - #62265
isHeSatoshi wants to merge 1 commit into
Conversation
|
Thanks for tracking this down and for the thorough write-up, @isHeSatoshi! I think this duplicates #56510, which is still open and fixes the same thing:
The main difference is how the effort is sent: a typed |
|
Thanks for the pointer. The difference is real, so it is worth spelling out — I left the details in a review on #56510. Summary: Happy to consolidate either way:
The variant list is identical in both cases: |
Issue for this PR
Closes #62264
Related: #54801 (same root cause on the MiniMax Messages route), #61521 (closed as a duplicate of #54801).
Type of change
What does this PR do?
The MiniMax Messages route dropped every declared effort ladder, so
MiniMax-M3.1-Flashexposed no reasoning variants on theminimax(minimax.io API),minimax-coding-plan(Token Plan),minimax-cnandminimax-cn-coding-planproviders. Since MiniMax defaultsoutput_config.efforttomax, the model always reasoned at maximum depth.packages/core/src/variant.tsmaps a catalog effort ladder to no variants at all:Variant.supports()produces{ type: "effort", values: [...] }for these models, sosupport.values !== undefinedand the route returned[]. This PR adds the missing branch and spells the ladder the way the Messages protocol spells effort, so the Anthropic protocol emitsoutput_config.effortitself:settings: { effort }is the same spelling the other Anthropic-compatible route uses (moonshotMessages), so the effort travels as a typed provider option instead of an opaque body overlay. A request-levelproviderOptions.efforttherefore still wins over the variant, which a body overlay cannot do.noneis filtered out because MiniMax answers400 model "MiniMax-M3.1-Flash" requires adaptive thinkingfor it, and thinking cannot be turned off on this model.MiniMax-M3keeps itsnone/thinkingtoggle, and the M2.x guard is untouched.packages/ai/src/providers/minimax.tsnow advertisesefforton the Messages route, which is what the variants set.The catalog is not the problem here —
packages/core/src/models-dev/snapshot.txtand the live catalog already declareeffort: ["low", "medium", "high", "xhigh", "max"]for this model.Note on #56510
#56510 fixes the same branch with a
body: { output_config: { effort } }overlay. That produces the same request body, but as a transport-level overlay it overrides anything the protocol or a per-request option produces. This PR uses the protocol option instead and adds coverage for both providers the report names. If you prefer #56510's implementation, this PR can be closed in its favour — the variant mapping and the request body are equivalent.How did you verify your code works?
packages/core/test/variant.test.ts— the ladder resolves to the five effort variants, M3 keeps its toggle, M2.x stays variant-free.packages/core/test/model-resolver.test.ts— resolving a variant forminimaxandminimax-coding-planproduces a request body withoutput_config: { effort: "low" }and nothinkingtoggle.packages/ai/test/provider/minimax.test.ts— the Messages route turns theeffortprovider option intooutput_config.effort.ModelsDev.decodeSnapshot) now yields the five variants forMiniMax-M3.1-Flashon all four MiniMax providers.bun testinpackages/core(6971 pass, 2 pre-existing environment failures invcs.test.tsandpreload.test.ts, both failing on a clean tree too) and inpackages/ai(2049 pass, 0 fail).bun run checkfrom the repository root: 35/35 tasks successful.Visual
No visual change: the variant list already exists in the model selector, it now lists the MiniMax effort levels.
Screenshots / recordings
Not a UI change.
Checklist