How does the sub-agent return the tool request for approval? #8025
Replies: 2 comments
|
Your reading is correct for the current .NET implementation: the approval request does not propagate through
This is also a reproduced open bug, #6062. A proposed passthrough/resume implementation in #6369 was closed without merging; the follow-up analysis explains that correct nested approval requires preserving the invocation frame, pending/completed calls, child session, and pause/resume state rather than merely returning a different object. So today:
In short, this is a known limitation/bug rather than behavior you are missing in the API. |
|
Worth naming what this costs operationally, because I hit the same shape and it was The incident: a worker sat waiting for an approval it never received. The process stayed So even where the approval can't be surfaced through the function boundary, two things
If |
Uh oh!
There was an error while loading. Please reload this page.
In the source code, a child agent can be exposed as a tool via
AsAIFunction. However, this seems to introduce a problem:If the child agent requests approval for a tool call, wouldn't that approval request be completely swallowed here, since
InvokeAgentAsynconly returnsresponse.Text?In other words, converting an agent into an
AIFunctionappears to collapse the child agent's entire execution into a plain string result, which means intermediate events such as tool-call approval requests cannot propagate back to the parent agent or ultimately to the user.Why was
AsAIFunctiondesigned this way? 🤔All reactions