Permission requests queue up instead of pushing each other away (upstream #563)

ApprovalQueue (upstream e391a14, after #157 by @Mydao57): up to 5 requests wait in line,
the card shows the oldest with «1/N» and the project of the asking session; a click
answers the request that was on screen and is ignored if the card moved on. Each request
keeps its own hang-up monitor and 115 s timeout and is settled by its own session's
events; a sibling session's events are no longer dropped while one waits. BroV keeps its
DangerCheck warning per request and the iPhone relay answers the request it was shown.
Upstream tests pass: bash scripts/test-approval-queue.sh.

Co-Authored-By: Mydao57 <150259698+Mydao57@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maksarsanjeev
2026-10-14 00:18:34 +03:00
parent c0447ca327
commit 0199e9a7f0
7 changed files with 338 additions and 133 deletions
@@ -41,6 +41,12 @@ struct ApprovalInfo: Sendable {
var pillId: String
/// Why this request looks destructive (DangerCheck), empty when nothing matched.
var danger: [String] = []
/// Queued request this card answers: a decision is only accepted for this id.
var id: UUID = UUID()
/// Requests waiting, this one included; the card shows the count when above 1.
var queueCount: Int = 1
/// Project of the session that asks (several sessions can share one pill).
var projectName: String = ""
}
// MARK: - Pill badge (shown on pill edge when non-focused task has an alert)