Merge #782 fix(approvals): the list leaves a dialog too new to judge

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer committed 2026-11-08 04:04:59 +01:00
commit 49e1dda23b
3 files changed
+36 -3

No files matched your search

+15
View File
@@ -373,6 +373,21 @@ export class ApprovalInbox {
return true;
}
/**
* The list route's sweep: `verifyStillAnswerable`, but never before the delay
* `notePrompt` waits out. A frame that shows no dialog proves nothing about a
* dialog Ink has not painted yet, and the working line still on screen then
* would resolve a live prompt, clearing its red alert on every device. The
* list used to run once per page load, which made that rare; a client that
* polls it (the macOS app's logo) would hit it on every new dialog. Each
* call on an older dialog costs one synchronous pane capture.
*/
sweepForList(id: string): boolean {
const item = this.getById(id);
if (item && Date.now() - item.createdAt < STALE_CHECK_DELAY_MS) return true;
return this.verifyStillAnswerable(id);
}
/**
* "This session's pane started moving again": re-verify its pending DIALOG
* item against the screen and resolve it if the dialog is gone.
+3 -2
View File
@@ -84,8 +84,9 @@ export function registerApprovalRoutes(app: FastifyInstance, ctx: SessionPort):
// conservative rule the answer path uses (`verifyStillAnswerable`): only
// an item whose original frame parsed options can be resolved this way, so
// an unreadable capture keeps the alert rather than dropping it. Resolving
// here broadcasts `approval:resolved`, so the other devices clear too.
return approvalInbox.verifyStillAnswerable(item.id);
// here broadcasts `approval:resolved`, so the other devices clear too. A
// dialog too new to judge is left alone (`sweepForList`).
return approvalInbox.sweepForList(item.id);
});
return { success: true, data: { approvals } };
});