Repository navigation
fix: keep --effort on the MiniMax API-key request - #461
Merged
Merged
Conversation
pi-ai sets output_config.effort from the selected thinking effort, but patchThinkingPayload replaced the openplatform thinking variant and then deleted output_config for every non-custom provider, so --effort never reached the MiniMax open platform on the API-key path. For minimax_api requests, keep the explicitly selected effort in output_config the same way patchManagedThinkingPayload does on the managed path. 'default', plain on/off models and other providers are unchanged.
hetaoBackend
marked this pull request as ready for review
October 9, 2026 06:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On the API-key path (
minimax_api, includingminimaxrouted throughminimaxModelSource: minimax_api_key), pi-ai buildsoutput_config: { effort }from the selected effort.patchThinkingPayloadthen replacesthinkingwith the openplatform variant and deletesoutput_configfor every provider except a custom provider's xhigh/max. So--effort high|low|…never reached the wire. Captured request bodies for M3.1-Flash with high and low effort both had onlythinking: {type: "adaptive"}.Fix
For
minimax_apirequests with an explicitly selected effort level, keepoutput_config.effort(and any otheroutput_configfields) set to the selected value. This mirrorspatchManagedThinkingPayloadon the managed path. The following are unchanged:default: no explicit effort, so nothing is sent and the provider decides;Tests
New
local-turn-payload-transform.test.ts. It resolves a realLocalModelResolvermodel, runs pi-aistreamSimplewith the real payload transform, and captures the request body fromfetch:minimax_apiputsoutput_config.efforton the wire, and so does theminimax+ API-key source route;defaultand M3 send nooutput_config.The new tests fail on
main(5/7) and pass with the fix.pnpm typecheck, the capability suite (215 files, 5393 passed) andcheck:sourcepass.Open question
This assumes the open platform's Anthropic-compatible endpoint accepts
output_config.effort(the managed gateway already receives it). Please confirm it acceptsxhighandmaxbefore merging.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.