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
@@ -147,10 +147,10 @@ final class ApprovalRelay {
switch decision {
case "allow":
log("allowed from the iPhone: \(pending.tool)")
HookServer.shared.sendApprovalDecision("allow")
HookServer.shared.sendApprovalDecision("allow", for: pending.id)
case "deny":
log("denied from the iPhone: \(pending.tool)")
HookServer.shared.sendApprovalDecision("deny")
HookServer.shared.sendApprovalDecision("deny", for: pending.id)
default:
log("unknown decision '\(decision)', ignored")
}