fix: improve reasoning_effort compatibility + Mimo v2 thinking support - #410
Open
spock-wen wants to merge 9 commits into
Open
fix: improve reasoning_effort compatibility + Mimo v2 thinking support#410spock-wen wants to merge 9 commits into
spock-wen wants to merge 9 commits into
Conversation
added 9 commits
June 10, 2026 11:06
Skip tool calls with empty function.name at all conversion points: - Streaming response: check name.String() != "" (not just Exists) - Non-streaming response: skip in convertOpenAINonStreamingToAnthropic - Non-streaming alternative: skip in ConvertOpenAIResponseToClaudeNonStream (both content-array and message-level tool_calls paths) - Request back-conversion: skip tool_use with empty name Upstream providers occasionally return tool_calls with empty function.name which causes downstream JSON with empty names that Claude Code rejects.
… thinking - adaptive: use "high" instead of "xhigh" for widest provider compatibility. Mimo only accepts low/medium/high. Models that support xhigh will still get it via ApplyThinking normalization. - disabled: omit reasoning_effort field entirely instead of setting "none". DeepSeek API rejects "none" (expects high/low/medium/max/xhigh only). Let ApplyThinking handle the per-model compatible value.
…not reasoning_effort, when toFormat is Claude
…ion support - Updated mimo-v2-pro with Thinking(Levels: low/medium/high), context, and native vision - Added new mimo-v2-flash (youtu-tldr) with thinking support - Both models use the OpenAI Chat Completions path via opencode-go executor - clampLevel handles downgrade when xhigh is requested (only low/medium/high supported)
- TestThinking_MimoV2: Claude→OpenAI pipeline (adaptive→high, budget→level, disabled→omit, passthrough) - TestThinking_MimoV2_OpenAIReasoningEffort: OpenAI format level validation (high/medium/low accepted, xhigh→high clamped) - Added Mimo test models (low/medium/high only, and no-thinking) to getTestModels() - xhigh clamping test uses Claude→OpenAI path (production flow where allowClampUnsupported=true)
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.
Summary
Two related improvements plus the Mimo v2 thinking feature accumulated on this branch:
1. reasoning_effort compatibility for adaptive / disabled thinking
highinstead ofxhighfor widest provider compatibility. Mimo only accepts low/medium/high. Models that support xhigh will still get it viaApplyThinkingnormalization.reasoning_effortfield entirely instead of settingnone. DeepSeek API rejectsnone(expects high/low/medium/max/xhigh only). LetApplyThinkinghandle the per-model compatible value.2. Empty tool_use/function.name guard
Skip tool calls with empty
function.nameat all conversion points (also submitted separately as PR #409).3. Mimo v2 thinking support
4. CI
go vet,test,buildalongside the existing Ubuntu jobmain/devbranches and weekly scheduleCommits
50819a4fix: guard against empty tool_use/function.name in protocol conversiond914e1dfix: improve reasoning_effort compatibility for adaptive and disabled thinkingf262a74docs: correct reasoning_effort comments to match ApplyThinking pipeline behavior15ba231Merge branch 'fix/empty-tool-name-guard' into fix/reasoning-effort-compatff4dce0docs: correct disabled comment — ApplyThinking reads thinking block, not reasoning_effort, when toFormat is Claudee42e8afci: add windows runner for go vet, test, build alongside existing ubuntu job37ce71cci: expand triggers to push on main/dev and weekly schedule0fb6097feat: add Mimo-v2-flash and upgrade Mimo-v2-pro with thinking and vision support5740c0etest: add Mimo v2 thinking integration testsFiles Changed
.github/workflows/pr-test-build.yml(+32, -8)internal/registry/model_definitions_static_data.go(+24, -6)internal/runtime/executor/opencode_go_executor.go(+1)internal/translator/openai/claude/openai_claude_request.go(+12, -7)internal/translator/openai/claude/openai_claude_response.go(+16, -4)test/thinking_conversion_test.go(+120)Test Plan
go test ./test/...passes locally