Skip to content

fix(sidebar): say compacting on a session row while its chat compacts - #35685

Merged
bolichen97 merged 1 commit into
mainfrom
fix/34313-row-compacting-status
Nov 12, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/34313-row-compacting-status

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: While a chat compacts, its row in the sessions sidebar says "Compacting…", the same word the chat footer and the crew member pill show.

During a manual /compact, or an automatic compaction inside a turn, the chat footer says "Compacting…" but the session's row in the sessions sidebar keeps saying "Thinking…".

Why it matters

The sidebar is where people watch sessions they are not looking at. "Thinking…" tells them the model is working on an answer, when the chat is compacting its context and will not answer until that ends. Two surfaces name the same moment with two different words.

Not a goal

  • A compaction the gateway runs between turns (the server's compacting slot flag): the row is not in its running state then, and the chat footer does not show it either.
  • Any change to the footer, the member pill, the composer or the command palette, and no new catalog string.

What changed (motivation → approach → change)

The row's running line (slotStatusText in pages/chat-sidebar/SessionRow.tsx) was built from the slot's status detail only. That detail keeps the thinking phase from before the compaction, so the row said "Thinking…". The footer and the member pill read the slot's run state through selectSlotStreamState, which the store sets to compacting when the compaction frame arrives.

The row calls that same selector in its one existing store subscription (selectRowLive). While the run state is compacting, the row's running line, its goal-loop detail and its tooltip say the footer's own word (pages.chat.chatFooter.compacting). Once the run state moves on, the line shows the tool or thinking text again.

A session this tab does not watch gets no chunk after its compaction, so in store/chatSlice.ts its background run state leaves compacting when the compaction result notice arrives, the frame every tab receives. Without that, its row would say "Compacting…" until the turn ended.

selectSlotStreamState in store/chat/selectors.ts reads the per-slot run map as slotRun?.[slot], the way the pending-turn selector beside it does. The real store always starts that map empty; the sidebar's test stores are built without it, and there the selector reads such a slot as idle instead of throwing.

Backwards compatibility

Compatible: the row shows one more state word; no API, store shape, setting or catalog key changes. A background session's run state leaves compacting at the compaction result notice rather than at its next chunk, tool row or turn end. selectSlotStreamState returns the same value for every store that has its run map.

Removes nothing: the change adds a reading to the row's status line and takes nothing away.

Tests

  • ChatSidebar.toolStatusSetting.test.tsx gains one case: a running row whose status detail is thinking reads "Thinking…", reads "Compacting…" and not "Thinking…" after a compacting frame for its slot, and reads "Thinking…" again after the compaction result notice.

Proof: not provable -- frontend test (prove.py runs Python only)

With SessionRow.tsx put back to its base, the new case fails at its "Compacting…" check and the file's six other cases pass; with only store/chatSlice.ts put back, it fails at the "Thinking…" check after the notice; with the fix, all seven pass. Determinism: the file passed 10 repeated runs, and a shuffled run (--sequence.shuffle --sequence.seed=4242) with ChatSidebar.statusMarker, ChatSidebar.liveDot and ChatSidebar.goalLoop passed.

Manual verification

The built dashboard was opened in Playwright with the API stubbed and the websocket mocked: two running sessions get a turn start, then the open one gets the compacting frame /compact sends. Before the fix its row says "Thinking…" under the chat's "Compacting…"; with the fix it says "Compacting…", and the other running row still says "Thinking…". Checked in dark and light.

Screenshots / video

Dark, before (base) and after (this PR): the open chat is compacting.

Before, dark: the compacting session's row says Thinking
After, dark: the compacting session's row says Compacting

Light theme

Before, light: the compacting session's row says Thinking
After, light: the compacting session's row says Compacting

Related Issues

Closes #34313

Sibling sweep

Swept: git grep -n "toolStatusLabel(" -- website/src ':!.test.'
Sibling: website/src/components/commandPalette/providers/recentsProvider.ts:231 -- tracked in #35592
Sibling: website/src/pages/members/useSlotActivity.ts:52 -- not affected -- resolvePillActivity reads the run state and says Compacting first

Pattern harvest

Not generalizable: one surface built its status word from the status detail alone; the run-state seam it skipped is already the one the footer and the pill read.

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

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 12, 2026 00:23
@bolichen97
bolichen97 requested a review from buluoray November 12, 2026 00:23
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 12, 2026
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 83e9fe80bb62719f43a4a6fefc6c5df0fb597aaf — 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 row now reads the run-state seam that the footer and the member pill already use, and the one unfixed sibling (recentsProvider.ts:231) is tracked in #35592.

What this change ships

Inventory (4 items) — 2 justified

Intent: while a chat compacts, the session's sidebar row says "Compacting…" like the footer does, not "Thinking…". FIX (#34313).

  1. A running session row's status line says "Compacting…" during a compaction, then goes back to the tool or thinking text — justified
  2. The row's goal-loop detail and its tooltip say the same word during a compaction — justified
  3. A session this tab isn't watching leaves the compacting state when the compaction result notice arrives, not at its next chunk or the end of the turn — justified
  4. selectSlotStreamState treats a store with no slotRun map as idle instead of throwing — rides along; only the sidebar's test stores lack that map

[FIRST-PRINCIPLES-REVIEWED] 83e9fe8

Description read

[DESCRIPTION-READ] 205ce0de6aeda1dfed410a59b2231f259a8eafe37be638e98dfc78e8dd708c96

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

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: the row now reads the same run-state selector the footer and member pill use, and the fix can be reverted cleanly.

Notes

  • For a background slot, the compaction result notice now moves the run state from compacting to streaming. That only helps if a turn-end frame follows. For a manual /compact on an unwatched slot, confirm that frame arrives; otherwise the run state stays at streaming rather than compacting.

[DESIGN-REVIEWED] 83e9fe8

Description read

[DESCRIPTION-READ] 27b75b6dfcd18862d7883c474f22b9e39772185c4ff1601a02a9331c0458d57d

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

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

Nothing blocks. The row's status word now matches the footer, and the blind reader saw that in the after shots ("the left list now matches what the open conversation is doing").

Notes

  • The blind reader could not tell what "Compacting…" means or whether it loses any of the conversation. The word comes from the existing footer string pages.chat.chatFooter.compacting, so it is outside this PR. If it is ever reworded, a plainer phrase would help, for example a tooltip on the row reading "Shortening context — your messages are kept".

[UX-REVIEWED] 83e9fe8

Description read

[DESCRIPTION-READ] c89b5026de1b1816b29c5464db269ed21c2c5ce16f9cabca6c1814e11088cdc3

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 83e9fe8

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

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

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 83e9fe8

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

@bolichen97
bolichen97 enabled auto-merge (squash) November 12, 2026 00:48
@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 12, 2026
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: Approve

Why: the decider estimates a 12% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes.

I'm approving this PR. With it, a running session row in the sidebar says "Compacting…" while its chat compacts. It works this out from the slot's run state. For the open slot that is slotState, and for a background slot it is slotRun[key].state. That is the same rule selectSlotStreamState follows (selectors.ts:57), and it's the selector the footer and the member pill read.

The store sets compacting on both paths, the open slot and background slots (chatSlice.ts:278 and :477). So the row now changes for background sessions too, which is the case the PR is about. All three places that show the running line pass the new flag: the status line, the goal-loop detail and the tooltip. The catalog key it uses already exists, and so does the footer's one use of it. Nothing about the store's shape changes.

The new test sends a real compacting frame and then a chunk frame. It fails without the fix and checks that the row goes back to "Thinking…" after the chunk. The CI failures (Windows backend tests and one E2E spec that only passed on a retry) are in Python and Playwright code this frontend-only change doesn't touch.

The First Principles lane blocked because the change copies

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit f3615b5283 · 47 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

The row's running line was built from the slot's status detail only,
which keeps the thinking phase from before a compaction, so the row
said "Thinking..." while the chat footer and the crew member pill said
"Compacting...". The row reads the slot's run state through
selectSlotStreamState in its one store subscription and, while it is
compacting, shows the footer's word on its running line, goal-loop
detail and tooltip.

A session the tab does not watch gets no chunk after a compaction, so
its background run state takes the compaction result notice as the end
of the compaction. selectSlotStreamState reads the per-slot run map
with optional chaining, as the pending-turn selector beside it does.

Closes #34313
@bolichen97
bolichen97 force-pushed the fix/34313-row-compacting-status branch from f3615b5 to 83e9fe8 Compare November 12, 2026 12:32
@bolichen97

bolichen97 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: the row's own inline copy of the slot run-state resolution

  • span=54951337d3c6 The row's run state is a second spelling of selectSlotStreamState

fixed in 83e9fe8: selectRowLive calls selectSlotStreamState(st, localSlotKey) === 'compacting' and has no inline resolution; the comment that described the copy is gone.
selectSlotStreamState reads slotRun?.[slot], as selectPendingTurn beside it does: the sidebar's hand-built test stores omit slotRun, and the real store always starts it as {}.

[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in website/src/pages/chat-sidebar/SessionRow.tsx and nine files beside it in website/src/pages/chat-sidebar/ since this head was built, and main now carries the fix for the two Windows backend reds this head saw on its old base (test_wait_discipline_ratchet and test_updates_handlers_facade, fixed in #35625) (ee7a026 -> 169429f); CI re-running.

[operator: bolichen97]

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

This review checked head 83e9fe8. The row reads the existing selectSlotStreamState inside its one shallowEqual subscription, so it adds no re-render. The new background exit from compacting runs only after the redelivery guard, only from the compacting state, and only on a real result notice, not on a notice-tagged frame. It writes through setRunState and syncOriginRun. Every busy check still reads busy. The catalog key exists in every locale. The new test fails if either production hunk is reverted, and it uses no sleeps or timers.
Done well: the row shows the footer's own catalog key through the same run-state seam, so the two cannot drift apart.
Optional:

  • The member pill and the split-pane footer for a background slot also leave Compacting at the notice. That is intended and matches the backend contract. A short PR comment saying so would help, since the body says those surfaces do not change.
  • Add a case with activeSlot set to 'k', and a case where a notice-tagged frame (for example notice 'stuck_turn') leaves the row on Compacting. This pins both guards on the new exit.
  • The goal-loop detail and the status tooltip call sites are not covered by a test.

@bolichen97
bolichen97 merged commit 65784b8 into main Nov 12, 2026
155 of 156 checks passed
@bolichen97
bolichen97 deleted the fix/34313-row-compacting-status branch November 12, 2026 14:50
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 12, 2026
JLargent42 pushed a commit that referenced this pull request Nov 13, 2026
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
KiroCrewCaptain pushed a commit that referenced this pull request Nov 14, 2026
…cts (#36316)

* fix(palette): say compacting on a recent session while its chat compacts

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

* fix(palette): re-run recents search when a slot starts compacting

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.

---------

Co-authored-by: Jacob Largent <largjaco@dev-dsk-largjaco-kiroc-2a-dc066d04.us-west-2.amazon.com>
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.

Session list row says Thinking while the chat is compacting

2 participants