()
| 218 | invocation_id = None |
| 219 | |
| 220 | async def run_and_print(): |
| 221 | nonlocal invocation_id |
| 222 | async with Aclosing( |
| 223 | runner.run_async( |
| 224 | user_id=session.user_id, |
| 225 | session_id=session.id, |
| 226 | new_message=next_message, |
| 227 | invocation_id=resume_invocation_id, |
| 228 | ) |
| 229 | ) as agen: |
| 230 | async for event in agen: |
| 231 | collected_events.append(event) |
| 232 | if getattr(event, 'invocation_id', None): |
| 233 | invocation_id = event.invocation_id |
| 234 | _print_event(event, jsonl=jsonl, session_id=session.id) |
| 235 | |
| 236 | try: |
| 237 | if timeout: |
no test coverage detected