feat: Support resuming from a paused invocation starting from a sub-agent

PiperOrigin-RevId: 817766247
This commit is contained in:
Xinran (Sherry) Tang
2025-10-10 13:24:02 -07:00
committed by Copybara-Service
parent bddc70b5d0
commit 59670d240e
3 changed files with 162 additions and 8 deletions
+4 -2
View File
@@ -274,14 +274,16 @@ class InMemoryRunner:
)
async def run_async(
self, new_message: types.ContentUnion, invocation_id: Optional[str] = None
self,
new_message: Optional[types.ContentUnion] = None,
invocation_id: Optional[str] = None,
) -> list[Event]:
events = []
async for event in self.runner.run_async(
user_id=self.session.user_id,
session_id=self.session.id,
invocation_id=invocation_id,
new_message=get_user_content(new_message),
new_message=get_user_content(new_message) if new_message else None,
):
events.append(event)
return events