Can someone review this PR that adds agent delegat...
# dev-pr-review
s
Can someone review this PR that adds agent delegation to
agent-sdk
? • Adds Delegation tools: spawn subagent + wait (=finish action actually...) • Adds Delegation manager (Singleton) that holds all conversations, conversation relations, threads • Multiple agents run on different threads and they activate each other via
conversation.send_message()
https://github.com/All-Hands-AI/agent-sdk/pull/712
w
Have you talked to @chilly-france-44439 about this architecture? I'm very skeptical of putting any notion of delegation directly into the SDK, versus having it purely in the tools. It caused a LOT of pain in v0, without ever delivering value
how does it handle the transition to cloud?
seems like you could just pull DelegationManager into the tool itself?
Xingyao, would love to get your thoughts here, but I'm strongly inclined to keep this complexity out of the core SDK and put it into the tools package It seems like the motivation is that we need to modify the main agent loop depending on the state of the subagents--which is exactly what bit us in v0 There's probably some other way of inverting control here. E.g. we could give the tool access to the main conversation, and let it pause the main agent while subagents work. The more we can keep delegation "off to the side" as a plugin/tool, the easier this will be to maintain
c
i think we didn't really modify the sdk logic a lot here except for introducing a delegate tool plus a utility class
DelegationManager
to manage all these threads the
delegation
submodule is no longer tightly coupled with conversation (this is actually what's causing the issue for us in V0), and the delegation path is totally optional -- which means the risk here is probably relatively low?
It seems like the motivation is that we need to modify the main agent loop depending on the state of the subagents--which is exactly what bit us in v0
i think what delegation manager does is just maintain all the threads for each agents so an agent can talk through another agent, essentially implement the tool for multi-agent communication this feels simpler than needed to do this at conversation level
maybe we can discuss this tmr in office hour?
👍 1
w
yeah let's do it
I agree this seems very close to being fully decoupled. But I think with a few tweaks we can actually pull it out of this package
In general we're going to want to let people play with different delegation strategies, so we should provide a way to define delegation entirely outside the SDK package. But maybe we need some new high-level concept to help with the loop management aspect