review fix: cover post-cancel replacement

This commit is contained in:
pku-xht
2026-07-20 13:20:51 +08:00
parent da70e47048
commit 7d7d69e225
2 changed files with 26 additions and 1 deletions
+1 -1
View File
@@ -133,7 +133,7 @@ export async function runLoop(ctx: Context, handle: LoopHandle): Promise<void> {
if (handle.isDisposed()) break
// Cancellation between wake and `running` skips only the cancelled work;
// a replacement prompt still runs and owns the eventual idle transition.
// a replacement prompt still runs before the eventual idle transition.
if (handle.isCancelled()) {
handle.clearCancel()
if (!handle.inbox.hasQueued) {