Repository navigation
Show when Claude is compacting before a reply starts - #37409
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review.
|
A Claude chat now shows "Compacting the conversation" (and any other root activity) as soon as Claude starts working on a message, including on CLIs that send no command-lifecycle receipts. The send's turn is opened when Orca hands the input to Claude, the echo confirms delivery into that same turn, a follow-up handed over while it runs joins it, the previous cycle's late idle or result no longer closes the new turn, and an input Claude proves it never ran retracts its unworked turn instead of ending it. Tracked in STA-9923.
…eally its own A Claude turn opened when Orca hands a message over now tracks every message handed over while it runs and which provider cycle each one ran in. A turn Claude started and then cancelled ends on its own idle; a refused message only removes itself, keeping the turn for any message that joined it; a follow-up's echo with a new uuid stays in the turn it joined; a finished turn's unechoed message never owns later work; an earlier cycle's result no longer completes a newly handed-over turn; and withdrawing an unrun message no longer announces the previous reply again. Tracked in STA-9923.
A follow-up whose own result arrives after the turn it joined ended can no longer anchor the next message's turn: every endpoint Claude reports for an input (its named result, a terminal receipt, a refusal, or the end of the run it ran in) now retires it in one step, wherever it is waiting. Inputs are looked up by the ids Claude names them with instead of scanning every message a long turn has folded in, so a turn with many follow-ups stays cheap. Tracked in STA-9923.
This reverts commit bcc7dd5.
…at are really its own" This reverts commit 43df8fc.
This reverts commit 211a0b7.
… started-send boundary Precompaction: the previous turn's completed/idle tail, 14 s and zero-length compaction, the receipt-less Working expectation, a follow-up released during compaction with exact and reminted opener echoes across an intervening init, both Stop forms with the published turn id, and started -> compacting -> cancelled -> idle without an echo. Background wake: captured CLI wake frames stay provider-owned whether the follow-up was handed over before the first result (with or without a queued receipt) or after the first turn ended; the follow-up's own echo opens its turn. A follow-up settled by its own named result cannot own the next send.
Review loop status: doneProblem. When Claude auto-compacted a conversation right as a message was sent, the chat showed "Working…" for the whole compaction (5-15 s) instead of "Compacting the conversation", because Claude reports compaction before echoing the message and Orca opened turns only from the echo. User-facing change. The chat now shows "Compacting the conversation" during that wait and continues into the reply in the same turn; Stop in the wait leaves one Interrupted turn. How the review went. Round 1 (three reviewers) found no defect in the original design but questioned one difference from the common pattern (owning the turn from handoff rather than from Claude's start report). A design panel adopted handoff ownership; three repair rounds each surfaced new defects of the same kinds (a turn stuck on Working after a send that never ran; a waiting follow-up taking over an unrelated background-task reply; stale results closing the wrong turn). A fourth panel, with new evidence that the common pattern itself misattributes background work when there is no start report, unanimously returned to the original design. The handoff-ownership commits are reverted, so the shipped code is byte-identical to the original design that passed real QA, plus stronger tests from those rounds. Fixed / kept: turn opened from Claude's start report when compaction precedes the echo; same-message echo adopts the turn; tests now cover Stop in both forms with the real delivery projection, zero-length compaction, follow-up folding, background-task wake while a follow-up waits, and the receipt-less case staying on "Working…". Deferred (for Brennan):
Verified. Real Claude 2.1.316 in an isolated test copy on the M4Air (QA'd head 43aafa6, main baseline 81ec82b): main "Working…" through 5-6 s auto-compactions; branch "Compacting the conversation", one turn per send, Stop in the gap → one Interrupted turn with no doubled delivery note, follow-up during compaction delivered, sidebar Working during the gap, For Brennan's review
Where judgment matters:
|
Resolve conflicts with stablyai#37409, stablyai#37546, stablyai#37724 and stablyai#38082. Main's publishClaudeTurnActivity now owns turn activity, so the transient publications class keeps only prompt suggestions (ClaudePromptSuggestions). Count suggestion publications separately in the status-feed test: Claude's first turn clears any suggestion the host retained from a previous launch.



Problem. When Claude automatically compacts a long conversation right as you send a message, a Claude chat showed a generic "Working…" for the whole compaction (often 5-15 seconds) instead of "Compacting the conversation". Claude reports compaction before it echoes your message back, and Orca only opened a turn (which is what shows activity like "Compacting") once that echo arrived, so the compaction status was dropped.
What changes for users. During that wait the chat now says "Compacting the conversation", then continues into Claude's reply in the same turn. Stopping during the wait leaves one Interrupted turn. Explicit
/compact, compaction in the middle of a reply, and ordinary sends look the same as before.Tracked in STA-9923.
How it works. Claude tells Orca when it has started working on a particular message. When a compaction status arrives for a message Claude has started, Orca opens that message's turn right away, through the same path it already uses when Claude produces output before echoing a message (for example
/goal), and shows the compaction status on it. When Claude's echo of that same message arrives, Orca keeps the turn it already opened instead of replacing it. The status clears when compaction ends. No saved fields, wire messages or client code change; the turn record is written a few seconds earlier, in a shape current and older clients already read.Stop during the compaction leaves one Interrupted turn:
Differences from the common pattern (it owns a turn from the moment input is handed to the agent):
Verification. A real Claude 2.1.316 chat in an isolated test copy with auto-compaction forced: main showed "Working…" through real 5-6 s compactions; this PR showed "Compacting the conversation", one turn per message, one Interrupted turn when stopped mid-compaction with no doubled delivery note, a follow-up sent during compaction delivered without loss, the sidebar showing Working, and
/compactand ordinary sends unchanged. Host tests replay the real frame order (compaction before the echo, zero-length compaction, Stop in both forms, a follow-up folding into the turn, a background task waking Claude while a follow-up waits, and the receipt-less case staying on "Working…").