fix: expand tool support to reduce 'Invalid tool name' errors#11792
Merged
fix: expand tool support to reduce 'Invalid tool name' errors#11792
Conversation
Models not recognized in PROVIDER_TOOL_SUPPORT fall back to a text-based tool calling format injected into the system message. When models don't follow this format exactly, the parser throws "Invalid tool name". This was affecting many models that actually support native tool calling but weren't listed. Changes: - Azure: add gpt-5, gpt-4.1, o1, o4 (was only gpt-4, o3) - Ollama: add glm-4/5, deepseek, dolphin families - DeepSeek provider: add deepseek-coder (was only chat/reasoner) - OpenRouter: add deepseek/deepseek-v3, deepseek/deepseek-coder Fixes #10678, #11594, #11431, #11218, #10900, #10272, #10156, #10143, #10050, #9891, #9839
Contributor
|
Docs Review: No documentation updates needed. This PR expands the internal model allowlist in The existing Model Capabilities documentation already:
Since this is a bug fix improving auto-detection accuracy rather than introducing new features or configuration options, no documentation changes are required. |
This was referenced Mar 25, 2026
Patrick-Erichsen
approved these changes
Mar 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gpt-5,gpt-4.1,o1,o4model prefixes (was onlygpt-4,o3)glm-4/glm-5,deepseek, anddolphinmodel familiesdeepseek-coder(was onlydeepseek-chat/deepseek-reasoner)deepseek/deepseek-v3anddeepseek/deepseek-coderprefixesRoot cause
When a model is not recognized in
PROVIDER_TOOL_SUPPORT(core/llm/toolSupport.ts), Continue falls back to a text-based tool calling format injected into the system message. The model is expected to output tool calls in a specific structured format (```tool/tool_name:/begin_arg:/end_argblocks). When models don't follow this format exactly, the parser atcore/tools/systemMessageTools/toolCodeblocks/parseSystemToolCall.ts:47throws"Invalid tool name".All 11 reported issues are models that do support native tool calling but were missing from the allowlist, causing them to fall through to the fragile text-based path.
Fixes
Fixes #10678, #11594, #11431, #11218, #10900, #10272, #10156, #10143, #10050, #9891, #9839
Test plan
core/llm/toolSupport.test.tstests passglm-4ordeepseekmodel — should use native tool calling instead of system message fallbackgpt-5-mini— should use native tool callingSummary by cubic
Expands tool support so native tool calling is used for more Azure, Ollama, DeepSeek, and OpenRouter models, eliminating "Invalid tool name" errors. Prevents fallback to the fragile system-message tool format for these families.
gpt-5,gpt-4.1,o1,o4prefixes.glm-4,glm-5,deepseek,dolphin.deepseek-coder*in the provider.deepseek/deepseek-v3anddeepseek/deepseek-coder*.Written for commit 7335493. Summary will update on new commits.