Skip to content

fix: expand tool support to reduce 'Invalid tool name' errors#11792

Merged
RomneyDa merged 1 commit intomainfrom
fix/expand-tool-support
Mar 25, 2026
Merged

fix: expand tool support to reduce 'Invalid tool name' errors#11792
RomneyDa merged 1 commit intomainfrom
fix/expand-tool-support

Conversation

@RomneyDa
Copy link
Collaborator

@RomneyDa RomneyDa commented Mar 25, 2026

Summary

  • Azure: Add gpt-5, gpt-4.1, o1, o4 model prefixes (was only gpt-4, o3)
  • Ollama: Add glm-4/glm-5, deepseek, and dolphin model families
  • DeepSeek provider: Add deepseek-coder (was only deepseek-chat/deepseek-reasoner)
  • OpenRouter: Add deepseek/deepseek-v3 and deepseek/deepseek-coder prefixes

Root 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_arg blocks). When models don't follow this format exactly, the parser at core/tools/systemMessageTools/toolCodeblocks/parseSystemToolCall.ts:47 throws "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

  • Verify existing core/llm/toolSupport.test.ts tests pass
  • Test with an Ollama glm-4 or deepseek model — should use native tool calling instead of system message fallback
  • Test with Azure gpt-5-mini — should use native tool calling

Summary 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.

  • Bug Fixes
    • Azure: recognize gpt-5, gpt-4.1, o1, o4 prefixes.
    • Ollama: recognize glm-4, glm-5, deepseek, dolphin.
    • DeepSeek: recognize deepseek-coder* in the provider.
    • OpenRouter: recognize deepseek/deepseek-v3 and deepseek/deepseek-coder*.

Written for commit 7335493. Summary will update on new commits.

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
@RomneyDa RomneyDa requested a review from a team as a code owner March 25, 2026 02:28
@RomneyDa RomneyDa requested review from sestinj and removed request for a team March 25, 2026 02:28
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 25, 2026
@continue
Copy link
Contributor

continue bot commented Mar 25, 2026

Docs Review: No documentation updates needed.

This PR expands the internal model allowlist in toolSupport.ts to fix 'Invalid tool name' errors for Azure, Ollama, DeepSeek, and OpenRouter models that support native tool calling.

The existing Model Capabilities documentation already:

  • Explains how auto-detection works and links to toolSupport.ts for implementation details
  • Provides guidance on manually configuring capabilities for unrecognized models
  • Covers the affected model families (DeepSeek, GLM, etc.) in the capability tables

Since this is a bug fix improving auto-detection accuracy rather than introducing new features or configuration options, no documentation changes are required.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 25, 2026
@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Mar 25, 2026
@RomneyDa RomneyDa merged commit afa6bab into main Mar 25, 2026
94 of 96 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs Mar 25, 2026
@RomneyDa RomneyDa deleted the fix/expand-tool-support branch March 25, 2026 03:23
@github-actions github-actions bot locked and limited conversation to collaborators Mar 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Error: glm-4.7-flash:latest - Unknown error

2 participants