Fix sending messages during active turns#3919
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 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort 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 9361c84. Configure here.
ApprovabilityVerdict: Approved Straightforward bug fix that adds tracking for the latest user message ID to properly acknowledge steering messages during active turns. The change is self-contained with clear intent, good documentation, and comprehensive test coverage. You can customize Macroscope's approvability policy. Learn more. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9361c84e3b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

What changed
Why
Messages sent while an agent was already working remain on the current turn. The composer only recognized server acknowledgment when turn metadata changed, so its local sending state could remain stuck until the thread was remounted by navigating away and back.
This change also treats the newly projected user message as acknowledgment, allowing subsequent steering messages without thread navigation.
Validation
pnpm exec vp test apps/web/src/components/ChatView.logic.test.tspnpm exec vp checkpnpm exec vp run typecheckNote
Fix message sending during active turns by recognizing steering messages as server acknowledgment
hasServerAcknowledgedLocalDispatchnow returnstrueduring a running turn when the latest user message ID changes, treating a projected steering message as server acknowledgmentLocalDispatchSnapshotgains alatestUserMessageIdfield, captured viafindLastover messages withrole === 'user'at snapshot creation timeChatView.useLocalDispatchStatepasses the currentlatestUserMessageIdinto the acknowledgment check, clearingactiveLocalDispatchand unblockingisSendBusysooner when a steering message appearsMacroscope summarized e78403b.
Note
Low Risk
Narrow composer UX fix in local dispatch acknowledgment logic with targeted unit tests; no auth, data, or API surface changes.
Overview
Fixes the composer staying in Sending after you message an agent that is already working. Steering adds a user message on the same running turn, so turn timestamps often do not change and the old acknowledgment logic never cleared local dispatch.
LocalDispatchSnapshotnow recordslatestUserMessageIdat send time.hasServerAcknowledgedLocalDispatchcompares that id to the thread’s latest user message and, whilephase === "running", treats a new projected message as server acknowledgment even when turn metadata is unchanged.useLocalDispatchStatepasses the current latest user message id into that check.Regression test covers steering onto a running turn without a new turn or timestamp change.
Reviewed by Cursor Bugbot for commit e78403b. Bugbot is set up for automated code reviews on this repo. Configure here.