Repository navigation
Skip command history when stopping ordinary chat replies - #34320
Conversation
|
No actionable comments were generated in the recent review.
|
|
Ordinary native-chat Stop scanned command history even though an ordinary reply could not use that evidence. The change skips that read using the existing command-turn identity check, while preserving compact first/repeated Stop behavior and the lookup before acceptance/new note. Full review: correctness and architecture reviews found no defects; the dedicated performance pass found no added scaling work or resources. No production fix was needed. Kept the single regression and compact positive-path assertion; deferred only optional fixture shortening. Verified: 64 selected host/renderer tests passed. The new regression failed before the patch, and the compact case invokes the real history reader once with the original ID and returns false before its new Stop note. A bounded production-journal benchmark at 1,000 and 10,000 representative items verified ordinary history visits fall from N to zero, for warm and cold snapshots; first/prior compact controls keep the same counts and results. This measures the history-check seam, not complete Stop latency. The changed flow is performance/tests-row: no lifecycle/ownership, agent adapter, client protocol, or screen appearance change. Real-agent app QA and screenshots were not run. No whole-Stop latency claim is made. The final mechanism review confirmed current-work identity, refusal rules, compact ordering and the existing saved/remote contracts. CI is green on e0365a8, including lint/typecheck, all five unit shards, selection evidence, Linux/Windows packaging, WSL, mobile and persistence checks. The initially cancelled PR-check workflow was completed with a failed-jobs-only retry; completed workflows were retained. The final head includes the no-conflict main merge e0365a8; the two-file branch change is identical to the reviewed production commit. For Brennan’s review: the command-only history capture and the ordinary/compact regression contracts. |
The problem
When you press Stop on a native chat while the agent is writing an ordinary reply, Orca first looked through the chat's entire message history before stopping it. That lookup only matters when the running thing is a command such as Claude's
/compact(which summarizes the conversation), where Orca needs to know whether you already pressed Stop on that command once. For an ordinary reply it could never change the answer, so it was wasted work that grew with the length of the chat.What this PR changes
/compact) still checks whether it was already stopped, at the same moment as before: before the stop is accepted and before Orca adds its new "stopped" note to the chat.How it works: before doing the history lookup, Stop now asks whether the running turn is a command, using the same check Orca already uses elsewhere to tell commands apart from ordinary replies. If it is not a command, the lookup is skipped.
What stays the same
How it was tested
/compactStop tests now also check that the lookup still runs exactly once for a command, with the right command, before the new stop note./compactStops kept the same reads and results.Tracked in STA-11949.