Repository navigation
fix(webex): deny an undelivered approval at once instead of waiting - #34834
Conversation
|
[operator: bolichen97] Every red check on 5977115 failed on GitHub's API rate limit for the CI installation ( |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The new branch reuses the existing What this change shipsInventory (5 items) — 5 justifiedIntent: someone who mutes a Webex conversation shouldn't have the turn freeze for 300 s on every tool call that needs approval. This is a FIX (#34404).
[FIRST-PRINCIPLES-REVIEWED] e4f0679 Description read[DESCRIPTION-READ] 8a89c402d09ba4de74b2d99bb2a1a36457e71529bbf295123bc31b3ea38e7b28 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. The one renderer that reserves in production, Notes
[DESIGN-REVIEWED] e4f0679 Description read[DESCRIPTION-READ] 4c0cb7e9fd3d6e398128341e68714a710a0882c48801f3f6c4335e6c1d821fab That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Code change approver recommendation: A person should decideWhy: the decider raised 1 possible problem and estimates a 60% chance that this change introduces a defect; a person should check it. The fix achieves its goal: an unreserved Webex approval is denied at once as approval_undeliverable, and delivered prompts are unaffected because the only Webex renderer reserves before sending. But the early return skips _notify_approval_stalled, which main reached for the same request after the window. An AutoNudge loop in a muted Webex conversation is therefore no longer held. It keeps firing and spends its whole budget on denied turns. The fix is one existing call plus a test. Things to check (possible problems the decider raised; at this confidence many turn out to be fine):
An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
buluoray
left a comment
There was a problem hiding this comment.
Request changes on 5977115. A Webex approval with no renderer reservation (muted turn, SilentRenderer) is now denied at once as approval_undeliverable instead of waiting 300 s. A delivered card always reserves synchronously before its send is awaited, so a slow but delivered card is unaffected. The new branch only returns False, and nothing it leaves behind can be resolved by a late click. Decisive lines: src/kiro_crew/messaging/approval.py:655-660, src/kiro_crew/webex/renderer.py:372-375, src/kiro_crew/messaging/driver.py:1307-1326, src/kiro_crew/messaging/dispatch.py:794
5977115 to
33f50a7
Compare
|
self-added: yes
|
|
[operator: bolichen97] Re the one item under "Things to check" (a muted Webex conversation's AutoNudge loop no longer held): right, and fixed in 33f50a7. The immediate undeliverable denial now calls |
|
[operator: bolichen97] @buluoray thanks for the review of 5977115. It requested changes without naming a line, so I took the one open defect on that head as the reason: the immediate undeliverable denial skipped |
|
The review found nothing that blocks this PR on 33f50a7. It is waiting on one thing: the change request from buluoray was submitted on the earlier head 5977115 and is still open. It names no line. The one defect raised on that head was the skipped AutoNudge stall notification, and it is fixed on this head and pinned by What the review checked on this head:
Security: this changes the approval decision path, but it only tightens it. A prompt that was never delivered is now denied at once instead of after the 300 s window. Nothing new is approved, and a delivered prompt behaves as before. Done well: the fix applies the rule Optional:
|
33f50a7 to
e33f955
Compare
|
[operator: bolichen97] Re the third optional item (the test on the Proof line awaited |
|
[operator: bolichen97] Re the first optional item ( |
|
[operator: bolichen97] Re the second optional item (no test drives a real |
buluoray
left a comment
There was a problem hiding this comment.
Approve on e33f955. This supersedes our earlier change request on 5977115. That request rested on one point: the new immediate denial for a Webex approval that was never shown skipped the stall signal, so an AutoNudge loop bound to a muted Webex conversation kept firing and spent its budget on denied turns. That is fixed on this head. The no-reservation branch now signals the stall before it denies, the same call the expired wait makes. A new test pins it and turns red when the call is removed. The branch still only denies and leaves nothing a late click or typed reply could approve. A delivered card still reserves before it is sent, so it waits as before. Only the Webex registry changed; Slack, Discord, Teams and Telegram use their own deciders and are untouched. 224 targeted tests pass. The backend test lanes have since finished on this head; the only failing tests are the two that are already red on main. Decisive lines: src/kiro_crew/messaging/approval.py:655-662, src/kiro_crew/messaging/approval.py:690-714, src/kiro_crew/autonudge_service/timers.py:384-386, test/test_messaging_approval.py::TestApprovalStallSignalling::test_an_undelivered_prompt_signals_autonudge
e33f955 to
5e0f51a
Compare
|
Rebased: main moved in src/kiro_crew/dashboard/handlers/updates.py and test/test_update_boot_apply.py since this head went green (f9788c5 -> 80cf3df); CI re-running. The backend reds on e33f955 were main's own ( [operator: bolichen97] |
A muted Webex conversation renders its turn with SilentRenderer, which drops the approval prompt on purpose, so the renderer never reserves a decision window for it. PendingApprovals.decide_with_cause then opened a window of its own and waited the full approval window for an answer nobody was asked for, on every tool call, before denying it as expired. With no reservation it denies at once with approval_undeliverable, the rule open_approval documents and TextReplyApprovalDecider follows, and still tells AutoNudge the approval stalled, as the expired wait did, so a loop bound to the muted conversation holds instead of spending its cycles on denied turns. A delivered Webex prompt is always reserved by its renderer before it is sent, so it is unaffected. Tests that drove the registry without a reservation reserve first, the order production uses. Closes #34404
5e0f51a to
e4f0679
Compare
|
Rebased: main moved in test/test_cloud_launch_customize.py, test/test_approval_timeout_cause.py and docs/system-specs/modules/messaging.md since this head went green (80cf3df -> 5e7b587); CI re-running. The red Backend Tests shard 2 (Linux and Windows) on 5e0f51a was [operator: bolichen97] |
Problem / Motivation
Goal: In a muted Webex conversation, a tool that needs approval is denied at once as "never delivered" instead of stalling the turn for the whole approval window first.
When a Webex conversation is muted (disconnected in the dashboard), its approval prompts are dropped on purpose. Webex still waits the full approval window (300 s) on every tool call that needs approval, for an answer nobody was asked for, and then denies it as
approval_timeout.Why it matters
Someone who disconnects a Webex conversation to keep working in the dashboard gets a turn that freezes for five minutes per tool call. The model is also told the prompt expired, when in fact it was never shown. The typed-reply channels already deny such a prompt at once.
Not a goal
What changed (motivation → approach → change)
A muted Webex conversation no longer stalls on approvals: a tool that needs one is denied straight away, and the model hears that the prompt never reached the user.
approval_timeoutapproval_undeliverableWhy it stalled: a muted turn renders with
SilentRenderer, so the Webex renderer never callsPendingApprovals.reservefor the prompt.PendingApprovals.decide_with_causeinmessaging/approval.pythen opened a window of its own and waited it out. That broke the ruleopen_approvaldocuments: no reservation means no prompt was delivered.The fix: with no reservation,
decide_with_causereturns(False, approval_undeliverable)at once, the same answerTextReplyApprovalDecidergives. It still calls_notify_approval_stalled, as the expired wait did, so a loop bound to the muted conversation is held instead of firing turns that are denied. The Webex renderer always reserves a delivered prompt before sending it, so nothing else changes. Tests that drove the registry without a reservation reserve first, the order production uses.docs/system-specs/modules/messaging.mdlistsSessionApprovalDecideramong the deciders that record the undeliverable cause, and says an undelivered request signals the stall too.Backwards compatibility
Compatible: a delivered Webex prompt is always reserved before it is sent, so only a never-delivered prompt changes, and it is still denied (sooner, with the true cause).
Reader: src/kiro_crew/webex/transport_dispatch.py:SessionApprovalDecider -- chat --
WebexRendererreserves throughmint_approval_noncebefore it sends the prompt; test_webex_dispatch_cards.py::TestApprovalCardPressReader: src/kiro_crew/webex/transport_dispatch_interactions.py:_APPROVALS.has_pending -- chat -- a typed 1/2 still finds the reserved prompt while the turn waits; test_webex_dispatch.py::test_an_approve_reply_resolves_the_prompt_and_does_not_steer
Tests
test_approval_timeout_cause.py::TestSessionDecider::test_an_undelivered_prompt_is_denied_at_once_as_undeliverable: with no reservation the Webex decider denies inside the bound, recordsapproval_undeliverable, and leaves nothing pending.test_messaging_approval.py::TestApprovalStallSignalling::test_an_undelivered_prompt_signals_autonudge: with no reservation, the registry denies as undeliverable and still tells AutoNudge the approval stalled.test_messaging_approval.py::TestReservationRace::test_an_answered_unadopted_reservation_is_discarded_with_the_turn: the later muted request is denied as undelivered, never by the discarded Approve.Proof: PROVEN test/test_messaging_approval.py::TestReservationRace::test_an_answered_unadopted_reservation_is_discarded_with_the_turn (head 11052824863e)
Determinism: the 42 changed tests passed 20 times at
-n0, 10 times at-n 4 --dist loadgroup --max-worker-restart=2besidetest_messaging_driver.pyandtest_messaging_dispatch.py, and once in a shuffled order (seed 34841).Manual verification
N/A — unit coverage sufficient: the change is one branch in the approval registry, and the tests drive the same
SessionApprovalDeciderthe Webex dispatcher builds.Related Issues
Closes #34404
Sibling sweep
Swept: git grep -nE "class \w*ApprovalDecider\b" -- src/kiro_crew, then each decider's branch for a request with no reservation
Sibling: src/kiro_crew/messaging/approval.py -- changed here
Sibling: src/kiro_crew/discord/renderer_approval.py -- not affected -- denies a request with no reservation at once on main (#35767)
Sibling: src/kiro_crew/telegram/renderer_approval.py -- not affected -- denies a request with no reservation at once on main (#35767)
Sibling: src/kiro_crew/teams/approvals.py -- not affected -- denies a request with no reservation at once on main (#35767)
Sibling: src/kiro_crew/slack/renderer.py -- not affected -- its one caller (
slack/transport_dispatch.py) pairsSlackApprovalDeciderwithSlackRenderer, neverSilentRenderer, andSlackRendererreserves before it postsPattern harvest
Not generalizable: each channel's decider has its own registry shape, so the "no reservation means undelivered" rule is a per-decider branch, not a pattern a lint can match.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)