fix(providers): stop silently dropping reasoning effort on opencode families (#10788) - #11409
Conversation
…amilies (diegosouzapw#10788) Dispatch: OpencodeExecutor.transformRequest stripped the effort-suffixed alias (e.g. glm-5.2-high) down to the base id and injected a flat reasoning_effort body field — but opencode-go's ChatCompletionRequest has no such field for non-DeepSeek families, so the tier never reached the upstream and every request ran at default effort. Only DeepSeek V4 accepts the flat field (its native contract, diegosouzapw#4647), so it keeps the old rewrite; every other family now forwards the aliased model id verbatim, which is their only native effort mechanism. Registry: declare supportedThinkingEfforts on the base rows that had aliases but no tier vocabulary — opencode-go (glm-5.2, mimo-v2.5, grok-4.5, hy3, kimi-k3, qwen3.7-max/plus), the shared zen/go row (qwen3.6-plus) and opencode-zen (deepseek-v4-pro/flash, glm-5.2, kimi-k3) — so catalog variant synthesis (diegosouzapw#9485) and sanitizeReasoningEffortForProvider clamp from one source of truth. nvidia z-ai/glm-5.2 is declared reasoning-capable with an EMPTY tier list: its upstream only exposes a binary enable_thinking switch (mapNvidiaGlm52ReasoningParams), so no honest tiers exist to advertise. Ollama Cloud declarations were already landed upstream (diegosouzapw#11307); this change covers the remaining providers named in diegosouzapw#10788.
CI triage
No code changes required; will act on any maintainer findings. |
|
Thanks — the DeepSeek-vs-rest split and the registry-parity test are exactly right, and we reproduced the silent-drop bug on the current tip. One blocker before merge: your new supportedThinkingEfforts declarations activate the nearest-tier clamp from #11295/#11305, so a Codex request asking effort=low on opencode-go/glm-5.2 is now rewritten to high — 'Codex Responses routing keeps reasoning effort while dropping GPT-only verbosity' fails on this branch but passes on the base tip (reproduced locally; it is also why Unit Tests 4/4 is red). Please either update that guard expectation deliberately (with a note on what the upstream actually accepts) or scope the declarations so lower requested efforts survive. The ESLint/quality-gate reds are inherited base-red and not your problem. |
…arest-tier clamp
glm-5.2 on opencode-go now declares its live tier vocabulary {high, max},
so the declared-capability clamp maps out-of-vocabulary reasoning_effort
low to the nearest tier high. The verbosity-strip assertion is unchanged.
|
Nearest-tier clamp fix pushed ( Heads-up on the current red batch (Docs Gates, all 4 unit shards, Vitest): these reproduce at pure upstream tip |
8a8d0cf
into
diegosouzapw:release/v3.8.51
Summary
Addresses the code facets of #10788 (part 1). Ollama Cloud tier declarations already landed upstream in #11307; this covers what is still missing on
release/v3.8.51for opencode / opencode-go / opencode-zen and documents nvidia.Dispatch — the silent drop
OpencodeExecutor.transformRequeststripped the effort-suffixed alias (e.g.glm-5.2-high) down to the base id and injected a flatreasoning_effortbody field. But opencode-go'sChatCompletionRequesthas no such field for non-DeepSeek families (itsreasoningis a structured object), so the tier never reached the upstream — every request ran at default effort with no error.Fix:
reasoning_effortinjection — that IS its native contract via opencode-go (feat(opencode): add go deepseek reasoning variants #4647, sanitizer whitelist)opencode models opencode-go --verboselists), so the tier finally reaches the upstreamRegistry — tiers invisible in the catalog
Declared
supportedThinkingEffortson base rows that had aliases but no tier vocabulary:[high,max], mimo-v2.5[high,max], grok-4.5[low,medium,high], hy3[none,low,high], kimi-k3[max], qwen3.7-max/plus[high,max][high,max][none,low,high,max], glm-5.2[high,max], kimi-k3[max]This lets catalog variant synthesis (#9485) and
sanitizeReasoningEffortForProviderclamping work from one source of truth matching the executor'sEFFORT_TIERS.nvidia — honest empty declaration
nvidia/z-ai/glm-5.2is now marked reasoning-capable with an empty tier list: its upstream only exposes a binarychat_template_kwargs.enable_thinkingswitch (mapNvidiaGlm52ReasoningParams), so there are no honest-low/-high/-maxtiers to advertise. Synthesizing fake variants would trade one bug for another; the empty list suppresses them while keeping the reasoning flag accurate.Tests changed/added
opencode-go-effort-aliases-8353.test.ts: transform samples updated — non-DeepSeek aliases must reach the wire untouched with NO injected flat field; new registry-parity test asserting every base row's vocabulary equalsEFFORT_TIERS; nvidia binary-switch declaration testopencode-go-effort-aliases-6922.test.ts: glm/mimo transform expectations updated to alias-forwardingVerification
Base:
release/v3.8.51(3192eb88d). Release-engineering facet of #10788 (npm publish flow) is out of scope here.