alibaba-cn reasoning models (kimi-k2.5, qwen-plus, qwen3, etc.) do not output thinking content #8872

Closed
opened 2026-02-16 18:11:04 -05:00 by yindo · 1 comment
Owner

Originally created by @AdJIa on GitHub (Feb 8, 2026).

Originally assigned to: @thdxr on GitHub.

Bug Description

When using reasoning models on the alibaba-cn provider (DashScope), no reasoning/thinking content is produced despite models having capabilities.reasoning: true.

This affects all reasoning-capable models on alibaba-cn, not just kimi-k2.5:

  • alibaba-cn/kimi-k2.5
  • alibaba-cn/qwen-plus, alibaba-cn/qwen-turbo, alibaba-cn/qwen-flash
  • alibaba-cn/qwen3-* (8b, 14b, 32b, 235b)
  • alibaba-cn/qwq-plus, alibaba-cn/qwq-32b
  • alibaba-cn/deepseek-r1*
  • alibaba-cn/qvq-max
  • etc.

The only exception is alibaba-cn/kimi-k2-thinking, which returns reasoning_content by default.

Root Cause

DashScope's OpenAI-compatible API requires enable_thinking: true in the request body to activate reasoning output. Without this parameter, reasoning_content is either absent or an empty string.

In packages/opencode/src/provider/transform.ts, the options() function handles thinking in two places, but neither covers the alibaba-cn (DashScope) case:

  1. Line 607-611: Sets chat_template_args.enable_thinking only for providerID === "opencode" with kimi-k2-thinking
  2. Line 634-643: Sets thinking.type: "enabled" only for @ai-sdk/anthropic SDK

The alibaba-cn provider uses @ai-sdk/openai-compatible — neither condition matches.

Reproduction

# No reasoning output (reasoning tokens = 0)
opencode run -m alibaba-cn/kimi-k2.5 --format json --thinking "test"
opencode run -m alibaba-cn/qwen-plus --format json --thinking "test"

# Direct API calls confirm enable_thinking is required:
# Without: no reasoning_content
curl $DASHSCOPE_API -d '{"model":"qwen-plus","messages":[...]}'
# With: reasoning_content present
curl $DASHSCOPE_API -d '{"model":"qwen-plus","messages":[...],"enable_thinking":true}'

Workaround

Add to opencode.json (per model):

{
  "provider": {
    "alibaba-cn": {
      "models": {
        "kimi-k2.5": { "options": { "enable_thinking": true } },
        "qwen-plus": { "options": { "enable_thinking": true } }
      }
    }
  }
}

Environment

  • OpenCode version: v1.1.53
  • Provider: alibaba-cn (DashScope)
  • API: https://dashscope.aliyuncs.com/compatible-mode/v1
  • SDK: @ai-sdk/openai-compatible
Originally created by @AdJIa on GitHub (Feb 8, 2026). Originally assigned to: @thdxr on GitHub. ## Bug Description When using reasoning models on the `alibaba-cn` provider (DashScope), no reasoning/thinking content is produced despite models having `capabilities.reasoning: true`. This affects **all** reasoning-capable models on `alibaba-cn`, not just kimi-k2.5: - `alibaba-cn/kimi-k2.5` - `alibaba-cn/qwen-plus`, `alibaba-cn/qwen-turbo`, `alibaba-cn/qwen-flash` - `alibaba-cn/qwen3-*` (8b, 14b, 32b, 235b) - `alibaba-cn/qwq-plus`, `alibaba-cn/qwq-32b` - `alibaba-cn/deepseek-r1*` - `alibaba-cn/qvq-max` - etc. The only exception is `alibaba-cn/kimi-k2-thinking`, which returns `reasoning_content` by default. ## Root Cause DashScope's OpenAI-compatible API requires `enable_thinking: true` in the request body to activate reasoning output. Without this parameter, `reasoning_content` is either absent or an empty string. In `packages/opencode/src/provider/transform.ts`, the `options()` function handles thinking in two places, but neither covers the `alibaba-cn` (DashScope) case: 1. **Line 607-611**: Sets `chat_template_args.enable_thinking` only for `providerID === "opencode"` with `kimi-k2-thinking` 2. **Line 634-643**: Sets `thinking.type: "enabled"` only for `@ai-sdk/anthropic` SDK The `alibaba-cn` provider uses `@ai-sdk/openai-compatible` — neither condition matches. ## Reproduction ```bash # No reasoning output (reasoning tokens = 0) opencode run -m alibaba-cn/kimi-k2.5 --format json --thinking "test" opencode run -m alibaba-cn/qwen-plus --format json --thinking "test" # Direct API calls confirm enable_thinking is required: # Without: no reasoning_content curl $DASHSCOPE_API -d '{"model":"qwen-plus","messages":[...]}' # With: reasoning_content present curl $DASHSCOPE_API -d '{"model":"qwen-plus","messages":[...],"enable_thinking":true}' ``` ## Workaround Add to `opencode.json` (per model): ```json { "provider": { "alibaba-cn": { "models": { "kimi-k2.5": { "options": { "enable_thinking": true } }, "qwen-plus": { "options": { "enable_thinking": true } } } } } } ``` ## Environment - OpenCode version: v1.1.53 - Provider: `alibaba-cn` (DashScope) - API: `https://dashscope.aliyuncs.com/compatible-mode/v1` - SDK: `@ai-sdk/openai-compatible`
yindo closed this issue 2026-02-16 18:11:04 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 8, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #12090: Kimi K2.5 can't enable thinking (reasoning_content missing) - also reported as OpenAI-compatible provider issue
  • #12088: No variants (high, low etc..) for the Kimi K2.5 model - related issue with variants not showing
  • #12183: FIX KIMI K2.5 from "Kimi For Coding" provider NOT having reasoning enabled - same symptom across different providers

All these issues relate to Kimi K2.5 reasoning/thinking not working properly. Your detailed analysis about the DashScope API requiring enable_thinking: true parameter is valuable and may help resolve these related issues as well.

Feel free to ignore if these don't address your specific case.

@github-actions[bot] commented on GitHub (Feb 8, 2026): This issue might be a duplicate of existing issues. Please check: - #12090: Kimi K2.5 can't enable thinking (reasoning_content missing) - also reported as OpenAI-compatible provider issue - #12088: No variants (high, low etc..) for the Kimi K2.5 model - related issue with variants not showing - #12183: FIX KIMI K2.5 from "Kimi For Coding" provider NOT having reasoning enabled - same symptom across different providers All these issues relate to Kimi K2.5 reasoning/thinking not working properly. Your detailed analysis about the DashScope API requiring `enable_thinking: true` parameter is valuable and may help resolve these related issues as well. Feel free to ignore if these don't address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8872