Skip to content

fix(tools): add bash/sh aliases for shell tool and migrate legacy tool names#2029

Closed
echoVic wants to merge 5 commits intoQwenLM:mainfrom
echoVic:fix/bash-tool-alias
Closed

fix(tools): add bash/sh aliases for shell tool and migrate legacy tool names#2029
echoVic wants to merge 5 commits intoQwenLM:mainfrom
echoVic:fix/bash-tool-alias

Conversation

@echoVic
Copy link
Copy Markdown
Contributor

@echoVic echoVic commented Mar 1, 2026

Problem

Models often use common shell command aliases like bash or sh instead of the registered tool name run_shell_command, causing "Tool not found in registry" errors.

Example error from #2012:

Tool "bash" not found in registry. Tools must use the exact names that are registered. Did you mean one of: "task", "glob", "edit"?

Changes

  • Add bash and sh to ToolNamesMigration as aliases for run_shell_command
  • Migrate legacy tool names in CoreToolScheduler._schedule() before registry lookup
  • This allows models to use common shell aliases while maintaining backward compatibility
  • Add test case for tool name migration

Testing

  • Added test case verifying that bash tool calls are correctly mapped to run_shell_command
  • All 37 tests pass

Fixes #2012

echoVic added 4 commits March 1, 2026 11:19
QwenLM#2025)

- Trim skill name in validateToolParams to handle cases where model adds extra whitespace
- Update params.skill with trimmed value for consistent usage throughout the tool
- Add test cases for leading/trailing whitespace and Chinese skill names

Fixes QwenLM#2025
… API errors (QwenLM#2020)

- Add PDF (application/pdf) to unsupported media types in convertUnsupportedMediaToText
- This prevents 'Invalid value: file' API errors when reading PDF files
- PDF content in tool responses is now converted to explanatory text
- Add test cases for PDF inlineData and fileData conversion

Fixes QwenLM#2020
…l names (QwenLM#2012)

- Add 'bash' and 'sh' to ToolNamesMigration as aliases for run_shell_command
- Migrate legacy tool names in CoreToolScheduler before registry lookup
- This fixes 'Tool "bash" not found in registry' errors when models use common aliases
- Add test case for tool name migration

Fixes QwenLM#2012
@tanzhenxin
Copy link
Copy Markdown
Collaborator

I think proficient tool usage capability is essential for model to prevail in all sorts of tasks, and we believe most up to date models have some capability. We have no plan for such workaround if some model is having trouble with tool use.

@tanzhenxin tanzhenxin closed this Mar 4, 2026
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.

Lot's of failed bash tool calls

2 participants