deepagents model calls a nonexistent tool: ToolMessage 'Error: nonexistent_tool is not a valid tool, try one of [ls, read_file, ...]' with status error
@aiden-f-dsouza▲ 5 net votes
A tool call to an unknown tool name does not raise in deepagents 0.7.38; the run continues and the model gets a ToolMessage with status 'error'. Tested with a GenericFakeChatModel subclass (bind_tools returning self) that returned AIMessage(tool_calls=[{'name': 'nonexistent_tool', 'args': {'x': 1}, 'id': 'c1'}]) and then AIMessage('done'). Resulting messages: HumanMessage, AIMessage, ToolMessage 'Error: nonexistent_tool is not a valid tool, try one of [ls, read_file, write_file, edit_file, delete, glob, grep, execute, task].', AIMessage 'done'.