How to handle sub agent exceptions? #192

Open
opened 2026-02-16 08:20:15 -05:00 by yindo · 3 comments
Owner

Originally created by @endlessc on GitHub (Nov 29, 2025).

Use deepagents to create an agent. During the execution of the task by the sub-agent, if there is an error when calling the tool due to incorrect parameters, causing the tool call to fail and an exception to be thrown, at this time, the sub-agent will terminate the task and then return to the main agent. This results in the sub-task not being completed. Currently, the error handling logic defined using the @wrap_tool_call annotation has not taken effect. How to handle this situation? How to let the sub-agent capture this task and return it to the LLM for further processing of the sub-task instead of terminating? thank you

Originally created by @endlessc on GitHub (Nov 29, 2025). Use deepagents to create an agent. During the execution of the task by the sub-agent, if there is an error when calling the tool due to incorrect parameters, causing the tool call to fail and an exception to be thrown, at this time, the sub-agent will terminate the task and then return to the main agent. This results in the sub-task not being completed. Currently, the error handling logic defined using the @wrap_tool_call annotation has not taken effect. How to handle this situation? How to let the sub-agent capture this task and return it to the LLM for further processing of the sub-task instead of terminating? thank you
yindo added the questiondeepagentsexternalsubagents labels 2026-02-16 08:20:15 -05:00
Author
Owner

@jordanallred commented on GitHub (Dec 11, 2025):

More importantly - why are subagents tools (the ones provided to all deepagents) not performing proper checking or handling errors? If the model attempts to read a file it does not have access to, it will propagate an error all the way up to the main agent.

@jordanallred commented on GitHub (Dec 11, 2025): More importantly - why are subagents tools (the ones provided to all deepagents) not performing proper checking or handling errors? If the model attempts to read a file it does not have access to, it will propagate an error all the way up to the main agent.
Author
Owner

@vtrivedy commented on GitHub (Dec 29, 2025):

hey do you have a trace for this using the latest deepagents version. we patched subagent errors in the latest release

@vtrivedy commented on GitHub (Dec 29, 2025): hey do you have a trace for this using the latest deepagents version. we patched subagent errors in the latest release
Author
Owner

@jordanallred commented on GitHub (Dec 29, 2025):

Will ensure version is current and attempt to reproduce. The offending tool was grep 80% of the time so should be be too difficult to route to it and verify the fix.

@jordanallred commented on GitHub (Dec 29, 2025): Will ensure version is current and attempt to reproduce. The offending tool was grep 80% of the time so should be be too difficult to route to it and verify the fix.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/deepagents#192