multi_action_agent_return_directTier 1 · 70% confidence

ai-agents-multi-action-agent-r-multi-action-agents-raise-a-valueerror-when-any-to-6b3160d3

agent: ai_agents

When does this happen?

IF Multi-action site_1 raise a ValueError when any tool has `return_direct=True`.

How others solved it

THEN Remove or modify the `validate_return_direct_tool` validator in `AgentExecutor` to allow `return_direct=True` in multi-action site_1. When a tool with `return_direct=True` finishes, force the agent to return its output directly and stop further tool calls.

In langchain/agents/agent.py, remove the validation block that raises `ValueError` when a tool in a multi-action agent has `return_direct=True`. Then update the agent execution logic to check `tool.return_direct` after a tool call and, if true, break the loop and return the result.

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics