Repository navigation
feat(autonudge): let a legacy loop declare it is waiting on a person - #21622
kyleseaman wants to merge 2 commits into
Conversation
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The screenshots and the recording show the waiting state, the release, the label kept until the popover closes, and the "No reply came in time" line. Notes
[UX-REVIEWED] dd9a003 Description read[DESCRIPTION-READ] e558d9e711ae17908d60a4b13d100f70264c2e73a692a11ab4523690abed10b7 That sha256 names everything this verdict read: the PR description, plus the 8 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 |
First Principles Review (Opus 5.5) — 🔴 BLOCKPremise-level review of First-Principles-Verdict: BLOCK product-shape change without accepted RFC: this PR holds a legacy loop, which the base's implemented RFC excludes ("Holding any loop other than a What this change shipsInventory (10 items) — 9 justifiedIntent: let a babysit loop that has asked the user something wait for their reply without spending cycles or budget, and without being stopped. This is an ADDITION.
Blockersproduct-shape change without accepted RFC: declared person-wait on a legacy loop — item 1 [FIRST-PRINCIPLES-REVIEWED] dd9a003 Description read[DESCRIPTION-READ] aa18b73606a2c0745ca71c432413585644522c75f6211bada6bb103dbfef562a 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 declared wait reuses the existing hold fields, budget credit and release path, and only a sender that proves a person is back can end it. Notes
[DESIGN-REVIEWED] dd9a003 Description read[DESCRIPTION-READ] fd7fa294cdb5638db8e908bbaa03fd48280819d0bf5089b5031b45878e380e36 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 |
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: |
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: |
a7a099d to
658ee07
Compare
c7dee41 to
4c89dc5
Compare
658ee07 to
cdac1cb
Compare
4c89dc5 to
73108ab
Compare
cdac1cb to
0998665
Compare
73108ab to
bdb8c73
Compare
99eceb0 to
964cac2
Compare
3581a0a to
c45ccfa
Compare
|
span=35099d78930c needs-a-decision
|
|
span=2fe3489fe350 needs-a-decision
|
|
span=5ea228060aeb rebutted
|
|
span=cbe0b71ae2e8 rebutted
|
|
span=3bc69141bca7 rebutted
|
|
span=73e6f97dd1f4 rebutted
|
70e7db7 to
e3775ea
Compare
|
span=dc6b1620be5a rebutted
|
|
span=19ca346c3827 fixed
|
|
span=b2c4f1f3f516 fixed
|
|
span=1eb31b4990d0 needs-a-decision
|
A babysit loop that has asked the user something (approve a force-push by SHA, choose between two fixes) kept firing a cycle every interval that could only report it was still waiting, spending its cycle cap and runtime budget until a bound stopped it. monitor_update(waiting_on_person=true) now declares that wait: the loop fires no cycle and spends neither bound, and it is released by the same signs a person is back that end an approval hold (a message in the dashboard chat, an answered approval, Nudge now), or by the agent passing false. A declared hold on a loop that names one pull request reads it every five minutes, like an approval hold, and settles the loop when the pull request merges or closes; a loop naming none arms nothing. True is refused from cron/app producers, on Slack and Discord bindings (their replies never reach the release), for structured monitors and for inactive loops. The popover shows "Waiting on you · reply in this chat or press Nudge now to resume."
…n-wait held main's turn-start release (turn_entry, any sender) reached release_approval_hold, which this PR taught to end a declared person-wait too, so a subagent completion, cron or conductor send released the hold as if a person had replied. The release now takes person=; the turn-start caller passes False and ends an approval hold only. Also keep the Nudge now label until the popover closes: pressing it ends a declared wait, which dropped the label and shrank the button to its icon, sliding Pause under the pointer that had just clicked. Also tick a declared hold at least every SUBJECT_READ_SECS. asyncio sleeps on the monotonic clock, which stops while a host is suspended, so a hold armed for its whole 24-hour expiry still owed that sleep after a resume past the expiry and stayed held up to another day. Each tick re-reads the wall-clock expiry and fires nothing before it.
|
Pushed UX Review block on Local GPT review finding ( |
|
UX Review notes on
|
Problem / Motivation
Goal: A monitoring loop that has asked the user something can wait for their answer without spending its cycles or budget, and without being stopped.
A babysit loop that needs the user (approve a force-push by SHA, pick between two fixes) has nothing useful to do until they reply, yet it keeps firing a cycle every interval. Each cycle can only report "still waiting", spends one of the loop's cycles and its runtime budget, and trips the agent's own stall tripwire. A loop left waiting overnight ends on a spent bound, so the user comes back to a stopped loop rather than one waiting for them.
Stacked on PR #21621 (base
fix/legacy-loop-agent-stop; #21377 below it is merged); review only this PR's two commits.Restack onto the rebased #21621 (2026-11-16)
This PR's commit was restacked from
56d52517faonto #21621 rebased onmain. Where main changed the code it touched:monitor_updateguidance out ofsrc/kiro_crew/config/prompt.mdinto thekirocrew-dev/babysitskill (src/kiro_crew/builtin_skills/kirocrew-dev/babysit/SKILL.md), so thewaiting_on_personsentence now lives in that skill'smonitor_updatebullet, word for word. This PR no longer editsprompt.mdor its byte budget intest/test_prompt_compact_contract.py.responsive_chat.notify_user_input's person check (person,card_origin). Thehumanvalue this PR uses forhuman_input_generationand for the release now includes that narrowing, so a card's or an agent's send neither releases a declared wait nor counts as the person's reply.person_wait_expires_at/person_wait_ends_on_budgetare set before main's per-field scrub in_serializeand in the state frame.waiting_on_person, which a declared wait sets, and the declared hold's expiry delay still bounds the sleep.until_parked(..., timeout=30)calls use the helper's default bound (flake-pattern ratchet K19).Second commit,
fix(autonudge): a turn opening for any sender leaves a declared person-wait held. Main added a release at every turn start, for any sender (dashboard/chat_turn/turn_entry.py, "a new turn started in the session"). This PR teachesrelease_approval_holdto end a declared wait too, so combined, a subagent completion, a cron or a conductor's send opening a turn released the wait as if the person had replied, and recordedperson_wait_release: "person". The release path now takesperson=(release_approval_hold_for→_schedule_release→release_approval_hold); the turn-start caller passesFalseand ends an approval hold only. A person's message, an answered approval and Nudge now keepTrue. Tests:test_a_new_turn_in_the_slot_does_not_release_a_declared_wait,test_a_new_turn_in_the_slot_still_releases_an_approval_hold, andtest_dashboard_approval_window.py's turn-start release test now pinsperson=False; each failed before the fix.UX Review fix (same second commit). The UX lane blocked
eee6e71db0: pressing the labelled "Nudge now" ends the declared wait, so the button lost its label, shrank to the bolt, and Pause slid under the pointer that had just clicked. The label now stays until the popover closes (AutoNudgePopover.tsx,keepPlayLabel); a reopened popover on the released loop shows the plain bolt. The accessible name is unchanged. Test:Nudge now keeps its name until the popover closes, so the press that ends the wait does not slide Pause under the pointer(failed before the fix). It rides in the second commit rather than a third because PR Hygiene caps a PR at two commits; the second commit is the whole delta on top of this PR's reviewed commit.Local GPT review fix (same second commit). A local
gpt-6.1-solreview of the restacked head blockedtimers.py_held_tick_delay: a declared hold with nothing to read armed one timer for its whole time to expiry, up to 24 hours. asyncio sleeps on the monotonic clock, which stops while a Linux/macOS host is suspended, so after a resume past the expiry that timer still owed its full sleep, and the expired hold suppressed nudges for up to another day. A declared hold now ticks one read interval (SUBJECT_READ_SECS, 5 minutes) out, or at its expiry when that is sooner. Each tick re-reads the expiry on the wall clock and fires nothing before it, which is the cadence a held loop naming a pull request already had. Tests, each failing before the fix:test_a_subject_less_declared_hold_arms_no_more_than_one_read_interval,test_a_host_suspended_past_the_expiry_ends_the_hold_at_its_next_tick(the wall clock jumps past the expiry while the monotonic clock stands still, and the next tick recordsperson_wait_release: "expired"), andtest_a_tick_before_the_expiry_re_arms_one_read_interval_out_and_fires_nothing. Five existing tests that pinned the old one-tick-at-expiry delay now pin the read interval. The monitor-architecture spec says the same.Recording (built SPA, stubbed API, the gateway's
autonudge_stateframe pushed when/fireis hit): the press, the released "Goal active" state with the label and both buttons where they were, then close and reopen showing the plain bolt. The harness asserts the label survives the press, Play's and Pause's x positions do not change, and the label is gone after reopening.nudge-now-press.webm
Why it matters
Waiting on a person is the normal state of an unattended PR babysit between approvals. Today the loop either burns budget re-asking or the agent stops it and has to be re-armed by hand. A declared wait keeps the loop alive and cheap, and resumes it the moment the person is back.
Kyle asked for this behaviour. It is recorded in
docs/request-for-change/rfc-legacy-loop-reads-stops-waits.md§ 2.4 (RFC PR #22165, docs only), which this stack rebases onto once it merges; this PR edits no RFC. § 2.4 amends the non-goal "Holding any loop other than awork-ledgerwatch" ofrfc-work-ledger-person-wait-hold.mdfor this one case; the ledger trigger and release are unchanged.Not a goal
monitor_watch), which do not use this hold.What changed (motivation → approach → change)
It reuses the work-ledger hold's fields and budget credit, marked as declared, and releases on an approval hold's signs.
autonudge_service/person_wait.py(new):declare_person_waitsets or ends the declared hold on the caller's own legacy loop, arming its first pull-request read.autonudge_service/model.py: persistedperson_wait_declared.autonudge_service/firing.py: a declared hold runs the held tick (subject_reads.hold_tick) instead of a cycle; the ledger neither holds nor releases it;_commit_person_waitrefuses a loop removed or deactivated under the lock. The two holds never overlap.autonudge_service/subject_reads.py: a declared hold on a gated loop naming one pull request reads it every 5 minutes like an approval hold (an ungated one reads nothing, and its sleep toward expiry is one plain sleep); a merge or close settles it, crediting the held span.autonudge_service/timers.py:release_approval_holdand_schedule_releaseend a declared wait too when the caller proves a person is back (person=True), crediting its span and refusing after shutdown; a turn opening for any sender (person=False) ends an approval hold only;_held_tick_rearmsand the reconciler treat it as an approval hold.autonudge_service/mutations.py: revival clears the mark;src/kiro_crew/autonudge.pybinds the new owner.mcp_tools/control_parts/monitor.py,mcp_tools/control_parts/schemas.py,validation_parts/core_agent_schemas.py:monitor_update(waiting_on_person: bool), legacy only.dashboard/session_directive_person_wait.py(new), wired fromdashboard/session_directive_apply.py:trueneeds a person's own turn or the loop's own wake; refused for cron/app producers, Slack/Discord bindings and chats linked to a channel thread (that link-store read runs off the event loop; the write is bound to the authorized loop), structured monitors and paused loops. If the person replied during the declaring turn (dashboard/responsive_chat.py's turn generation), the loop is not held.falseon a work-ledger hold says the hold is the ledger's.dashboard/handlers/autonudge.py,slack/gateway_runtime/nudge_wiring.py:monitor_inspectand the state frame carryperson_wait_declared.website/src/components/AutoNudgePopover.tsxandwebsite/src/components/autoNudgeLoop.ts: the title reads "Waiting on you" while the loop runs (a paused loop keeps its title), the status offers this chat or Nudge now (enabled while held).PERSON_WAIT_MAX_SECS) and the end of the runtime budget left when it started (on theruntime_elapsedclock, so a host suspend cannot expire it; after a restart,created_ts + max_runtime_secs), and the expired span is charged to that budget. A release past the deadline counts as the expiry, checked on a clock read after the deadline is computed; a failed expiry write on Nudge now answers 503.person_wait_releaserecords why it ended (expired,person,agent); the loop row, theautonudge_stateframe andmonitor_inspectcarry it, plusperson_wait_expires_atwhile it holds. Declared over a work-ledger hold, it credits that span back and starts its own clock. The popover's held line leads with the outcome ("Nudges resume at 1:00 AM tomorrow (in 19h) if you don't reply.", or "The goal ends at ..." when the budget ends the wait); after an expiry: "No reply came in time, so nudges resumed.", minus the last clause when the expiry ended the loopwebsite/src/i18n/locales/*.json: the new title, status, end-time and expiry keys in every locale.website/src/monitoring/automation.tsandwebsite/src/components/SessionAutomationPopover.tsx: the automation normalizer and session popover carry the field.docs/system-specs/modules/monitor-architecture.md,src/kiro_crew/builtin_skills/kirocrew-dev/babysit/SKILL.md: the declared hold, and the one sentence that allows a declaration only after a blocking question.Backwards compatibility
Compatible:
person_wait_declareddefaults tofalse;waiting_on_personis a new optionalmonitor_updatefield; work-ledger holds and approval holds behave as they do on the base.Removes nothing: no field, key, route or behavior is removed.
Tests
test/test_autonudge_declared_person_wait.py(new): a declared hold fires no cycle and spends neither bound, crediting the span back; a dashboard message releases it and a non-human send does not; an answered approval and Nudge now release it; ledger movement neither holds nor releases it, even when a declaration lands during the ledger read; a replacement loop armed during the declaring turn's mirror probe is not held; a declaration over a work-ledger hold starts its 24-hour clock at the declaration, and a re-declaration keeps its start; a declaration on a pull request arms its read, and the declaring turn's end keeps that read rather than the deadline (a wait with nothing to read arms a read-interval tick that reads nothing); a merged or closed pull request settles a declared hold on a gated loop and clears it on disk, spending none of the budget (its settlement clock pinned); a declared hold on an ungated loop survives its pull request merging, reading nothing and re-arming one read interval out; an open or unread one keeps it held and re-arms at the read interval; a person back during the read is not settled; the reconciler rescues a declared hold's read and leaves one with nothing to read unarmed; revival clears it; it survives a restart; declaring during an approval hold writes nothing and leaves the loop held; an unanswered approval during a declared wait records no approval hold; a row carrying both marks credits one span; a Stop queued ahead of the declaration or release is not resurrected; a reply before or during the declaration write leaves the loop unheld; the applier works from a person's turn and the loop's own wake and is refused for cron/app producers, Slack/Discord bindings, a Slack thread linked to a dashboard slot (a person's turn or the loop's own wake), structured monitors and paused loops; it combines withmessage;falsereleases, and on a ledger hold says so; a refused write after a combined patch reports the fields that landed; shutdown drains a declaration admitted before closure and refuses a declared wait's release after it; a person or agent release after the deadline is an expiry with no refund; a storedperson_wait_releaseof[]or{}loads as""and keeps the loop.test/test_autonudge_declared_person_wait.pyalso: a wait declared after a host suspend keeps the runtime budget's remainder;test/test_autonudge_manual_fire.py: Nudge now on an expired wait whose expiry write fails answers 503; a person or agent release after a spent live budget is an expiry on a clock that moves during the check; an ungated declared wait's sleep runs no read.website/src/test/AutoNudgePopover.test.tsx: the new status line, its time left and clock across midnight, no "Waiting on you" title on a paused loop, both expiry lines, Nudge now enabled past the deadline, and its visible label only while held;automationNormalizer.test.ts: the field.test_autonudge_refactor_contract.pyandtest_autonudge_handlers_cov80.py.Manual verification
The built dashboard on loopback with stubbed APIs, captured by an uncommitted Playwright script, which asserts the status line equals the catalog copy, that the one Nudge now control is enabled with the deadline long past, and that its "Nudge now" label is visible. The babysit skill's sentence only lets an agent declare after it has asked the user a question in this chat, and names the 24-hour bound. Local gates: the related backend set, isort, flake8, black, mypy, comment-history, line cap, the flake-pattern ratchet,
tsc -p tsconfig.app.json, the related vitest files and the i18n check.Related Issues
No tracking issue, by the maintainer's request; the motivation above is the record.
Checklist