Skip to content

perf(web): drop the dashboard sub-agent maps nothing reads - #23791

Merged
iamwhatever merged 1 commit into
kirodotdev:mainfrom
Pearcekieser:perf/push-hygiene-subagent-fields
Oct 26, 2026
Merged

iamwhatever merged 1 commit into
kirodotdev:mainfrom
Pearcekieser:perf/push-hygiene-subagent-fields

Conversation

@Pearcekieser

@Pearcekieser Pearcekieser commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: The web app stops storing three per-session sub-agent maps that nothing on screen reads.

state.dashboard.subagentRunning, subagentDetails and subagentText are written by the subagent_status and subagent_text frames, 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.subagents and slotActivity[*].subagents), and two comments in those components say so. The gateway no longer emits subagent_text at all.

Why it matters

Each write is a store dispatch that notifies every subscriber, and each sseSubagentStatus copies and sanitizes the whole agents array. 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

  • Changing the subagent_status frame itself. The gateway still sends it, and apps that subscribe to it still receive it.
  • Changing the chat slice's sub-agent state or any sub-agent surface.
  • Stripping the three empty fields from the roughly 245 test fixtures that spell out a full dashboard state. They are cast fixtures, so the extra keys compile and are ignored.

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.ts drops the three fields, their initial values, the SubagentDetail type, the sseSubagentStatus and sseSubagentText reducers, the reset in sseConnected and the per-slot eviction in reconcileSlots.
  • website/src/hooks/useWebSocket.ts no longer handles subagent_status or subagent_text, so those frames dispatch nothing.
  • Two component comments that pointed at dashboardSlice.subagentRunning and the frontend conventions doc's mention of sseSubagentStatus are 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 selectSidebarSubagentCounts over the chat slice, not the removed map; only its comment changed
Reader: website/src/pages/chat/SubagentProgressBar.tsx:SubagentProgressBar -- chat -- reads state.chat.subagents and slotActivity; only its comment changed

git grep -nE "subagentRunning|subagentDetails|subagentText|sseSubagentStatus|sseSubagentText|SubagentDetail" on origin/main finds no other non-test reader in website/, src/kiro_crew/apps/builtins or the app SDK.

Tests

  • website/src/test/useWebSocket.frameTrace.test.ts: the subagent_status and subagent_text frames now trace no action.
  • website/src/test/dashboardSlice.test.ts, dashboardSlice.slotPatch.test.ts, dashboardSlice.closeTombstone.test.ts and UseWebSocketCoverage.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 dispatched sseSubagentStatus is removed. The channel-trust case still pins that a dashboard write the root does not read leaves the root alone.
  • Proof: not provable -- test-only change for the behaviour removed; no new behaviour is added.
  • The six changed test files pass (261 tests). tsc -p tsconfig.app.json and 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

  • At most two commits (one is the norm), with a Conventional Commits title
  • 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

@Pearcekieser
Pearcekieser requested review from a team and KiroCrewCaptain as code owners October 24, 2026 17:02
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 24, 2026
@Pearcekieser
Pearcekieser force-pushed the perf/push-hygiene-subagent-fields branch from 6c9a3d1 to e07ae3d Compare October 25, 2026 12:16
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

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.

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of 8eaddb41def90cbf58a1d03af63f6f7c07610ad3 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 .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 25, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of 8eaddb41def90cbf58a1d03af63f6f7c07610ad3 via the fork AI-review pipeline — 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 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 ships

Inventory (5 items) — 5 justified

Intent: stop the web app doing store work for sub-agent state that nothing on screen ever shows. This is a FIX (perf).

  1. subagent_status and subagent_text frames no longer dispatch a store action — justified
  2. subagentRunning, subagentDetails and subagentText are no longer kept in dashboard state, and connect no longer resets them — justified
  3. A slot-list reconcile no longer evicts per-slot sub-agent entries — justified
  4. SubagentDetail type and the sseSubagentStatus/sseSubagentText exports are gone — justified
  5. Two component comments and the frontend-conventions "known gap" paragraph are corrected — justified

[FIRST-PRINCIPLES-REVIEWED] 8eaddb4

Description read

[DESCRIPTION-READ] a117f21815624e0a2e35cb730f0b338685fb0db6765c4bf5c820fe8698e8f9f6

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 25, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ✅ PASS

UX-level review of 8eaddb41def90cbf58a1d03af63f6f7c07610ad3 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 website/src are the two comments this PR edits.

[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 .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 25, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed 8eaddb41def90cbf58a1d03af63f6f7c07610ad3 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 8eaddb4

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed 8eaddb41def90cbf58a1d03af63f6f7c07610ad3 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 8eaddb4

@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 Oct 25, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at e07ae3d.

The removal itself looks sound: at this head nothing outside tests reads subagentRunning, subagentDetails, subagentText or their reducers, the leftover fixture keys are cast, and app subscribers still receive subagent_status. All AI lanes pass and CI is green.

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 patchSlotLink disambiguates two rows on one channel suite (base lines 884-890). That comment explains a real bug (a mirror row on the same channel patching the origin row) and has nothing to do with the sub-agent maps.

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)

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

issue: the First Principles note (item 5) is upheld. The diff deleted the docblock above the kept patchSlotLink disambiguates two rows on one channel suite, which documents the mirror-versus-origin row bug and has nothing to do with the sub-agent maps.

Restored verbatim in 49dfe2e6be. Against main the diff no longer touches those lines, and dashboardSlice.test.ts passes (72 tests).
It goes up when this PR's turn for a CI slot comes; the fleet runs one CI per worker and #23797's CI is running now.

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.
@Pearcekieser
Pearcekieser force-pushed the perf/push-hygiene-subagent-fields branch from e07ae3d to 8eaddb4 Compare October 26, 2026 11:59
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

issue: the First Principles note (item 5) is fixed in 8eaddb4. The patchSlotLink disambiguates two rows on one channel docblock is restored verbatim, so against main the diff no longer touches those lines. The head is also rebased on main with no other behaviour change; the six changed test files pass (266 tests).

@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: passed Eligible automated validation passed for the current revision readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 26, 2026
@github-actions github-actions Bot added the readiness: passed Eligible automated validation passed for the current revision label Oct 26, 2026

@iamwhatever iamwhatever 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.

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)

@iamwhatever
iamwhatever merged commit 767556a into kirodotdev:main Oct 26, 2026
104 checks passed
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf(web): three dashboard sub-agent maps are written on every frame and never read

2 participants