review fix: close one-turn lifecycle gaps

This commit is contained in:
pku-xht
2026-07-17 17:27:53 +08:00
parent 55f61189b1
commit 2cf689301c
4 changed files with 102 additions and 5 deletions

View File

@@ -117,6 +117,7 @@ export async function runLoop(ctx: Context, agent: ReactLoopAgent, handle: LoopH
}
handle.setStatus('running')
if (handle.isDisposed()) break
// A synchronous `running` listener can cancel before `runTurn`; balance the
// status only when no replacement prompt was queued by that listener.