Repository navigation
perf(web): drop the dashboard sub-agent maps nothing reads - #23791
Conversation
6c9a3d1 to
e07ae3d
Compare
|
note: rebased on main with no behaviour change. The earlier head's Fast Gate run was cancelled, so its downstream checks never ran; this head restarts them. |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the three maps are only written, never read, and removing them along with their writers changes nothing on screen or in any server contract. [DESIGN-REVIEWED] 8eaddb4 Description read[DESCRIPTION-READ] 401a782c94dc6a219134d40ad74fa4dc00ba974f533f998185471d4632e2e7d6 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, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The three removed maps have zero non-test readers on base, and every deleted test only pinned the state or reducers this change removes. What this change shipsInventory (5 items) — 5 justifiedIntent: stop the web app doing store work for sub-agent state that nothing on screen ever shows. This is a FIX (perf).
[FIRST-PRINCIPLES-REVIEWED] 8eaddb4 Description read[DESCRIPTION-READ] a117f21815624e0a2e35cb730f0b338685fb0db6765c4bf5c820fe8698e8f9f6 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5, fork) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing to check. The PR removes store state that nothing on screen reads, and it adds or changes no user-visible control, string or state. Outside the test fixtures, the only references left in [UX-REVIEWED] 8eaddb4 Description read[DESCRIPTION-READ] 5d7abea80d567ea0c97565d1edef94f54c4be4b424bc74a3308c827b7109da07 That sha256 names everything this verdict read: the PR description, plus the 3 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 (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
|
HOLD at e07ae3d. The removal itself looks sound: at this head nothing outside tests reads One AI finding has no reply: the First Principles Review Note (item 5) points out that the diff deletes the rationale docblock above the kept To clear: restore that docblock (the smallest fix), or reply to the note on this PR explaining why it should go. — crew-pr-reviewer (r126) |
|
issue: the First Principles note (item 5) is upheld. The diff deleted the docblock above the kept
|
dashboard.subagentRunning, subagentDetails and subagentText had no reader: every sub-agent surface reads the chat slice's per-agent state. Their writers (sseSubagentStatus, sseSubagentText, the reconnect reset and the per-slot eviction) go with them, and the subagent_status and subagent_text frames stop dispatching a store action.
e07ae3d to
8eaddb4
Compare
|
issue: the First Principles note (item 5) is fixed in 8eaddb4. The |
iamwhatever
left a comment
There was a problem hiding this comment.
APPROVE at 8eaddb4.
The three dashboard maps (subagentRunning, subagentDetails, subagentText) have no reader at this head: outside cast test and capture fixtures, git grep finds no reference, and every sub-agent surface reads the chat slice. Removing the subagent_status/subagent_text cases in useWebSocket.ts leaves those frames dispatching nothing, and the app SDK topic list still carries subagent_status for apps. The earlier HOLD (the deleted patchSlotLink docblock) is fixed: against main the diff no longer touches those lines. All five AI lanes pass with no findings, all checks including PR Readiness are green, and the branch is mergeable on main.
— crew-pr-reviewer (r127)
Problem / Motivation
Goal: The web app stops storing three per-session sub-agent maps that nothing on screen reads.
state.dashboard.subagentRunning,subagentDetailsandsubagentTextare written by thesubagent_statusandsubagent_textframes, emptied on every connect and pruned on every authoritative slot list. No component, selector or hook reads them: the sidebar, the progress bar, the rail and the side panel all read the chat slice's per-agent state (state.chat.subagentsandslotActivity[*].subagents), and two comments in those components say so. The gateway no longer emitssubagent_textat all.Why it matters
Each write is a store dispatch that notifies every subscriber, and each
sseSubagentStatuscopies and sanitizes the wholeagentsarray. The maps also add a key loop to every slot-list reconcile and three wholesale replacements to every connect. None of that work reaches the screen.Not a goal
subagent_statusframe itself. The gateway still sends it, and apps that subscribe to it still receive it.What changed (motivation → approach → change)
The fields have no reader, so the change removes them with their writers instead of making the writers cheaper.
website/src/store/dashboardSlice.tsdrops the three fields, their initial values, theSubagentDetailtype, thesseSubagentStatusandsseSubagentTextreducers, the reset insseConnectedand the per-slot eviction inreconcileSlots.website/src/hooks/useWebSocket.tsno longer handlessubagent_statusorsubagent_text, so those frames dispatch nothing.dashboardSlice.subagentRunningand the frontend conventions doc's mention ofsseSubagentStatusare updated.Backwards compatibility
Compatible: the fields were client-only store state with no reader, and no server contract changes.
Reader: website/src/pages/chat-sidebar/filters.tsx:subagentCounts -- chat -- reads
selectSidebarSubagentCountsover the chat slice, not the removed map; only its comment changedReader: website/src/pages/chat/SubagentProgressBar.tsx:SubagentProgressBar -- chat -- reads
state.chat.subagentsandslotActivity; only its comment changedgit grep -nE "subagentRunning|subagentDetails|subagentText|sseSubagentStatus|sseSubagentText|SubagentDetail"on origin/main finds no other non-test reader inwebsite/,src/kiro_crew/apps/builtinsor the app SDK.Tests
website/src/test/useWebSocket.frameTrace.test.ts: thesubagent_statusandsubagent_textframes now trace no action.website/src/test/dashboardSlice.test.ts,dashboardSlice.slotPatch.test.ts,dashboardSlice.closeTombstone.test.tsandUseWebSocketCoverage.activity.test.tsx: the cases that only asserted the removed maps or their reducers are removed. The unread-teardown cases that shared a fixture with them keep their unread assertions.website/src/test/App.rootSelectorScope.test.tsx: the case that dispatchedsseSubagentStatusis removed. The channel-trust case still pins that a dashboard write the root does not read leaves the root alone.tsc -p tsconfig.app.jsonand eslint on the changed files are clean.Manual verification
N/A -- unit coverage sufficient: the removed state had no reader, so nothing on screen can change.
Screenshots / video
Why no screenshot: the removed fields were never rendered.
Related Issues
Fixes #23790
Pattern harvest
Not generalizable: these three maps outlived the surfaces that once read them; there is no lint that can tell an unread store field from one read through a dynamic key.
Checklist