fix(typing): add main-run dispatch idle safety net (land #27250, thanks @Sid-Qin)

Co-authored-by: Sid Qin <s3734389@gmail.com>
This commit is contained in:
Peter Steinberger
2026-02-26 11:36:08 +00:00
parent 46003e85bf
commit 199ef9f8ea
2 changed files with 8 additions and 0 deletions

View File

@@ -748,5 +748,12 @@ export async function runReplyAgent(params: {
} finally {
blockReplyPipeline?.stop();
typing.markRunComplete();
// Safety net: the dispatcher's onIdle callback normally fires
// markDispatchIdle(), but if the dispatcher exits early, errors,
// or the reply path doesn't go through it cleanly, the second
// signal never fires and the typing keepalive loop runs forever.
// Calling this twice is harmless — cleanup() is guarded by the
// `active` flag. Same pattern as the followup runner fix (#26881).
typing.markDispatchIdle();
}
}