alibaba-token-plan: `reasoning_effort` never sent for Qwen 3.8 Flash; Qwen `reasoning_content` history not replayed
Environment
omp 18.1.10 (installed binary), provider alibaba-token-plan, model qwen3.8-flash, modelRoles.coder: alibaba-token-plan/qwen3.8-flash:minimal.
Defect 1: effort level dropped on the wire
Catalog rule providers/alibaba-token-plan.kdl:3 sets thinkingFormat: qwen for the whole provider. The chat-completions request builder then takes the qwen-enable-thinking-false branch, which sends enable_thinking: true and adds reasoning_effort only when qwenTemplateReasoningEffort is set (local backends only). Only qwen3.8-max has a whenThinking { thinkingFormat: openai, extraBody { enable_thinking: true } } rule (alibaba-token-plan.kdl:20), so effort reaches DashScope for max and for nothing else.
Captured with PI_REQ_DEBUG=1 omp -p --model alibaba-token-plan/qwen3.8-flash:minimal:
{"model":"qwen3.8-flash","enable_thinking":true,"stream":true,"max_completion_tokens":64000}DashScope docs: Qwen 3.8 thinking is on by default; reasoning_effort accepts low|medium|xhigh (default xhigh, budget 262144 tokens; low = 4096; minimal maps to low; none maps to enable_thinking=false). reasoning_effort and thinking_budget must not be combined.
https://www.alibabacloud.com/help/en/model-studio/qwen-api-via-openai-chat-completions
Direct A/B against DashScope, identical prompt:
| request | reasoning tokens |
|---|---|
enable_thinking: true only (current omp wire) |
9228 |
+ reasoning_effort: "low" |
274 |
+ reasoning_effort: "minimal" |
186 |
enable_thinking: false |
0 |
Workaround that fixes it (models.yml):
providers:
alibaba-token-plan:
modelOverrides:
qwen3.8-flash:
compat:
supportsReasoningEffort: true
whenThinking:
thinkingFormat: openai
extraBody:
enable_thinking: trueSuggested fix: apply the qwen3.8-max wire rule to the whole class qwen, revision >=3.8.0 <3.9.0 block (which already sets supportsReasoningEffort: true at alibaba-token-plan.kdl:11), or set qwenTemplateReasoningEffort-equivalent behaviour for the remote DashScope endpoint.
Defect 2: Qwen reasoning history is dropped
For remote Alibaba models the resolved compat has replayReasoningContent: false, so the history converter omits prior reasoning_content from assistant turns. DashScope: for qwen3.8-max/flash preserve_thinking defaults to true and "you must send back all historical reasoning_content in the reasoning_content field". The API accepts the omission silently, so the model re-derives earlier decisions each turn. replayReasoningContent / qwenPreserveThinking are not exposed in the models.yml compat schema, so there is no user-side workaround.
Reproduction
Offline: extract Bv/f5s from the bundle and call with the resolved qwen compat; PI_REQ_DEBUG=1 live capture as above.
Source: can1357/oh-my-pi