Squash Odysseus development history

This commit is contained in:
pewdiepie-archdaemon
2026-09-11 06:04:19 +00:00
parent c9dd68d890
commit 84aa9a91de
871 changed files with 265870 additions and 27854 deletions
+10
View File
@@ -132,10 +132,20 @@ async def _drain(session_id: str, run: _Run, agen: AsyncGenerator[str, None],
try:
if prev_task is not None and not prev_task.done():
await asyncio.wait({prev_task})
terminal_event: Optional[str] = None
async for ev in agen:
# A client treats [DONE] as permission to submit the next turn.
# Do not expose it until the wrapped generator has fully unwound;
# chat persistence and active-run cleanup can occur after the
# generator yields its terminal SSE event.
if str(ev).strip() == "data: [DONE]":
terminal_event = ev
continue
_publish(run, ev)
if run.status == "running":
run.status = "done"
if terminal_event is not None:
_publish(run, terminal_event)
except asyncio.CancelledError:
run.status = "stopped"
# Let the wrapped generator's own CancelledError handler run (it saves