Skip to content

Cannot disable thinking for Qwen3.5-plus via Anthropic API compatibility #2022

@lightgao

Description

@lightgao

What happened?

When integrating the latest Qwen3.5-plus model from Aliyun into Pi Coding Agent via the Anthropic API-compatible endpoint, the thinking function cannot be disabled.

Even when the user explicitly sets “reasoning: false” in the custom models configuration or uses thinking=off in the UI, the model continues to run in thinking mode. This is because the request sent to the Aliyun endpoint does not include 'thinking' field, causing the model to fall back to its default state (thinking enabled by default).

Steps to reproduce

  1. Configure the provider in Pi Coding Agent with the Aliyun endpoint:
{
  "providers": {
    "anthropic_aliyun": {
      "baseUrl": "https://dashscope.aliyuncs.com/apps/anthropic",
      "api": "anthropic-messages",
      "apiKey": "sk-sp-tester-001",
      "models": [
        {
          "id": "qwen3.5-plus",
          "reasoning": false,
          "input": ["text", "image"],
          "contextWindow": 960000,
          "maxTokens": 65000
        }
      ]
    }
  }
}
  1. Set thinking to off in the Pi coding agent interface.

  2. Say 'hi' with Qwen3.5-plus model.

  3. Observe the response: The model still outputs detailed reasoning steps, indicating thinking is active.

Expected behavior

When the user sets “reasoning=true && thinking=off”, the Pi Coding Agent should explicitly send the following field in the Anthropic messages request to override the provider's default:

"thinking": { "type": "disabled" }

Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginprogressIssue is being worked on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions