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
- Configure a custom OpenAI-compatible provider pointing to Qwen 3.6 Plus
- Enable RAG/knowledge base retrieval (which uses tool calling)
- 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
- Variable order bug:
_is_reasoner is referenced at line 388 but assigned at line 429
- Missing binding capabilities:
custom binding lacks supports_tools and has_thinking_tags declarations
- Missing
dashscope binding: No capability entry for official DashScope provider
- 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.
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_callsviolations and infinite retry loops.Additionally, there's a critical bug where
_is_reasonervariable is used before assignment, causingUnboundLocalErrorand session termination.Steps to Reproduce
Expected behavior: Model uses native
tool_callsto invoke retrieval tools.Actual behavior:
Capability chat failed: cannot access local variable '_is_reasoner' where it is not associated with a valueRoot Cause Analysis
_is_reasoneris referenced at line 388 but assigned at line 429custombinding lackssupports_toolsandhas_thinking_tagsdeclarationsdashscopebinding: No capability entry for official DashScope providerenable_thinkinginjection: Custom bindings don't get theenable_thinkingparameter that DashScope sets automaticallyEnvironment
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.