Skip to content

fix(palette): say compacting on a recent session while its chat compacts - #36316

Merged
KiroCrewCaptain merged 2 commits into
mainfrom
fix/35592-palette-compacting
Nov 14, 2026
Merged

KiroCrewCaptain merged 2 commits into
mainfrom
fix/35592-palette-compacting

Conversation

@JLargent42

@JLargent42 JLargent42 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: The command palette's recent-session row says "Compacting…" for a session while its chat compacts, the same word the chat footer uses.

While a chat compacts (a manual /compact, or an automatic compaction inside a turn), the palette's Current group still labels that running session "Thinking…" (or its last tool step), while the chat footer says "Compacting…".

Why it matters

A user switching sessions from the palette reads the wrong activity for a session that is compacting, and the palette disagrees with the footer, the sessions sidebar row and the crew member pills, which all already say "Compacting…".

Not a goal

What changed (motivation → approach → change)

Symptom: palette says "Thinking…" while the chat compacts. Root cause: sessionStatus in website/src/components/commandPalette/providers/recentsProvider.ts built its running label from the slot's status detail only, which keeps the pre-compaction thinking phase; it never read the slot's run state. Change: useRecentsProvider reads each live slot's run state through selectSlotStreamState (the selector the sidebar row uses since #35685), as a joined key string so the selection compares by value, and sessionStatus takes a compacting flag that, while set, labels the running dot with pages.chat.chatFooter.compacting, the footer's catalog key. Because the palette re-runs search() only when its live fingerprint changes (website/src/components/CommandPalette.tsx), and a compaction moves only the run state, the fingerprint also carries the keys of compacting slots, read through the same selector, so an already-open palette updates when a compaction starts or ends.

Backwards compatibility

Compatible: sessionStatus gains a trailing optional parameter defaulting to false; every existing call keeps its behaviour.

Removes nothing: the diff only adds a label branch for a run state the row ignored before.

Tests

  • recentsProvider.test.ts › "says Compacting… for a compacting slot, active or not, as the chat footer does": an active slot whose slotState is compacting and a background slot whose slotRun entry is compacting both label "Compacting…" even though their status detail is a thinking phase; a streaming slot still says "Thinking…".
  • CommandPalette.test.tsx › "refreshes recents when a running slot starts compacting under an unchanged status detail": with the status detail fixed, moving the slot's run state to compacting re-runs the recents search.

Proof: not provable -- frontend test (prove.py runs Python only). Verified by hand: with recentsProvider.ts reverted to origin/main its new test fails (1 failed, 38 passed); with CommandPalette.tsx reverted its new test fails (1 failed, 68 passed); with the fix all pass.

Manual verification

N/A — unit coverage sufficient: the change is one label branch in a pure function plus a store read and a query-key term, each covered by a test above.

Screenshots / video

The legacy command palette on this head while one chat compacts: its running row says "Compacting…", and the other running row still says "Thinking…".

Command palette: Compacting… row above a Thinking… row

The same moment before the palette opens: the chat says "Compacting…", and so does its sidebar row.

Chat and sidebar both reading Compacting…

Captured with scripted Playwright against the built SPA on a loopback static server with the dashboard API stubbed; the compaction arrives as the gateway's chat_message frame with role compacting on the mocked socket.

Related Issues

Closes #35592

Sibling sweep

Swept: git grep -n -e "toolStatusLabel(" -e "sessionStatus(" -- website/src
Sibling: website/src/apps/command-bar/CommandBarOverlayRootRows.tsx -- tracked in #37300
Sibling: website/src/pages/chat-sidebar/SessionRow.tsx -- not affected -- already reads compacting since #35685
Sibling: website/src/pages/members/useSlotActivity.ts -- not affected -- resolvePillActivity ranks the compacting run state first
Sibling: website/src/components/commandPalette/providers/recentsProvider.ts -- changed here

Pattern harvest

Not generalizable: each running-status surface composes its label from run state plus detail; the one other sessionStatus caller that still reads the detail alone, the Command Bar's Recent row, is tracked in #37300.

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

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license.

@JLargent42
JLargent42 requested review from a team and KiroCrewCaptain as code owners November 13, 2026 02:24
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 13, 2026
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: the palette row now reads compaction from the same run-state selector the sidebar row uses, and the palette's refresh key carries that state too.

Notes

  • The list of compacting slots is built twice, in CommandPalette.tsx (joined with ,) and in recentsProvider.ts (joined with \n). They do the same job with different separators. One shared selector would stop them drifting apart.

[DESIGN-REVIEWED] ae34fa6

Description read

[DESCRIPTION-READ] 6686aed7e9c7b04d66facbef8658a0f03a6e92c587ef8cc940c6863587066d2d

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 Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of ae34fa6c342566a51e91a2c86fd6f022660cbdbe — 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 fix reuses selectSlotStreamState and the footer's existing catalog key, and the defect is traced to #35592 and to two tests that fail on base.

Notes

  • Item 2 — oversized: the diff builds the same "compacting keys" selector twice, once in CommandPalette.tsx (joined with ',') and once in recentsProvider.ts (joined with '\n'). Two spellings of one derived value can drift apart. Subtraction: keep one selector and import it at the other site, deleting the inline copy.

What this change ships

Inventory (2 items) — 1 justified

Intent: a person switching sessions from the palette sees "Compacting…" for a session whose chat is compacting, matching the footer. FIX.

  1. While a slot compacts, the palette's running recent-session row says "Compacting…" instead of "Thinking…" or the last tool step — justified
  2. An already-open palette refreshes its recents when a slot starts or stops compacting — oversized: the compacting-keys selector is written twice

[FIRST-PRINCIPLES-REVIEWED] ae34fa6

Description read

[DESCRIPTION-READ] 4f7b3d26681635ceb97faba622c41c0f4e97e1513cb5325b6c9210aca93fccff

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 Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

Nothing blocks: the row only takes the word "Compacting…" that the chat footer and sidebar row already use, and shot-01 shows it rendered next to a row that still says "Thinking…".

Notes

  • The blind reader understood that clicking the row opens the chat. They did not understand the word itself: "I have no idea what 'Compacting' means… I'd hesitate, because 'compacting' sounds like it might be throwing my stuff away." The word is shared with other screens, so it should be changed everywhere in a follow-up, not in this PR. One fix is a tooltip on the status, such as "Summarizing earlier messages to free up space", or a plainer word.
  • The reader also said "'Thinking…' and 'Compacting…' look exactly alike in the lists (same purple, same icon)". The text is enough to tell them apart, so this is not a color-only problem. Still, the chat's own status uses an hourglass and the palette uses a plain dot, so the reader saw one state drawn three ways.

[UX-REVIEWED] ae34fa6

Description read

[DESCRIPTION-READ] f091573cb6a7be419d52d1137b925d576a972d8144054ad8395aa2ef695a6c24

That sha256 names everything this verdict read: the PR description, plus the 5 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 Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] ae34fa6

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

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

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] ae34fa6

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

Jacob Largent added 2 commits November 13, 2026 03:23
The palette's recent-session row built its running label from the
slot's status detail only, which keeps the thinking phase from before
a compaction, so it said "Thinking..." while the chat footer said
"Compacting...". The recents provider now reads each live slot's run
state through selectSlotStreamState and, while it is compacting, shows
the footer's word, as the sessions sidebar row does since #35685.

Closes #35592
The palette re-runs the recents search only when its live fingerprint
changes, and a compaction moves only the slot's run state, so an open
palette kept the pre-compaction label. The fingerprint now carries the
keys of compacting slots, read through selectSlotStreamState.
@JLargent42
JLargent42 force-pushed the fix/35592-palette-compacting branch from 74c5683 to ae34fa6 Compare November 13, 2026 03:25
@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 Nov 13, 2026
@JLargent42

Copy link
Copy Markdown
Contributor Author

The KiroCrew conductor (largjaco's v2 drive-to-green session) now owns this PR under the 24h orphan rule; the desk session that opened it has been offline since 11-06. I'll rebase onto main, fix CI and answer review here.

@JLargent42 JLargent42 self-assigned this Nov 14, 2026
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention labels Nov 14, 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.

Thanks for this fix. The code looks right, but one evidence gap blocks merge on this head.

  1. website/src/components/commandPalette/providers/recentsProvider.ts:234: The palette's recent session row gets a new visible state. Its label now reads "Compacting…" in place of "Thinking…" while the session compacts. The PR body waives the screenshot with <!-- no-visual-delta --> and attaches no image, so the UX lane on this head reported that it cannot evaluate the change and did not do its blind read. CI then turned that result into a PASS. Under the review rules in docs/ci/ci-and-reviews.md, a lane that cannot reach a verdict because required evidence is missing counts as a BLOCK. The waiver covers only changes with no visual difference, and here the rendered text changes. Smallest fix: attach one still of the open palette on this head. It should show a compacting session row next to a "Thinking…" row, ideally with the chat footer also reading "Compacting…" in the same frame. Then re-run the UX lane. No code change is needed.

What the review checked on this head: the change reuses the sidebar's selectSlotStreamState and the footer's existing pages.chat.chatFooter.compacting key. The compacting keys are part of the palette's live fingerprint, so an open palette re-runs search. Both new tests fail if their hunk is reverted. One thing done well: the CommandPalette test changes only the run state and leaves the status detail alone, which covers the less obvious half of the bug.

Optional:

  • The Command Bar's root Recent row (CommandBarOverlayRootRows.tsx, the sessionStatus( call that builds the recent group) does not pass the new flag, so it still shows "Thinking…" during a compaction. That surface is outside this PR's goal. The Pattern harvest says this was the last such caller, but the sweep searched for toolStatusLabel( and not sessionStatus(. Could you correct that line and open a follow-up issue?
  • The compacting-keys selector is written twice, in CommandPalette.tsx and recentsProvider.ts, once joined with ',' and once with '\n'. One shared helper would keep the two copies from drifting apart.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision labels Nov 14, 2026
@JLargent42

Copy link
Copy Markdown
Contributor Author

@KiroCrewCaptain, thanks. I've answered each point on head ae34fa6c342. The head hasn't changed, because none of these points needs code.

  1. Evidence gap (blocking): I removed the no-visual-delta waiver. The Screenshots section now has two stills taken on this head. The first is the open command palette, where the compacting session's row says "Compacting…" right above a running row that still says "Thinking…". The second is the same moment before the palette opens, with the chat and its sidebar row both reading "Compacting…". The palette overlay blurs the footer, so it can't sit in the same frame. I used scripted Playwright on the built SPA, served from a loopback static server with the dashboard API stubbed. The compaction arrives as the gateway's chat_message frame with role compacting. The capture script also asserts each row's text before it takes the shot.
  2. Command Bar root Recent row (optional): You're right that the sweep missed it, because it searched only for toolStatusLabel(. The Sibling sweep now also searches for sessionStatus( and lists CommandBarOverlayRootRows.tsx as tracked in Command Bar's Recent row says Thinking while the chat is compacting #37300. I also corrected the Pattern harvest line. Command Bar's Recent row says Thinking while the chat is compacting #37300 names both call sites.
  3. Compacting-keys selector written twice (optional): I'm leaving it as is in this PR. The two copies join with different separators on purpose. The palette's copy only has to change when the set changes. The provider's copy is split back into a Set, so it needs a separator that can't occur in a slot key. A shared helper would tie the palette's query key to the provider's internals. That's a reasonable refactor, but it isn't needed for this fix. I can fold it into Command Bar's Recent row says Thinking while the chat is compacting #37300 if you'd prefer it there.

@KiroCrewCaptain
KiroCrewCaptain enabled auto-merge (squash) November 14, 2026 19:29

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

Thanks for the follow-up. Every point from the earlier review is now resolved on this head, so this approval replaces that change request.

  • Evidence gap: fixed. You removed the waiver and added two stills from this head. The UX lane re-ran and now passes, citing the palette shot with "Compacting…" shown next to "Thinking…".
  • Command Bar root Recent row: addressed. The sweep now also searches for sessionStatus(, and #37300 tracks the remaining call sites.
  • Duplicated compacting-keys selector: you declined it, and the reason holds. The two copies iterate different slot sets and use different separators on purpose.

What the review verified on this head: the label reads run state through selectSlotStreamState, the selector the sidebar row already uses. Approval and needs-input still rank above it. The new parameter defaults to the old behaviour for the other callers. The compacting keys are part of the palette's query fingerprint, so an open palette searches again. Both new tests fail if their hunk is reverted. No check run on this head is failing. Done well: the palette test keeps the status detail fixed, so only the new fingerprint term can trigger the refresh.

Optional:

  • On main, #36358 moved the file named in the Sibling sweep and in #37300 to website/src/components/commandBar/CommandBarOverlayRootRows.tsx. Updating the path in both places means whoever picks up #37300 starts from a file that exists.
  • No test fails if compactingKeys is dropped from the useMemo deps in recentsProvider.ts. In that case an open palette would search again but keep showing "Thinking…". One more recentsProvider.test.ts case would pin it: change slotRun to compacting, call rerender(), then search and expect "Compacting…".

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention labels Nov 14, 2026
@KiroCrewCaptain
KiroCrewCaptain merged commit 8e2f4c5 into main Nov 14, 2026
115 of 118 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the fix/35592-palette-compacting branch November 14, 2026 19:30
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 14, 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.

Command palette says Thinking while the chat is compacting

2 participants