Skip to content

fix: Enhanced error handling for tool not found errors (v1.3)#1041

Open
gdeyoung wants to merge 2 commits intoagent0ai:mainfrom
gdeyoung:fix/enhanced-error-handling-v1.3
Open

fix: Enhanced error handling for tool not found errors (v1.3)#1041
gdeyoung wants to merge 2 commits intoagent0ai:mainfrom
gdeyoung:fix/enhanced-error-handling-v1.3

Conversation

@gdeyoung
Copy link

Summary

This PR adds enhanced error handling for when a tool is not found in agent.py.

Changes

  • Added code to build a list of available tools before generating the error message
  • Improved error message now shows available tools to help users debug tool-related issues

Testing

This is v1.3 of the patch series. Previous patches:

  • v1.0: JSON malformation fixes
  • v1.1: tool_args TypeError fix
  • v1.2: HandledException shadowing fix

Notes

This fix helps users understand which tools are available when they encounter a tool not found error, making debugging easier.

gdeyoung and others added 2 commits February 14, 2026 18:30
- Fixed rfind bug in extract_tools.py - proper nested brace tracking
- Fixed escape handling for escaped quotes in JSON strings
- Added HandledException class for graceful loop termination
- Added consecutive_misformat counter (5 attempt limit)
- Fixed tool_args TypeError - ensure dict before unpacking
Adds improved error message that lists available tools when a tool
cannot be found, helping users debug tool-related issues more easily.

This is v1.3 of the patch series.
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.

1 participant