Skip to content

fix(dashboard): read a crewmate's quiet chat at a bounded page - #22609

Closed
JLargent42 wants to merge 2 commits into
kirodotdev:mainfrom
JLargent42:fix/crewmate-quiet-bounded-read
Closed

JLargent42 wants to merge 2 commits into
kirodotdev:mainfrom
JLargent42:fix/crewmate-quiet-bounded-read

Conversation

@JLargent42

@JLargent42 JLargent42 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Opening a crewmate's chat with a long, mostly-patrol history no longer reads the whole transcript and stalls the dashboard.

A crewmate's DM draws only what the crewmate says. When its newest 50 rows are all machinery, the pane re-reads the slot with no limit to decide whether to show the never-spoken hint. On a patroller with thousands of rows that is the entire chained transcript: the gateway reads, redacts and serializes all of it while other requests and WebSocket frames wait, and the browser then decodes it. Users see the dashboard go blank and chats fail to load on refresh until a restart.

Why it matters

Crewmates that patrol are exactly the sessions with the longest histories, and opening their DM is a routine action. One open can freeze the whole dashboard, not just that pane.

Not a goal

What changed (motivation → approach → change)

Symptom: a blank, unresponsive dashboard on opening a long-history crewmate DM. Cause: the never-spoken proof in website/src/components/ChatPane.tsx upgraded its read to the unbounded slot-detail shape. Change: the upgrade now asks once for the handler's largest bounded page (SLOT_DETAIL_MAX_LIMIT, 500 rows). A widened page that reaches the transcript's start still proves the whole-history hint. One that does not shows a scoped hint instead (new key crewmate_quiet_recent, "In its latest N activity updates, {{name}} hasn't said anything to you.", in website/src/i18n/locales/en.manual.json, the eleven translated catalogs and the regenerated en-XA.json pseudolocale), with the same Work-log link, above the pane's existing earlier-rows bar, so the pane is never blank. hydrateSlotMessages (website/src/store/chat/messages.ts) only let an unbounded page supersede a bounded one, so it now also accepts a strictly wider bounded page and re-records its length and cursor; equal or narrower pages are still refused, and an unbounded page still cannot be superseded. The hint's comment in website/src/components/ChatPaneTranscript.tsx now records both claims, and ChatPane passes the checked row count down as crewmateQuietWindow.

Backwards compatibility

Compatible: no wire field, endpoint or stored shape changes; the pane only asks for a bounded page where it asked for an unbounded one.

Removes nothing: the whole-history hint, the earlier-rows bar and the unbounded supersede path all remain; a crewmate with no speech in its newest 500 rows gets the scoped hint instead of a whole-transcript read.

Tests

  • ChatPane.crewmate.test.tsx: the widened read is SLOT_DETAIL_MAX_LIMIT and never unbounded; speech behind the first page is drawn; the hint shows when the widened page reaches the start; a widened page that still has more lands bounded, keeps has_more, shows the scoped hint with the checked row count (not the whole-history wording) and never reads unbounded.
  • ChatPane.hydrateBound.test.tsx: a strictly wider bounded page supersedes a bounded one (live tail kept, length and cursor re-recorded); equal and narrower pages are refused.
  • Proof: with the two production hunks reverted, all four new or changed tests fail; with them, they pass. Determinism: the two files run 3x with --sequence.shuffle, 40/40 each time.

Manual verification

  • npx tsc -p tsconfig.app.json clean; eslint clean on the changed files.
  • npx vitest run src/store src/components/chat src/pages/members src/test/ChatPane src/test/chatSlice src/test/Members: 169 files, 3087 tests pass. npx vitest run ChatPane messages ChatPaneTranscript ChatPage: 177 files, 2162 tests pass.
  • scripts/local-gate.py: the frontend related set passes. The backend cross-surface set showed 61 failures and 15 errors, all environmental on this host (enterprise platform profile, sensitive-path 403s for a checkout under ~/.kiro, user-namespace unshare EPERM); this diff touches no Python.

Screenshots / video

Real ChatPane mounted as a crewmate DM over a mocked slot-detail endpoint (website/capture/crewmate-quiet-recent.tsx, shot by website/capture/shoot-crewmate-quiet-recent.mjs).

Widened page still has older rows: scoped hint above the earlier-rows bar.

dark, scoped hint

light, scoped hint

Widened page reaches the start: the whole-history hint, unchanged.

dark, whole-history hint

Related Issues

Closes #22608

Pattern harvest

Rule candidate: lint
Pattern: a dashboard read of api.chatSlotDetail with no limit (the whole-transcript shape) outside an explicitly allowlisted caller.

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

@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: checking Automated validation is still running labels Oct 20, 2026
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of 5fab70359f8d1ed42b39d59f9e16074295c5a427 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Check that one 500-row page (SLOT_DETAIL_MAX_LIMIT), read and redacted from a long chained patrol transcript, no longer stalls the gateway when the DM opens.

[DESIGN-REVIEWED] 5fab703

Description read

[DESCRIPTION-READ] 7215ff85aa1d078d7788ed7a2064f0822ddef2caeca5f5258c9cfe56afd63ac9

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

Copy link
Copy Markdown
Contributor

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

Premise-level review of 5fab70359f8d1ed42b39d59f9e16074295c5a427 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/CONCERNS are advisory.

First-Principles-Verdict: PASS

Check that a crewmate whose last words are more than 500 rows back should show the scoped hint instead of those words; that is the trade this fix makes.

What this change ships

Inventory (5 items) — 5 justified

Intent: let a user open a long-history crewmate's chat without the dashboard stalling while it reads the whole transcript. This is a FIX (#22608).

  1. When a quiet crewmate chat is opened, it reads at most 500 rows and never the whole transcript. — justified
  2. When those 500 rows still hold no speech and older rows remain, a new hint says "hasn't said anything to you in its latest N entries" above the earlier-rows bar. Without it the pane would be blank. — justified
  3. The pane's stored page now accepts a strictly wider bounded page, which item 1 needs to land at all. Equal and narrower pages are still refused. — justified
  4. The new hint string is added to all 12 locale catalogs and the pseudolocale. — justified
  5. A capture harness and screenshots under website/capture/ and temp-screenshots/ follow the existing convention in .gitignore:116-125. — justified

[FIRST-PRINCIPLES-REVIEWED] 5fab703

Description read

[DESCRIPTION-READ] b81b9c388ffa0a398e958c61149c2f8b6619d24c1d170bf5e9e0b033b1b78960

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

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — 🟡 CONCERNS

UX-level review of 5fab70359f8d1ed42b39d59f9e16074295c5a427 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: CONCERNS

"In its latest 498 entries" counts rows the user never sees, so "entries" is unexplained jargon; no blind reader has seen the new hint.

Watch

  • "entries" is never defined. The new string "{{name}} hasn't said anything to you in its latest {{rows}} entries." counts patrol rows the pane filters out. Attachments 01 and 02 show "498 entries" above an empty pane, so nothing on screen is an "entry". A user can't tell what was checked, or whether "Load earlier messages" will turn up speech. This appears on every open of a long-patrol crewmate DM. Fix: name the thing, e.g. "activity updates".
  • The copy contradicts the PR description. The description promises "In its latest N activity updates, {{name}} hasn't said anything to you." The diff ships different wording in en and all eleven catalogs. Fix: pick one and make the description match the diff.
  • The odd count adds noise. "498" comes from the 500-row page limit. The exact number doesn't help the user decide anything, but next to the "Load earlier messages" bar it does carry the cue "older history exists". Keep the count, but word the hint so it points to that bar.

Suggestions

  • Change crewmate_quiet_recent to "Nothing from {{name}} in its latest {{rows}} activity updates. Load earlier messages to check further back." This front-loads the point and names the next step.

[UX-REVIEWED] 5fab703

Description read

[DESCRIPTION-READ] a1d38c2e46765e19ea29b3d7d0f5b36f0cbfb64c8fcc9cc48259ce0c960fc378

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 5fab703

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

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

Review details

No findings.
[GPT-REVIEWED] 5fab703

@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 21, 2026
@JLargent42
JLargent42 force-pushed the fix/crewmate-quiet-bounded-read branch from 227b481 to 51570ce Compare October 21, 2026 00:01
@JLargent42

Copy link
Copy Markdown
Contributor Author

target=ux head=51570ce1518c disposition=fixed

Watch "empty pane gives no explanation": fixed in 51570ce. When the widened 500-row page still has older rows, the pane now shows a scoped hint ("Radar hasn't said anything to you in its latest N entries.") with the Work-log link, above the earlier-rows bar; the whole-history wording is kept for a page that reaches the start.
Evidence gap: screenshots of both states (dark/light scoped, dark whole-history) are in the description, captured from the real ChatPane; the no-visual-delta marker is removed.
Suggestion (muted line + link): adopted as above, new i18n key crewmate_quiet_recent in every catalog.

@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 21, 2026
Addresses the GPT 6.1 Review blocking finding: the waitFor at
ChatPane.crewmate.test.tsx waits on a four-step chain (initial bounded
query -> hydration -> widened query -> second hydrate), which can exceed
the default waitFor deadline on a slow runner. Pass { timeout: 5000 } and
name the chain in a comment, per frontend-tests-are-deterministic.
@JLargent42

Copy link
Copy Markdown
Contributor Author

target=gpt head=79e343a9b1b9 disposition=fixed

  • waitFor behind a chained query (ChatPane.crewmate.test.tsx)

Fixed in 79e343a9b1b9: every wait behind the first-page -> widened-page hydration chain now passes { timeout: 5000 } and carries a comment naming the chain. The two files pass 3x under --sequence.shuffle.

@JLargent42

Copy link
Copy Markdown
Contributor Author

target=ux head=79e343a9b1b9

  • "entries" is an unexplained unit (fixed)

Fixed in 79e343a9b1b9 with the suggested scope-first wording: "In its latest {{rows}} activity updates, {{name}} hasn't said anything to you.", in every catalog; screenshots re-shot.

  • Paging further is not shown (rebutted)

No new mechanism here: after Load earlier, rows grows with what the pane holds, and once the pane's read reaches the start (has_more false) crewmateQuietUnproven goes false and the existing whole-history hint draws. Both end states are pictured; the paging bar itself is unchanged.

@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 21, 2026
@JLargent42
JLargent42 marked this pull request as ready for review October 21, 2026 16:35
@JLargent42
JLargent42 requested review from a team and KiroCrewCaptain as code owners October 21, 2026 16:35
@JLargent42
JLargent42 requested a review from bolichen97 October 21, 2026 16:35
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 21, 2026

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

Looks close. One copy fix remains before this can be approved.

Head reviewed: 5fab703. Readiness is passed. Design, First Principles, Opus and GPT lanes are clean on this head. The UX lane is CONCERNS on this head.

What I checked:

  • The core fix is sound. The never-spoken proof now widens once to the handler's 500-row cap (SLOT_DETAIL_MAX_LIMIT, the same cap the backend clamps to) instead of an unbounded read. The latch still fires once, so this cannot loop.
  • The hydrate change in messages.ts accepts only a strictly wider bounded page, re-records its length and cursor, and still refuses equal or narrower pages. The new reducer test covers the live tail, the cursor and both refusals.
  • The new crewmate test asserts that no call is unbounded, so it goes red if the old read returns.

Remaining item (should fix):

  • The new hint still ships the "entries" wording in en.manual.json, en-XA.json and all eleven translated catalogs. The PR description and the UX disposition reply both say the copy is "In its latest {{rows}} activity updates, {{name}} hasn't said anything to you." The commit that reply names is not on this branch: the branch has only 51570ce and 5fab703. Please push the reworded strings (and update the test assertion and screenshots), or change the description to match the diff. Approval waits on the description and the diff agreeing.

"chatPane": {
"crewmate_quiet": "{{name}} hasn't said anything to you yet.",
"crewmate_quiet_where": "See the sessions it is driving.",
"crewmate_quiet_recent": "{{name}} hasn't said anything to you in its latest {{rows}} entries.",

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.

🟡 This string still says "entries", but the description and the UX reply say it was changed to "activity updates".

The hint counts filtered patrol rows that the pane does not draw, so "entries" points at nothing on screen. The UX lane raised this on the current head. The reply says it is fixed, but the fix is not on this branch.

"crewmate_quiet_recent": "{{name}} hasn't said anything to you in its latest {{rows}} entries.",

Why it matters: the description no longer matches the diff, and users see an unexplained unit on every open of a long patrol DM.

Suggestion: use the wording the description promises, in this file, en-XA.json and the eleven catalogs. Update the assertion in ChatPane.crewmate.test.tsx and re-shoot the screenshots. If you prefer "entries", change the description instead and answer the UX point.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 21, 2026
@JLargent42

Copy link
Copy Markdown
Contributor Author

Closing as superseded. The issue this PR fixes (#22608) was resolved by maintainer-merged PR #22864 ("page a crewmate's quiet chat back instead of reading it whole", merge commit 46f66d8, merged 2026-10-21 21:09Z), which closed #22608 as COMPLETED.

This PR's approach (one-shot widen to SLOT_DETAIL_MAX_LIMIT) and #22864's merged approach (bounded auto-paging walk via CREWMATE_AUTO_WALK_MAX_PAGES) are mutually-exclusive implementations of the same fix — they redefine the same symbols in ChatPane.tsx / ChatPaneTranscript.tsx, so they cannot be merged additively. Rebasing this branch would revert a merged maintainer design and reopen a resolved issue. Closing rather than driving a competing fix onto an already-fixed issue.

@JLargent42 JLargent42 closed this Oct 21, 2026
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 21, 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) merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crewmate chat with a long patrol history reads the whole transcript on open and stalls the dashboard

2 participants