Fix stale send spinner after completed turns#1700
Fix stale send spinner after completed turns#1700juliusmarminge merged 1 commit intopingdotgg:mainfrom
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 |
ApprovabilityVerdict: Approved This is a straightforward bug fix for a stale UI spinner, adding a helper function with comprehensive tests. The scope is limited to improving the accuracy of 'is running' detection without changing any significant runtime behavior beyond fixing the intended UI glitch. You can customize Macroscope's approvability policy. Learn more. |
This reverts commit 48481aa. Co-authored-by: codex <codex@users.noreply.github.com>
Summary
Problem
Sometimes the assistant visibly finishes a turn, but the desktop/web composer keeps showing the running spinner and blocks the next send until refresh. This happens when the latest turn has already completed through message updates, but the session state is still stale at
running.Verification
bun fmtbun lintbun typecheckcd apps/web && bun run test src/session-logic.test.tsNote
Low Risk
Low risk: changes are confined to derived session/turn state and corresponding UI gating (spinner/interrupt/autoscroll/timer), with added unit coverage for stale
runningsessions.Overview
Fixes cases where the composer stays stuck in “running” after a turn has already completed by deriving a new
isSessionActivelyRunningTurnsignal fromlatestTurn.completedAt+session.activeTurnId(instead of trusting sessionphasealone).ChatViewnow uses this active-turn signal to drive the composer running spinner, auto-scroll while running, elapsed-work timer tick, and to block checkpoint reverts only when a turn is truly in-flight. Tests updateisLatestTurnSettledexpectations for stale-running sessions and add coverage forisSessionActivelyRunningTurnplus the relatedderiveActiveWorkStartedAtfallback behavior.Written by Cursor Bugbot for commit 8f03b59. This will update automatically on new commits. Configure here.
Note
Fix stale send spinner by deriving running state from active turn completion
isSessionActivelyRunningTurnin session-logic.ts to check whether a turn is truly in-progress by comparing sessionorchestrationStatus,activeTurnId, and latest turn completion status.isLatestTurnSettledto treat a completed turn as settled even when the sessionorchestrationStatusremains'running', eliminating the stale spinner.isTurnRunningfrom the new helper, replacing thephase === "running"check that drove auto-scroll, the elapsed timer, composer footer layout, and checkpoint revert blocking.Macroscope summarized 8f03b59.