Skip to content

feat: name the attached sub-agents when a guarded action is refused - #31483

Merged
bolichen97 merged 1 commit into
mainfrom
fix/22357-slot-attached-detail
Nov 6, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/22357-slot-attached-detail

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

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_running 409 already carries runs, queued and queued_partial (#22272), but nothing shows them. The dashboard's Reload alert prints a fixed sentence, every other refused press shows the bare sub-agents are running, and session-control turns the refusal into its own target_busy text. 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

  • Changing when the guard refuses, or what the 409 body carries.
  • A button that stops the named sub-agents.
  • Showing 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.

Surface What the user or agent now sees
Dashboard, every refused press that shows the error (Continue, Regenerate, the agent, model and effort switches, …) Under the refusal: Still running or queued: sub-7f3a (stalled) and task-0b4e (retry_wait).
Dashboard Reload alert The same line after its own copy
Either, when runs is null or queued_partial is true Some sub-agents could not be checked.
session-control session_reload, session_set_model, session_retry, session_continue The same list appended to the refusal message the tool prints

On the dashboard, slotAttachedDetail in api/apiError.ts builds the lines from the raw body and friendlyErrText adds them to the message of a slot_subagents_running refusal, so every surface that shows that message gets them; hooks/useSessionActions.ts adds 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 under website/src/i18n (plus a translator note in i18n/en.context.json). In session-control, _name_attached in session_control_parts/turn_control.py appends the same list, in English, to the target_busy refusals of reload and of set-model (session_control_parts/model_switch.py) and to the retry / continue refusal, and dashboard/session_control.py lists the new name for type checkers; the code stays the same everywhere. docs/system-specs/modules/session.md and src/kiro_crew/docs/session-control.md describe both readers.

Backwards compatibility

Compatible: the 409 status, error and code are unchanged on every route, and session-control keeps its target_busy / slot_subagents_running codes; 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: a slot_subagents_running body yields the message plus the named list; runs: null and queued_partial: true add 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_runs and test/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=2 beside test_session_control_retry.py and test_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=5081 run of both files.

Manual verification

Rendered the real ErrorNotice with the message friendlyErrText builds 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 native alert(), covered by the hook test.

Screenshots / video

Refused Continue notice, before and after, dark:

Continue refused, dark, English

Light:

Continue refused, light, English

German at 420 px, showing the locale's list join and wrapping:

Continue refused, dark, German, narrow

Related Issues

Closes #22357

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributed under the project's Apache-2.0 license.

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 6, 2026 15:16
@bolichen97
bolichen97 requested a review from Zedmor November 6, 2026 15:16
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 6413cc049dc11829f5e7727fa10a935ceb57159a — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • The list has no length limit. A slot holding dozens of queued spawns would produce a notice, or a session-control message, as long as the queue. Showing the first few and then "and N more" would keep it readable.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 6413cc049dc11829f5e7727fa10a935ceb57159a — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing to check.

What this change ships

Inventory (7 items) — 7 justified

Intent: 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.

  1. Refused dashboard actions (Continue, Regenerate, the switches…) now list each attached run or queued spawn as id (state) — justified
  2. A "Some sub-agents could not be checked." line appears when runs is null or queued_partial is set — justified
  3. The Reload alert adds the same list after its own copy — justified
  4. The target_busy refusals from session-control's session_reload and session_set_model add the list to their message — justified
  5. The slot_subagents_running refusals from session_retry and session_continue add the list to their message — justified
  6. Two new strings, translated in every locale catalog, plus a translator note — justified
  7. slotAttachedDetail is now exported from apiError.ts (two consumers: friendlyErrText, useSessionActions) — justified

[FIRST-PRINCIPLES-REVIEWED] 6413cc0

Description read

[DESCRIPTION-READ] 4e4799edad96c83db0a80a8182b254d3f574287b9fafad4e98bba65ebe9b508b

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 6413cc049dc11829f5e7727fa10a935ceb57159a — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • The German string subagents_could_not_be_checked says "Unteragenten", but the rest of de.json says "Subagenten" (for example "Subagenten laufen"). The blind reader spotted the two terms side by side in shot-03. Change it to "Einige Subagenten konnten nicht geprüft werden."
  • ${row.id} (${row.state}) shows raw backend states such as retry_wait and stalled. The blind reader said: "I can't read 'retry_wait', the underscore makes it look like computer text." Map each state to a translated label (running, queued, waiting to retry, stalled) before calling fmtList, so German also stops showing English status words.
  • The Reload alert() has no screenshot. Its new lines are the same strings the notice shots already show, so this is only a note. A capture of the alert would complete the evidence.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 6413cc049dc11829f5e7727fa10a935ceb57159a — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 6413cc0

Verdict parsed from the review's SHA-scoped output markers for commit 6413cc049dc11829f5e7727fa10a935ceb57159a.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 6413cc049dc11829f5e7727fa10a935ceb57159a false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 6413cc049dc11829f5e7727fa10a935ceb57159a and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 6413cc0

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 6413cc049dc11829f5e7727fa10a935ceb57159a false-positive: <reason, 20 to 500 characters>

@bolichen97
bolichen97 enabled auto-merge (squash) November 6, 2026 15:43
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Nov 6, 2026
@bolichen97
bolichen97 force-pushed the fix/22357-slot-attached-detail branch from dabec07 to 7435425 Compare November 6, 2026 20:33
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 6, 2026
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.
@bolichen97
bolichen97 force-pushed the fix/22357-slot-attached-detail branch from 7435425 to 6413cc0 Compare November 6, 2026 22:21
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 6, 2026

@chenmingwei23 chenmingwei23 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving: green board, no conflicts, no outstanding change requests.

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for the on-call. Review lanes pass on 6413cc0, no conflict, no open change request.

@bolichen97
bolichen97 merged commit a8d7ad2 into main Nov 6, 2026
97 of 99 checks passed
@bolichen97
bolichen97 deleted the fix/22357-slot-attached-detail branch November 6, 2026 23:42
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show what keeps a slot attached when a guarded action is refused (dashboard and session-control)

3 participants