Repository navigation
feat(sidebar): broadcast one message to many sessions - #20741
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that leaving the page during a send doesn't silently drop the rest: the browser sends four at a time, and leaving stops the sends still waiting. [DESIGN-REVIEWED] cacf3cf Description read[DESCRIPTION-READ] 8bc782c81727cd19a0aadb98f28088dfda2ff8e688912c47120e1d0af65d300e 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) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The Custom criteria section adds four narrowing filters (folder, tag, pinned, 24h) that the Goal ("picking them by state") never asks for. Not justified as shipped
What this change shipsInventory (10 items) — 8 justifiedIntent: let a user steer many sessions with one message instead of visiting each one. This is an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] cacf3cf Description read[DESCRIPTION-READ] f8840cfa9b4d8eaa6a5c972de72c7c5b947b94d35b0abe531267b739345916a5 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS The failed-send path sends people in two directions: the notice says to press send again, the button says "Retry N failed", and it retries sessions that are already closed. Watch
Suggestions
[UX-REVIEWED] cacf3cf Description read[DESCRIPTION-READ] 94c3587829d1b689f1294c5fedadfcfab68262cf492cbbadc724dc60de563d8c That sha256 names everything this verdict read: the PR description, plus the 13 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 Review detailsNot blocking: one advisory finding on the Send button's label. FINDING — website/src/pages/chat-sidebar/BroadcastPanel.tsx:418 — once any shown row has a result, the button reads [OPUS-REVIEWED] cacf3cf 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: |
e8b267d to
1180ce2
Compare
|
|
|
|
|
|
|
|
|
|
|
UX Review on |
1180ce2 to
a792e22
Compare
|
|
|
|
|
|
|
|
|
df0dc78 to
d0511ac
Compare
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray]: Rebased onto main c6d6106, which carries #20930 (the lazy-import count fix behind the inherited Backend Tests (3.12, 6) / Windows (6) / Coverage Gate reds). df0dc78 -> d0511ac; range-diff shows no change to this PR's own lines. tsc, eslint, i18n:check, feature-map check and 57 related test files pass. CI re-running. |
d0511ac to
cacf3cf
Compare
|
Problem / Motivation
Goal: Let a user send one message to many open sessions at once, picking them by state, with crewmate chats left out by default.
With many sessions open there is no way to tell them all something. When CI goes down for half an hour, every babysit loop should pause, and today that means opening each session and typing the same line again.
Why it matters
People running many loops and long tasks need one place to steer them together. Without it, a shared instruction costs one visit per session, and a session that gets missed keeps working on stale assumptions.
Not a goal
session_broadcasttool.What changed (motivation → approach → change)
The Sessions list menu (⋮) gets Broadcast message…, beside Switch all to model…, and opens a panel in the same slot those panels use.
The panel picks recipients with quick picks that show live counts: in a loop, in progress, approval or reply, all. The panel opens on the first of them that reaches anyone, so it never opens on an empty list. A three-way control sets crewmate chats to only, include or exclude, defaulting to exclude. A folded Custom criteria section lists the states as toggle chips, matched as any-of, and narrows by folder with its sub-folders, tag, pinned, or activity in the last 24 hours. A session that cannot take a message is never matched or counted: a peer crew's row, and a relay archive, which the server refuses with
relay_archive_read_only. Any matched session can be unticked, and a tick keeps meaning "in this broadcast" after a send; under a Session / How it lands header (Session / Result once the list has been sent to), each row names its folder (or, without one, its last activity) on a second line under its title and says how the message will land: joining the running turn, joining after the user answers the approval or question that turn waits on, waiting behind live sub-agents or queued messages, or starting a new turn; a line above the list says no running work is interrupted.Every message goes through the existing
/api/chatsend. A session's own running turn gets it as a steer, taken in after the current tool call. Any other session gets a plain send, so the server's hold behind live sub-agents and parked queue messages still applies. Only an explicit refusal can be retried; a late, unreadable or dropped-connection receipt may already have delivered, so that session is never resent. A refused session moves to the top of the list with the server's reason inline under it; an unconfirmed one follows it, and its label opens that session. After a send the button reads "Retry N failed". The right column takes at most 45% of a row and wraps, so a narrow pane keeps titles readable. The panel itself scrolls inside the sidebar, so Send stays reachable on a phone. Cancel and the text box are locked while a batch is sending. After a send, the count line becomes the outcome tally (sent, failed, unconfirmed) of the rows still listed. When nothing is left failed or unknown, the panel stays open on a confirmation ("Sent to N sessions") and Cancel becomes Close.Matching lives in a pure helper,
lib/broadcastTargets.ts, which uses the existingcollectFolderSubtreeIdsfor folder narrowing. Its turn states are the board lanes frominferLane(needs approval, waiting, working, idle), fed bylaneExtrasFor, lifted out of the board's column matcher so both read the same live signals; the state labels reuse the lane labels. Crewmate chats are recognised with the existingisCrewmateChat;SlotandAgentInfogain theagent_kindandselection_kindfields already on the wire. Strings are added to all twelve catalogs underwebsite/src/i18n/locales/(en-XA.jsonregenerated).Backwards compatibility
Compatible: a new menu item and panel; no existing route, setting or behaviour changes.
Removes nothing: the diff only adds a menu item, a panel, a helper and catalog keys.
Tests
website/src/lib/broadcastTargets.test.ts(24): every row's state equals itsinferLanelane, an approval-blocked turn is needs-approval not working, loop as a mode on top of the lane, sub-agent approvals and workflows classed as the board classes them, relay archives never matched, each delivery label (steer, after the answer, after current work, new), steer sent only into a session's own running turn, each quick pick, the three crewmate modes, custom criteria (no state matches nothing, sub-folders included, tag/pin/24h), peer rows never targeted, a kind-less crewmate recognised through the caller's test, and steer-vs-new labelling.website/src/pages/chat-sidebar/BroadcastPanel.test.tsx(27): the panel shrinking and scrolling inside the sidebar, the retry label after a refusal, the capped right column, the no-interruption line shown only before a send, opening on the first non-empty pick, the tally counting only rows still listed after the pick changes, the right column header switching to Result, an unconfirmed row moving up and opening its session, defaults (loop pick, crewmates excluded, a kind-less crewmate excluded), row labels, the include toggle, Send disabled on blank text, the trimmed text steered only to ticked rows, a refusal keeping the panel open with its reason on hover while a dropped-connection row is not resent and only the refused row is retried, Cancel and the text locked while sending, edited text reaching every matched row again, a refused row moving to the top, the confirmation counting every row reached across a retry, a custom state switching the pick to Custom, every quick pick re-seeding the state chips, a workflow session labelled as joining its turn, unconfirmed rows still named after a retry, the tally replacing the match count after a send, an idle session sent without the steer flag, an approval-parked turn labelled as joining after the answer, folder or last activity on same-named rows, and delivered rows staying ticked and locked.laneExtrasFor, judging only the last press for the summary, matching relay archives, always steering, dropping the after-answer label, the tally, the last-activity text, unticking delivered rows, a fixed default pick, a tally over every result, a fixed column header, dropping the open link and dropping the unconfirmed-row order each turn one named test red.website/src/store/switchSlotCallsiteClassification.test.ts: the newswitchSlotsite inChatSidebar.tsx(opening an unconfirmed row) is classified as announced, like a row's own click.website/src/test/ChatSidebar.chevronGrammar.test.ts: the disclosure count goes from 7 to 8 for the custom-criteria toggle, which usesDisclosureChevron.--sequence.shuffleand seeds 1 to 10. No timers, sleeps or clock reads in either.Ran locally: every step of CI's Frontend Lint & Type Check job (
tsc -p tsconfig.app.json,eslint src/ --max-warnings 0,jscpd, the ui-index freshness check, the phantom-class and restyle ratchets),npm run i18n:checkand the related vitest set withI18N_BASE_REF=origin/main(so the per-language style checks run as in CI),npm run lint:i18n, the 1486 sidebar/board/lane/i18n-related vitest files (32462 tests),npm run build,scripts/check_feature_map.pyandscripts/docs-lint.sh. Not run locally: semgrep (not installed on this host).Manual verification
In a pod built from this branch: opened the menu, filled the message, expanded Custom criteria and picked All, on desktop (1300px) and mobile (390px), dark theme, zh-CN. Shot the matched list, custom criteria, sending, a send with one refusal and one dropped connection, and the retry. The send outcomes came from Playwright request routing, so no session in the pod actually received the message. An earlier pass showed the crewmate control overflowing the panel and the selects in a larger font; both are fixed.
Screenshots / video
In a pod, dark theme, zh-CN, current build. The pod has no agent backend, so no session there can be running, parked on an approval or holding sub-agents: every row shows the idle label. The other three labels are covered by unit tests. Send outcomes came from Playwright request routing.
Earlier shots: custom criteria, sending, menu entry
Related Issues
Closes #20706
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)