Repository navigation
fix(approvals): acknowledge verdicts before delivery notices finish - #166396
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 6, 2026, 10:30 PM ET / October 7, 2026, 02:30 UTC. ClawSweeper reviewWhat this changesExec and plugin approval requests acknowledge the committed verdict before channel and push notifications finish, with dispatcher regressions and protocol documentation. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: pinned main and the latest release still delay legacy approval replies behind notification delivery. No actionable introduced defect was found. Likely related people: steipete and stevenlee-oai are routing candidates based on prior merged approval work. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway approval subsystem receives operator decisions from the Control UI and other clients, records them, and releases waiting actions. It also publishes verdict events and sends notification updates through channel and push adapters. flowchart TD
A[Operator decision] --> B[Approval authority checks]
B --> C[Durable verdict]
C --> D[Waiting action settles]
C --> E[Verdict publication]
E --> F[RPC acknowledgement]
F --> G[Channel and push notices]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource 0, Tests +61, Docs +3. Total +64 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep acknowledgement tied to the durable, published verdict while retaining notification completion and failure logging under the existing handler lifecycle. Do we have a high-confidence way to reproduce the issue? Yes, from source: hold a resolution notification pending beyond the 30-second RPC deadline after committing an exec or plugin verdict. The new dispatcher tests encode that path; this reviewer did not execute it. Is this the best way to solve the issue? Yes. Moving the existing response preserves commit and publication ordering, avoids a second notification owner, and repairs the supported legacy methods still used by the Control UI. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against af716af2a545. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…w#166396) Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Resolving an exec or plugin approval could time out even though the decision had already been made. The approval was durably committed and the waiting tool call correctly got its verdict. But the approve or deny RPC that resolved it, used by the Control UI's exec and plugin approval actions, did not reply until best-effort channel delivery notices had finished. When a notice was slow, the operator's click hit the 30-second
CLIENT_TIMEOUTand looked like it failed, after the decision had already taken effect.Why This Change Was Made
The shared resolution owner,
src/gateway/server-methods/approval-shared.ts, awaited delivery notices before acknowledging the resolving request (introduced inbb01e49192d; this predates the #166050 worker-dispatch refactor). It now acknowledges as soon as the decision is durably committed and published, then completes the notices on their own lifecycle. Notice failures are still logged, and the commit/publish ordering is unchanged.User Impact
Approving or denying from the Control UI returns immediately, even when a channel delivery notice is slow.
Evidence
CLIENT_TIMEOUTand pass after, using virtual deadlines (555 ms and 31 ms).pnpm build, and all 34check-changedgates passed.Related, not changed here: an approval card still in delivery when its approval expires can be left stale. Open PR #159524 already carries that exact fix and regression.