fix(runtime): preserve interrupted turns on gateway exit

This commit is contained in:
Xubin Ren
2026-08-24 00:58:04 +08:00
parent c7e2a474a0
commit 2cdfba38b2
8 changed files with 94 additions and 88 deletions
+2 -2
View File
@@ -164,8 +164,8 @@ async def test_dispatch_cancellation_restores_checkpoint():
@pytest.mark.asyncio
async def test_dispatch_cancellation_keeps_checkpoint_for_managed_restart(tmp_path: Path) -> None:
"""A restart preserves the checkpoint; an explicit stop still restores it."""
async def test_dispatch_cancellation_keeps_checkpoint_for_gateway_shutdown(tmp_path: Path) -> None:
"""Gateway shutdown preserves the checkpoint; an explicit stop restores it."""
loop = _make_loop(tmp_path)
loop.preserve_inflight_turns_on_shutdown()
loop._restore_runtime_checkpoint = MagicMock() # type: ignore[method-assign]