Improve turn start feedback#3078
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
922724a to
6d3f72f
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 74d6dc1. Configure here.
ApprovabilityVerdict: Needs human review This PR introduces new state management infrastructure and changes runtime behavior for turn feedback timing. An unresolved review comment identifies a potential bug where the working timer may reset during phase transitions, which warrants human review. You can customize Macroscope's approvability policy. Learn more. |

Summary
Starting requesttoWorkingVerification
vp test apps/web/src/session-logic.test.ts apps/web/src/localDispatchStore.test.ts apps/web/src/components/ChatView.logic.test.ts apps/web/src/components/chat/MessagesTimeline.logic.test.tscd apps/web && vp test run src/components/ChatView.browser.tsx --project browser -t "sends bootstrap turn-starts"vp checkvp run typecheckNote:
vp checkexits successfully and still reports existingreact(no-unstable-nested-components)warnings outside this change.Note
Show 'Starting request' label before the AI turn begins in the chat timeline
phasefield ('starting' | 'running') to theworkingtimeline row inMessagesTimeline.logic.ts, driving distinct UI labels: "Starting request for..." before the turn begins and "Working for..." once it is running.localDispatchStore.ts), preserving the original start timestamp across re-renders and preventing navigation between threads from clearing in-flight dispatch state.hasServerAcknowledgedLocalDispatchinChatView.logic.tsso acknowledgement requires a new turn with a non-nullstartedAt, not just a session metadata change.deriveActiveWorkStartedAtinsession-logic.tsto prefer the local send timestamp when available, falling back to the running turn'sstartedAtfor recovered sessions.Macroscope summarized 74d6dc1.
Note
Medium Risk
Touches send/busy state, draft promotion, and when local vs server work is shown—user-visible timing bugs are possible but changes are well covered by unit and browser tests.
Overview
Improves chat feedback from send through provider turn start by keeping a per-thread local dispatch in a new Zustand
localDispatchStore(keyed by scoped thread ref) instead ofChatViewcomponent state, so draft promotion and remounts no longer drop the loading row.Acknowledgement logic in
hasServerAcknowledgedLocalDispatchnow clears local dispatch only when the latest turn actually changes and has astartedAt, not on incidental session metadata updates—matching the new “starting” window.The timeline working indicator gains a
phase(starting|running): copy shows “Starting request” untillatestTurnis running with a start time, then “Working”.deriveActiveWorkStartedAtprefers the local send timestamp when present so the elapsed timer stays continuous across the label change.ChatViewstops resetting local dispatch ondraftId/threadIdchanges; optimistic message cleanup still runs on thread id change. Tests cover store behavior, acknowledgement, timeline phases, draft first-send browser flow, and session timing.Reviewed by Cursor Bugbot for commit 74d6dc1. Bugbot is set up for automated code reviews on this repo. Configure here.