Repository navigation
fix(crew): hold each step on the crewmate status line so it stops flickering - #18528
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS A tool title can stay on screen up to 1.5s after its call has returned. Confirm that delay is acceptable, since the header pill shows the real-time state. [DESIGN-REVIEWED] 3e970b1 Description read[DESCRIPTION-READ] 544f72eae076ee8101ce21eafdf03e0eacf42ea7cad369d8837413f47e858a41 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 |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Check that the header pill reading "Thinking…" while the chat line still holds the last tool title for up to 1.5s doesn't look like a contradiction. [UX-REVIEWED] 3e970b1 Description read[DESCRIPTION-READ] 03cb7b28d22b33089c86e5303fb6eff8bd27a09e4b0f33a6f77b7ef0ce8a309c That sha256 names everything this verdict read: the PR description, plus the 4 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) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Check that the #18256 owner accepts the rewritten spec line. The header pill and the chat line can now disagree for up to 1.5s. What this change shipsInventory (6 items) — 5 justifiedIntent: FIX (#18527). Make a crewmate's one-line live status readable instead of a line that flashes tool titles and mostly says "Thinking".
[FIRST-PRINCIPLES-REVIEWED] 3e970b1 Description read[DESCRIPTION-READ] f426fa2727aa7c28d53393340555b2703824f6d5f040d65647c4473d7f2af9ca That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Review detailsNo findings that block the merge. FINDING — website/src/components/chat/useHeldActivity.ts:41 — the replay only fires when the step on screen is a tool ( [OPUS-REVIEWED] 3e970b1 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
buluoray
left a comment
There was a problem hiding this comment.
Thanks, the hold logic itself is sound and well tested. I checked the three things that matter most for a display-delay hook:
- Turn end / cancel / error: the line is mounted only while the crewmate is live (
ChatPane.tsx:1838), so when a turn ends the component unmounts, the pending timer is cleared and the held state goes with it.stopping/compactingbypass the hold. Good. - Ordinary chat: untouched. Only
CrewmateLiveActivityuses the hook, and the header pill still readsuseSlotActivitydirectly. - Mutation check: removing the skipped-tool substitution, the 1.5s tool→Thinking hold, or the urgent zero-wait each reddens exactly one of the new tests. Removing the
clearTimeoutcleanup keeps the suite green.
Blocking: a held step can appear in another crewmate's chat. The Members page rebinds one ChatPane to a new slot without remounting it (MembersPage.tsx:4327, no key; ChatPane's own comment at :302 describes this). CrewmateLiveActivity has no key either. So if the user switches from crewmate A to crewmate B while both are working, crewmateLive stays true, the component stays mounted, and useHeldActivity keeps A's shown/lastTool. B's line then shows A's last tool title for up to 1.5s while B's header pill shows B's real state. I reproduced it on the real component: render a tool title, rerender with Thinking, and after 1000ms the line still shows the first title. Before this PR the swap was instant, so this is new, and it names the wrong subject rather than just a delayed one. Fix: <CrewmateLiveActivity key={slotKey} activity={liveActivity} />, ideally with a test that rerenders under a new key and expects the new reading at once.
Follow-ups (non-blocking, but please fold them into the same commit):
- The owning spec still describes the old contract.
docs/system-specs/modules/crew-mode.md(around line 1655) says the line is the pill's own reading, so "the header and the chat can never name one moment differently", and that it shows "Thinking…" once the call returns. The feature-map "Crewmate chat" row says "the pill reads the same". Both should describe the intentional hold (≥600ms per step, 1.5s before Thinking, stopping/compacting immediate, chat line only). - Pin the timer cleanup with a test, for example a newer reading superseding a pending one, or no update after unmount.
- Minor: the
stopping/compactingline break in the hook's doc comment.
CI on 81ec5de: 86 success, 11 skipped, 0 failures.
|
Self-review (crew-pr-reviewer, read-only): CHANGES NEEDED This PR calms the crewmate's one-line live status by passing the reading through a new |
|
Moved to draft by crew-pr-reviewer: the self-review above is CHANGES NEEDED. Draft keeps this PR from merging and turns auto-merge off. Once the points above are fixed, mark it ready with |
81ec5de to
5d5d911
Compare
|
Thanks @buluoray — all four points are in the new head 5d5d911 (still one commit, rebased on main). Blocking — a held step could show in another crewmate's chat. Fixed in Spec and feature map. Timer cleanup test. Doc comment line break. Fixed ( Local: the five named vitest files pass (80 tests), |
…ckering Builds on #18256. The live reading flips to Thinking the moment a tool call returns, so fast calls flashed past a line that mostly said Thinking. The chat status line now holds each step for 600ms and a finished tool's title for 1.5s before Thinking. The newest step wins when a hold ends, and a tool that ran inside a hold still gets its turn; stopping/compacting swap at once. The line is keyed by slot: the Members page rebinds one ChatPane to another crewmate without remounting it, so a rebind starts from that crewmate's own reading, never from the previous one's held step. The header pill is unchanged. The crew-mode spec and feature map describe the hold.
5d5d911 to
3e970b1
Compare
|
Head is now 3e970b1: the same single commit rebased onto main, which had just landed fixes for the inherited reds (the wait-discipline ratchet re-baseline #19329 and the FilePathMenu in-app chip tests #19288). No change to the diff. CI on 3e970b1: 101 checks, 0 failing, PR Readiness passed, all review lanes PASS. |
|
Self-review (crew-pr-reviewer, read-only): RECOMMEND APPROVE This fixes the flicker in the crewmate live status line. The root cause is that |
buluoray
left a comment
There was a problem hiding this comment.
LGTM. I checked this at head 3e970b1. This supersedes my request changes on 81ec5de.
What it brings: the crewmate status line holds each step briefly instead of flashing through tool titles, and switching to another working crewmate shows that crewmate's step at once.
My earlier blocker is fixed. ChatPane.tsx:1989 now renders <CrewmateLiveActivity key={slotKey} .../>. The Members page still rebinds one ChatPane without a key, so this component key is what resets the held state on a switch. Removing the key reddens the new test "rebinding the pane to another working crewmate shows THAT crewmate's step at once, never the held one".
Earlier follow-ups, also done:
crew-mode.mdnow describes the hold (600ms per step, 1.5s before Thinking, stopping/compacting swap at once, pending swap dropped on supersede or unmount, keyed by slot), and the feature map matches.- Removing the
clearTimeoutcleanup (useHeldActivity.ts:52) now reddens "a newer reading supersedes a pending swap: the old timer is cleared, never fires late". - Also checked:
urgent = falsereddens "swaps to stopping at once"; shortening the tool-to-Thinking hold reddens "keeps a finished tool title on screen before falling back to Thinking".
The range-diff since 81ec5de touches only the key, the spec/feature map, a doc comment and two tests; the hold logic is unchanged. The two changed test files pass, 20/20. CI at this head: 92 success, 9 skipped, 0 failed.
Non-blocking: compacting has no zero-wait test of its own; only the stopping test catches the urgent path.
Not verified: no live browser run; the rebind behaviour is proven through the RTL test.
Problem / Motivation
Goal: The crewmate's one-line live status is calm and readable: each tool step stays on screen long enough to read instead of flashing past a line that mostly says "Thinking".
Builds on #18256 (CrysisDeu), which collapsed a crewmate's live work to one status line. Since then the line flickers: tool titles flash by in tens of milliseconds and the line reads "Thinking" most of the time.
Why it matters
The line is the only live sign of what a crewmate is doing. When it flickers, a reader cannot follow the work, and the steady motion is distracting beside the transcript.
Not a goal
useSlotActivity/pillActivity.ts) is unchanged; it keeps the raw reading.What changed (motivation → approach → change)
Symptom → cause:
useSlotActivityreads "Thinking" as soon as a tool call returns. A fast call returns almost at once, so each title showed only for the call's own life, and every gap between calls was Thinking.Change: the chat line now passes its reading through a small new hook,
useHeldActivity(website/src/components/chat/useHeldActivity.ts), wired inCrewmateLiveActivity.tsx. It only delays what the line shows:stopping/compactingswap at once;The held step belongs to one crewmate. The Members page rebinds ONE
ChatPaneto the newly picked crewmate without remounting it, soChatPane.tsxnow keys the line by slot (<CrewmateLiveActivity key={slotKey} …/>): a rebind is a fresh mount and shows that crewmate's own reading at once, never the previous one's held step (buluoray's review).Docs:
docs/system-specs/modules/crew-mode.md(the crewmate chat status line) and the feature-map "Crewmate chat" row now describe the hold: 600ms per step, 1.5s before Thinking, stopping/compacting at once, chat line only, keyed by slot.The fade under
prefers-reduced-motionwas already off and stays off.Backwards compatibility
Compatible: the component's props and the pill's reading are unchanged; only the chat line's display timing changes.
Removes nothing: no path, key, record or function is taken away; the line still shows every reading kind, just held briefly.
Tests
website/src/components/chat/CrewmateLiveActivity.test.tsx(new, fake timers, renders the real component):clearTimeoutcleanup is removed);website/src/test/ChatPane.crewmate.test.tsx(one new case): both crewmates busy, A's line shows a tool title, the pane is rebound to B (sameChatPane, newslotKey) and B's line reads B's "Thinking…" synchronously, with A's title gone. Red without thekey(B's line showed "Checking the triage queue"), green with it.Red-before for the hold: with
CrewmateLiveActivity.tsxreset to main and the hook file present, the three hold tests fail and the stopping test passes. With the fix, all pass.crewmateBubbles,useSlotActivity,ChatPane.crewmateandChatPane.workingLoadertests pass (80 tests).i18n:check,tsc -p tsconfig.app.json, eslint (--max-warnings 0on changed files),check_feature_map.pyanddocs-lint.shpass.Manual verification
A throwaway harness mounted the real
CrewmateLiveActivitybeside a raw reading of the same scripted burst (six fast tool calls, 70–140ms each, with 150–250ms of thinking between). Sampling both rows every 50ms over 5s:Screenshots / video
Top row: the raw reading (as on main). Bottom row: this PR. One frame every 150ms.
calm-line.webm
Related Issues
Closes #18527
Builds on #18256.
Pattern harvest
Not generalizable: a display-timing choice for one live status line; there is no code shape a rule could catch.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)