Replies: 2 comments
-
|
@notowen333 this seems directly related to #1932; and something we should consider as part of the agent as tool feature |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
PR opened: #1965 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone!
I would like to propose an improvement to interrupt handling mechanism that enables Agent-as-tool to properly support interrupts raised inside sub-agent hooks.
Problem statement
Currently, when using a sub-agent as a tool (Agent-as-tool pattern), interrupts raised inside hooks (e.g.,
BeforeToolCallEvent) are not naturally propagated through the execution chain.A few days ago, I tried to use interrupts inside a hook triggered by a tool that belongs to a sub-agent. This sub-agent itself was registered as a tool in an orchestrator agent.
Although I managed to make it work, the solution required manually storing additional state, which makes the implementation more complex and less intuitive.
I reproduced this workaround here: https://github.com/thiagopo/strands-agents-interrupt-on-agent-as-tool
Proposed Improvement
I believe the framework could provide native support for cascaded interrupts, allowing interrupts raised at sub-agent levels (e.g., inside sub-agent hooks) to propagate correctly to upper levels (e.g., orchestrator).
Desired Flow
The ideal behavior would look like this:
Key Objectives
Proposed API Extensions
Below is an example of how this could be exposed for developers:
Proposed Additions (resume)
Current Status
I have implemented a working prototype of this approach in a fork of sdk-python, using the Teacher Assistant example as a baseline to test.
The results so far are promising and demonstrate that this approach can work without breaking existing behavior.
I’m preparing to open a PR with the implementation and would really appreciate feedback on this design before moving forward.
Beta Was this translation helpful? Give feedback.
All reactions