Skip to content

fix(crew-mode): a crew member's tool approval alerts the person, pointed at its conductor - #25847

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
fix/crew-mode-approval-notify
Oct 30, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
fix/crew-mode-approval-notify

Conversation

@bolichen97

@bolichen97 bolichen97 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A Crew member's tool approval tells the person, even when they are in another chat or away from the window.

While its Crew chat (the conductor) is open, a Crew member's tool approval made no chime, no unread mark, no bell note, no banner and no OS toast. The person's session list leaves the Crew member's row out, and the Crew chat's row only reads its own approval, so a running Crew chat showed "Thinking…" while its Crew member waited. Nobody was told.

Why it matters

A Crew member that waits on an approval has stopped. Every Crew Mode user who switches chats or leaves the window can leave work blocked with no sign of it, and the approval card in the Crew chat only helps once someone opens it.

Not a goal

  • Changing who can decide a Crew member's approval: the Crew chat's approval card stays the only place.
  • Changing the turn-done chime rule for Crew members (a finished Crew member turn stays quiet).
  • The session-row badge and eyebrow spacing notes from the same review; they ship separately.

What changed (motivation → approach → change)

Root cause: two early returns muted a Crew member's approval everywhere while its Crew chat was open (approvals.ts on the live frame and on reconnect, chatStream.ts on the native permission row). The server keeps the wait on the Crew member's own row, which the list hides.

Signal Before After
Chime none yes
OS toast (away) none yes, titled with the Crew member's name
Bell note + banner none " needs approval", slot = the Crew chat
Unread mark none on the Crew chat's row, by the same arrival rule as any chat: off screen it is marked, and a window showing the Crew chat relays it as read to the others
Crew chat's row while running "Thinking…" "Approval needed · N"

The note offers no Approve or Reject: opening it shows "Go to Chat", which opens the Crew chat and its approval card. The banner stays quiet while the Crew chat is on screen (targetsCurrentView). With the Crew chat closed, nothing changes: the Crew member alerts like any chat.

Both of the review's options are here. The bell note alone cannot mark the row: a native permission row makes no bell note for any chat, so the Crew chat's row (SessionRow.tsx, counted by the existing crewWaitingApprovals) shows the wait whenever work or status would hide the crew summary; a decision the Crew chat itself owes keeps the line. The rule is recorded in docs/decisions/2026-10-29-crew-member-approvals-notify.md, and the crew-mode.md spec line that described the mute now describes this.

Backwards compatibility

Compatible: the Notification type (types/index.chat.ts) gains one optional client-made field, crew_member; every other note and chat behaves as before.

Removes nothing: the mute removed here was a quiet path, not a capability; every surface it skipped now runs.

Tests

  • crewMemberApprovalNotify.test.ts: with the Crew chat open but another chat on screen, a Crew member's approval frame chimes, adds a bell note pointed at the Crew chat under the Crew member's name, and banners; its native permission row chimes, posts an OS toast in its name and marks the Crew chat unread, and leaves the Crew chat read while it is on screen; opening the Crew chat relays a read that covers that prompt, so other windows clear its mark. Both cases fail on main's approvals.ts, chatStream.ts and attention.ts, and pass with this change.
  • crewMemberApprovalNotify.test.ts also checks that a window showing the Crew chat relays the prompt as read, for both the native row and the approval frame.
  • NotificationFeed.phase4.test.tsx: a Crew member's approval note shows no Approve or Reject.
  • ChatSidebar.conductorLane.test.tsx: a running Crew chat's row says "Approval needed · 1" while a Crew member waits, and goes back to its running line when nothing waits.
  • attention.crewWorker.test.ts, crewWorkerQuiet.test.ts: updated to the new rule.

Proof: not provable -- frontend test (prove.py runs Python only)

Manual verification

The built SPA was driven in Chromium with fixture data and a live approval frame over the dashboard socket, on main and on this branch, in light and dark at DPR 1 and 2. On main: no banner, no bell note, the Crew chat's row says "Thinking…". Here: a "Rain haiku needs approval" banner, the row says "Approval needed · 1", and the note's detail shows "Go to Chat" with no Approve or Reject.

Screenshots / video

Before (main), light, DPR 1: no banner, row says "Thinking…".

before light dpr1

After, light, DPR 1: banner named for the Crew member, row says "Approval needed · 1".

after light dpr1

After, dark, DPR 1: the note opened, "Go to Chat" and no Approve or Reject.

after dark dpr1 review

Every variant

before dark dpr2
after dark dpr2
before light dpr2
after light dpr2
before dark dpr1
after dark dpr1
after light dpr1 review
after light dpr2 review
after dark dpr2 review

Related Issues

Closes #25810

Follow-up to #24860.

Sibling sweep

Swept: git grep -nE "crew_root|isCrewWorkerSlot|crewWorkerRoot" -- website/src/hooks website/src/components/notifications
Sibling: website/src/hooks/websocket/turnCompletion.ts -- not affected -- a finished Crew member turn stays quiet by design; a paused or errored turn already sounds

Pattern harvest

Not generalizable: the mute was one rule written in two hooks for one feature; both sites are removed here.

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

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: the old mute pin is reversed openly through a new maintainer decision entry rather than treated as a gap, and the screenshots cover the changed row and note.

Notes

  • The "point at the conductor" redirect now exists in two copies, approvals.ts (crewApprovalTarget + attendArrival) and chatStream.ts (crewRoot + attendArrival). If one owner helper in attention.ts returned the note slot, crew name and unread target, the next signal added couldn't drift between them.

[DESIGN-REVIEWED] c87441d

Description read

[DESCRIPTION-READ] 3f75fed26da38899de1730350ce1f4db78a623a045c7abeb2c517b6a8b413bca

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 Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of c87441d5cb0ed6506b6d4c3e815e4f7473d57054 — 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

Every item is a fix for the defect in #25810. It reuses the existing crewWaitingApprovals count, and the description names the mute it reverses.

What this change ships

Inventory (7 items) — 7 justified

Intent: when a Crew member is blocked on a tool approval, the person finds out even if they are in another chat or away from the window. FIX.

  1. A Crew member's approval now chimes while its Crew chat is open — justified
  2. The OS toast fires for a Crew member's approval, titled with the Crew member's name — justified
  3. A bell note and banner (" needs approval") point at the Crew chat — justified
  4. That note shows no Approve or Reject; "Go to Chat" leads to the approval card — justified
  5. The unread mark lands on the Crew chat's row and clears in other windows when it is read — justified
  6. A running Crew chat's row reads "Approval needed · N" instead of "Thinking…" — justified
  7. The crew_member field, which only the client sets on a note (read by the feed and the detail panel) — justified

[FIRST-PRINCIPLES-REVIEWED] c87441d

Description read

[DESCRIPTION-READ] e4f9cf397d76d880cdc3c399063e1b99331cfbc713a01f3e5b09b4abc17faec1

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 Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

The blind reader read every primary control correctly: the banner, "Approval needed · 1" and "Go to Chat". The screenshots show all of them.

Notes

  • The approval note offers no Approve or Reject and does not say where the decision happens. The reader wrote: "I don't know where I'd actually say yes or no." Rename the button to "Open Crew chat to decide", or add a line beside it: "Approve or reject this in the Crew chat."
  • The banner's title "Rain haiku needs approval" names the Crew member. The highlighted row is "Crew Haiku Sea Trees Rain", and the reader was "only guessing they're the same thing". Put the Crew chat's name in the note body, e.g. "In Crew Haiku Sea Trees Rain".

[UX-REVIEWED] c87441d

Description read

[DESCRIPTION-READ] fa33fccf5e372d7aa94d580543057ea3d5f2fd2573c2c5982cedec9ea7cad687

That sha256 names everything this verdict read: the PR description, plus the 15 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 Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] c87441d

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

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

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] c87441d

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

@bolichen97
bolichen97 enabled auto-merge (squash) October 29, 2026 18:09
@bolichen97
bolichen97 force-pushed the fix/crew-mode-approval-notify branch from 5c8948c to 7944c6d Compare October 29, 2026 18:12
@bolichen97

bolichen97 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: a second waiting-approval counter for the Crew chat's row
resolution: removed

  • span=c01ccdbc1a48 The row's waiting count repeats an existing counter

fixed in 7944c6d: crewWaitingCount is deleted; the row reads crewWaitingApprovals(slots)[root], the counter the fleet view already uses, so there is one count.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Oct 29, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/system-specs/modules/crew-mode.md (and cli.md, governance.md in the same dir) since this head went green (ae1bb2d -> 09e4e0b); CI re-running.

@bolichen97
bolichen97 force-pushed the fix/crew-mode-approval-notify branch from 7944c6d to 8772291 Compare October 29, 2026 19:05
@bolichen97

bolichen97 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/system-specs/modules/crew-mode.md (and other docs/system-specs/modules files) since this head went green (09e4e0b -> ccc7230); CI re-running.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Backend Tests (Windows) (2) fails on three backend tests that also fail on main at d328624 (reproduced locally): tracked in #25937. This PR changes only frontend and docs files. Waiting for that fix; no push or override for this red.

@bolichen97
bolichen97 force-pushed the fix/crew-mode-approval-notify branch from bc71d32 to 27c24d3 Compare October 29, 2026 20:42
@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: native permission row unread mark for a crew member's live conductor

  • span=58ea1ca62ff7 Native approval unread marks still target the hidden crew member

fixed in 27c24d3: a pending native permission row of a crew member also marks its live conductor unread inside the existing attendArrival off-screen callback (reconnect guard kept), skipped while the conductor is on screen; routine crew-member rows still mark only the member. Pinned in crewMemberApprovalNotify.test.ts (red on the prior head).

@bolichen97

Copy link
Copy Markdown
Contributor Author

Frontend Tests (1) fails on kiroUsageRefetchInterval.test.ts, which this PR does not touch; it fails the same way on main at b5dc156 and is tracked in #25941. Waiting for that fix and #25937; no push or override for these reds.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 29, 2026
@bolichen97
bolichen97 force-pushed the fix/crew-mode-approval-notify branch from 27c24d3 to a761ad3 Compare October 29, 2026 21:36
@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: conductor read relay for a crew member's pending prompt

  • span=58ea1ca62ff7 Conductor read relays cannot clear the redirected approval badge

fixed in a761ad3: every window that receives a crew member's pending native permission row records its ts against the live conductor (noteUnsavedRowTs(crewRoot, ts)) before the on-screen check, so the conductor's read relay covers it and sibling windows clear the badge. Pinned by a test that is red without the fix.

@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: no

  • span=4909fb4f6619 Retained conductor selection suppresses approvals received on Settings

Rebutted: isSlotOnScreen ignoring the route predates this PR and is the predicate every unread path uses, plain-chat approvals included; this PR adds no new suppression.
On Settings the person still gets the chime, the bell note and the in-app banner (its gate is route-aware), so the wait is not hidden; only the row badge follows the shared rule. Adjudication downgraded it as disproportionate.
Making the shared predicate route-aware changes every caller and is a separate change, not this fix.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 29, 2026
@bolichen97

bolichen97 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Rebased: main now carries #25947 (closes #25937), so its three backend reds pass locally on the new base (7e09632). kiroUsageRefetchInterval.test.ts still fails on main and is tracked in #25941; no push or override for that red. CI re-running.

@bolichen97
bolichen97 force-pushed the fix/crew-mode-approval-notify branch 2 times, most recently from a41ab5c to fd39f29 Compare October 29, 2026 22:10
@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: hand-written conductor on-screen guard replaced by the shared arrival rule
resolution: narrowed -- removed the hand-written guard; both sites use attendArrival

  • span=58ea1ca62ff7 Visible conductor approvals do not relay their read state

fixed in fd39f29: third fix on this span, so the approach changed. The hand-written !isSlotOnScreen(crewRoot) guard is gone; the native permission row (chatStream.ts) and the approval frame (approvals.ts) both go through the existing attendArrival(conductor, ...), which badges off screen and relays a visible, focused arrival as read. Both sites pinned by tests red on the prior head.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 29, 2026
@bolichen97

bolichen97 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Rebased: main now carries #25944 (closes #25941), so kiroUsageRefetchInterval.test.ts passes locally on the new base (1fc4b3a). CI re-running.

@bolichen97
bolichen97 force-pushed the fix/crew-mode-approval-notify branch from fd39f29 to 001ca1e Compare October 29, 2026 23:29
@github-actions github-actions Bot added readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention labels Oct 29, 2026
@bolichen97
bolichen97 force-pushed the fix/crew-mode-approval-notify branch from 001ca1e to c87441d Compare October 29, 2026 23:49
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in website/src/test/ChatSidebar.conductorLane.test.tsx (#25888 added tests at the same place); both sets of tests kept, no code change (1fc4b3a -> e106845). 152 related test files pass locally; CI re-running.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: passed Eligible automated validation passed for the current revision and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Oct 30, 2026

@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 on behalf of the watch holder (bolichen). Design and First Principles pass on this head, UX skipped or pass, no conflict, no open change request.

@KiroCrewCaptain
KiroCrewCaptain merged commit 16e38f9 into main Oct 30, 2026
93 of 97 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the fix/crew-mode-approval-notify branch October 30, 2026 02:25
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 30, 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.

Crew member tool approvals give no signal while the Crew chat is not on screen

2 participants