mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 18:00:11 +08:00
#584 fixed SiliconFlow by adding a PROVIDER_CAPABILITIES entry, but the same class of bug affected every registered openai_compat cloud provider lacking an explicit entry: get_capability fell to DEFAULT_CAPABILITIES (supports_tools= False), so can_use_native_tool_calling() returned False and models emitted textual <tool_calls> markup instead of executable tool calls. Affected: gemini, zhipu, qianfan, stepfun, xiaomi_mimo, nvidia_nim, aihubmix, and the volcengine/byteplus coding-plan variants. Make the decision registry-backend-driven instead of per-provider data: can_use_native_tool_calling now treats a registered, non-local openai_compat provider as tool-capable by default (matching the catch-all 'custom' provider and the OpenAI-compatible API contract). Anthropic backends stay always-on; local servers (Ollama/vLLM/LM Studio/llama.cpp/Lemonade/OVMS) and bindings in _NATIVE_TOOL_BLOCKED_BINDINGS stay opted out; an explicit supports_tools flag still wins. This removes the registry/capabilities duplication for the tools flag and prevents the gap from recurring when new cloud providers are added. capabilities.py stays a pure static-data module (no registry coupling); the policy lives in client.py, which already consults the registry. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>