Skip to content

Conversation

@ZxdNoob
Copy link

@ZxdNoob ZxdNoob commented Nov 26, 2025

  • Add proper error handling in buildSystemMessage() when ToolRegistry is not initialized
  • Return empty tools list instead of throwing error to prevent crashes
  • Add debug logging for tool registration in config.ts to help diagnose issues
  • Log when tools are disabled by configuration for better debugging

Fixes #1099

This fixes the issue where run_shell_command tool was not found in registry
when running in headless mode (e.g., 'echo test | qwen'). The fix ensures
that:

  1. ToolRegistry initialization is properly handled in headless mode
  2. Tools are properly registered even when configuration filters are applied
  3. Better error messages and debugging information are available

- Add proper error handling in buildSystemMessage() when ToolRegistry is not initialized
- Return empty tools list instead of throwing error to prevent crashes
- Add debug logging for tool registration in config.ts to help diagnose issues
- Log when tools are disabled by configuration for better debugging

Fixes QwenLM#1099

This fixes the issue where run_shell_command tool was not found in registry
when running in headless mode (e.g., 'echo test | qwen'). The fix ensures
that:
1. ToolRegistry initialization is properly handled in headless mode
2. Tools are properly registered even when configuration filters are applied
3. Better error messages and debugging information are available
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.

无头模式无法使用run_shell_command

1 participant