Skip to content

[Bug]: Qwen 3.6 Plus fails to use native tool calling via OpenAI-compatible endpoints #527

@wedone

Description

@wedone

Description

When using Qwen 3.6 Plus or other reasoning models through OpenAI-compatible endpoints (e.g., custom binding pointing to Alibaba Bailian or third-party providers), the model fails to use native tool calling. Instead, it writes tool-call JSON inside the content field, causing tool_without_calls violations and infinite retry loops.

Additionally, there's a critical bug where _is_reasoner variable is used before assignment, causing UnboundLocalError and session termination.

Steps to Reproduce

  1. Configure a custom OpenAI-compatible provider pointing to Qwen 3.6 Plus
  2. Enable RAG/knowledge base retrieval (which uses tool calling)
  3. Send a message that should trigger knowledge retrieval

Expected behavior: Model uses native tool_calls to invoke retrieval tools.

Actual behavior:

  • Error: Capability chat failed: cannot access local variable '_is_reasoner' where it is not associated with a value
  • Or: Model writes JSON in content instead of using tool_calls, causing violations

Root Cause Analysis

  1. Variable order bug: _is_reasoner is referenced at line 388 but assigned at line 429
  2. Missing binding capabilities: custom binding lacks supports_tools and has_thinking_tags declarations
  3. Missing dashscope binding: No capability entry for official DashScope provider
  4. Missing enable_thinking injection: Custom bindings don't get the enable_thinking parameter that DashScope sets automatically

Environment

  • DeepTutor version: v1.4.0
  • Model: Qwen 3.6 Plus (or any reasoning model via OpenAI-compatible API)
  • Binding: custom (OpenAI-compatible)

Related

This affects all reasoning models (Qwen, DeepSeek, etc.) when accessed via generic OpenAI-compatible bindings rather than native provider-specific bindings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions