-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Question
Hey everyone,
I'm working with a multi-agent system and need some guidance on implementing human approval workflows for delegated tasks.
Scenario:
I have a coordinator agent that delegates tasks to specialized agents (e.g., a file management specialist). When the specialist needs to perform a sensitive operation like deleting a file, I want to require human approval before proceeding.
Current approach:
The specialist returns a DeferredToolRequest for the deletion
The coordinator handles this by raising an ApprovalRequired exception
After receiving human approval, I create DeferredToolResults and pass them back to the coordinator
The issue:
When I provide the DeferredToolResults to the coordinator, it seems to just call the specialized agent again, creating a loop rather than completing the approved action.
Question:
What's the correct pattern for handling human approval in delegated tool calls? How should I structure the flow so that once approval is granted, the original tool request gets executed properly?
Any insights or examples would be greatly appreciated!
TL;DR: How do I properly implement human approval for tools called by delegated agents without getting stuck in loops?
Additional Context
No response