Skip to content

Fall back to suffix match when model calls tool without toolbox prefix - #1552

Open
ikatyal2110 wants to merge 1 commit into
simonw:mainfrom
ikatyal2110:fix-toolbox-unqualified-name-fallback
Open

Fall back to suffix match when model calls tool without toolbox prefix#1552
ikatyal2110 wants to merge 1 commit into
simonw:mainfrom
ikatyal2110:fix-toolbox-unqualified-name-fallback

Conversation

@ikatyal2110

Copy link
Copy Markdown
Contributor

Some models (notably Qwen via Ollama) strip the toolbox class-name prefix when invoking a tool, calling "execute_javascript" instead of the registered "QuickJS_execute_javascript". This caused a "tool does not exist" error even though the tool was available.

When an exact name lookup fails, the fix tries to find a unique tool whose registered name ends with "_<called_name>". If exactly one such tool is found it is used; when multiple toolboxes share the same function name the call still fails with the original error so there is no ambiguity. The same fallback is applied in both the sync and async execution paths. Fixes #1105


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ollama Qwen 3B and Mistral Small 3.1 cannot handle Toolbox tools

2 participants