Repository navigation
feat: name the attached sub-agents when a guarded action is refused - #31483
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the 409 already carried the names, and this change only stops the readers from discarding them. Codes and status stay the same, and evidence covers the reshaped notice. Notes
[DESIGN-REVIEWED] 6413cc0 Description read[DESCRIPTION-READ] e2118aa6b586eb5797a453cef71cc36a3f75e843d3ae5c7149c191052fb23f03 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing to check. What this change shipsInventory (7 items) — 7 justifiedIntent: when a session refuses an action because sub-agents still hold it, the user or the driving agent can see which sub-agents to stop (#22357). ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 6413cc0 Description read[DESCRIPTION-READ] 4e4799edad96c83db0a80a8182b254d3f574287b9fafad4e98bba65ebe9b508b That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks: the new lines are plain text, the screenshots show them, and the blind reader correctly took them as a list of busy helpers and their states. Notes
[UX-REVIEWED] 6413cc0 Description read[DESCRIPTION-READ] 7ed586715470cf94964c7f43315f422ebd908406008bdbd0266887bfd473e60e That sha256 names everything this verdict read: the PR description, plus the 6 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: |
dabec07 to
7435425
Compare
The slot_subagents_running 409 already carries the unfinished runs and queued spawns that keep a session attached, but nothing showed them: the dashboard printed a fixed message and session-control collapsed the refusal into target_busy. A user or agent whose session kept refusing could not tell what to stop. The dashboard now lists each run and queued spawn by id and state under the refusal (every surface through friendlyErrText, and beside the Reload alert's copy), with a could-not-check line when runs is null or the queued listing is partial. Session-control's reload, set-model, retry and continue refusals append the same list to their message.
7435425 to
6413cc0
Compare
chenmingwei23
left a comment
There was a problem hiding this comment.
Approving: green board, no conflicts, no outstanding change requests.
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved for the on-call. Review lanes pass on 6413cc0, no conflict, no open change request.
Problem / Motivation
Goal: When a guarded action is refused because sub-agents keep a session attached, the dashboard and session-control name each running or queued sub-agent, so the user or the driving agent can see what to stop.
The
slot_subagents_running409 already carriesruns,queuedandqueued_partial(#22272), but nothing shows them. The dashboard's Reload alert prints a fixed sentence, every other refused press shows the baresub-agents are running, and session-control turns the refusal into its owntarget_busytext. A session that keeps refusing gives no hint which run or row is holding it.Why it matters
A session held by a run that never finishes (a stalled run, a row parked in
retry_wait) refuses Continue, Reload and every switch forever. Without the names, the user cannot tell what to stop, and an agent driving the session through session-control can only retry blindly.Not a goal
deliveries_inflight, task text or agent names. Ids and states only, as the 409 sends them.What changed (motivation → approach → change)
The refusal already knows what holds the session; only the readers threw it away. Each reader now turns the 409's fields into one short list instead of a fixed sentence.
Still running or queued: sub-7f3a (stalled) and task-0b4e (retry_wait).runsisnullorqueued_partialis trueSome sub-agents could not be checked.session_reload,session_set_model,session_retry,session_continueOn the dashboard,
slotAttachedDetailinapi/apiError.tsbuilds the lines from the raw body andfriendlyErrTextadds them to the message of aslot_subagents_runningrefusal, so every surface that shows that message gets them;hooks/useSessionActions.tsadds them to the Reload alert. The list is joined with the locale's own list format, and the two new strings are translated in every catalog underwebsite/src/i18n(plus a translator note ini18n/en.context.json). In session-control,_name_attachedinsession_control_parts/turn_control.pyappends the same list, in English, to thetarget_busyrefusals of reload and of set-model (session_control_parts/model_switch.py) and to the retry / continue refusal, anddashboard/session_control.pylists the new name for type checkers; thecodestays the same everywhere.docs/system-specs/modules/session.mdandsrc/kiro_crew/docs/session-control.mddescribe both readers.Backwards compatibility
Compatible: the 409 status,
errorandcodeare unchanged on every route, and session-control keeps itstarget_busy/slot_subagents_runningcodes; only the human-readable message gains a list. A body without the fields (an older gateway) shows exactly what it showed before.Removes nothing: no key, field, route or code is removed or tightened.
Tests
website/src/test/friendlyErrText.test.ts: aslot_subagents_runningbody yields the message plus the named list;runs: nullandqueued_partial: trueadd the could-not-check line; a body without the fields keeps the message alone.website/src/test/useSessionActions.test.tsx: a refused Reload alerts its own copy followed by the named list and the could-not-check line.test/test_session_control_reload.py::test_a_subagent_refusal_names_what_keeps_the_target_attached(three cases): both reload busy paths, the verb's own probe and the teardown's 409 through_reload_route_refusal, give the exact message with the named list, the could-not-check line, or both.test/test_session_control_set_model.py::test_a_subagent_refusal_names_the_attached_runsandtest/test_session_control_continue.py::test_a_subagent_refusal_names_the_attached_runs: the set-model and continue refusals name the run and keep their codes.Determinism: the five new backend node ids passed 20 times at
-n0, 10 times at-n 4 --dist loadgroup --max-worker-restart=2besidetest_session_control_retry.pyandtest_session_control_stop.py, and once in a shuffled order (seed 8809). The two new vitest cases passed 10 repeated runs and a--sequence.shuffle --sequence.seed=5081run of both files.Manual verification
Rendered the real
ErrorNoticewith the messagefriendlyErrTextbuilds from a 409 body, in a throwaway capture page served by a local Vite dev server (dark and light, English, and German at a phone width). Screenshots below. The Reload alert is a nativealert(), covered by the hook test.Screenshots / video
Refused Continue notice, before and after, dark:
Light:
German at 420 px, showing the locale's list join and wrapping:
Related Issues
Closes #22357
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.