Repository navigation
fix(native-chat): an interrupted reply's note stops blaming the agent - #28681
Draft
brennanb2025 wants to merge 1 commit into
Draft
brennanb2025 wants to merge 1 commit into
brennanb2025 wants to merge 1 commit into
Conversation
When a reopen finds the agent process gone, or a cut turn has no note, the chat said '<Agent> stopped while this response was in progress' in error red. Every row about a reply cut with nobody asking now stores one muted body, 'This response was interrupted. You can continue in this conversation.', on the existing Orca-stop card: a known cause keeps its wording, the host's no-cause row gets Continue inside the card, and a derived note never offers a Continue the host would refuse. An older host's red reopen row reads the same on a newer client. The agent's own crash row is unchanged. Replaces part of #25670.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
When Orca quits, crashes, restarts or loses a chat's agent in the middle of a reply, the chat shows a note under the cut-off reply. When Orca could not tell why the reply stopped, that note said "Codex stopped while this response was in progress" in error red, which blames the agent for something Orca did. Now that note says "This response was interrupted. You can continue in this conversation." in the same muted card Orca already uses when it knows the cause, with the Continue button inside it.
What Changed
The problem. A native chat reply can be cut off with nobody pressing Stop: Orca quits or updates, Orca crashes, a paired server stops, or Orca reopens a chat and finds the agent process from before is gone. Main already has a muted "stop card" for the cases where Orca knows the cause ("Orca on studio-mac was closed while this response was in progress.", with Continue inside the card). But when the cause is unknown, most often when a reopen finds the previous agent process gone, the host wrote the agent-failure sentence (" stopped while this response was in progress. You can continue in this conversation.") in error red, with an "agent exited" failure attached. The transcript's own fallback note for a cut turn with no explanation used the same red sentence. Nothing had failed; the user was told the agent broke.
What the user sees now.
The mechanism.
agentSessionOrcaStopRowBody(src/shared/agent-session-orca-stop.ts) stores the neutral sentence, muted tone, the existingorca-stoppresentation, and the cause only when it is known. The quit/update row, the reopen row and the transcript's derived note all use it. It no longer stores red text or an "agent exited" failure fact for clients that predate the cause.readAgentSessionOrcaStopRowsays whether a row is the host's own stop row (cause known or not). The Continue reader the client and host share (latestNativeChatOrcaStopCut) now accepts a host row with no cause, so Continue appears on the reopen row. A transcript-derived note never counts, because the host never wrote it and would refuse the Continue.orca-stoprow with no nameable cause through the same card with a new translated sentence (orcaStopInterrupted, in all six locales), built innative-chat-orca-stop-words.tsbeside the existing cause sentences.stale-session:and that has no presentation. Main writes that prefix only for its rows about a cut. The projection shows that shape as the neutral row, without Continue, which that host would refuse.failureTextContext/agentNameplumbing that existed only for them is removed.Why
The note should say what Orca actually knows. When the cause is unknown, Orca knows only that the reply was interrupted, so it says that, neutrally, on the card that already exists for interruptions, instead of using an agent-failure sentence. Reusing main's stop card keeps one look and one Continue for every Orca-side interruption rather than adding a second notice style.
Alternatives considered:
Deviations from the common pattern (interruption by the execution host is told apart from a provider failure and shown in neutral wording):
Out of scope: the status mark mapping (Interrupted vs Failed on the sidebar, tab bar and phone) and how long settled marks stay visible. Those are the sibling PRs.
Linked Issue
Replaces part of #25670
Fixes #
Visual Proof
Pending: QA to follow
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
New: the existing "one Continue, in the card" session test now renders the real folding transcript over four cut turns: an older host's red reopen row, a known-cause quit row, the agent's own exit row, and a no-cause reopen row. It checks that every turn is collapsed, each turn has exactly one visible explanation, the known cause keeps its wording, the agent's exit stays red, the older host's row reads neutral with no Continue, and the one Continue sits inside the muted neutral card. It fails if the fold stops keeping Orca-stop rows visible.
Extended: the host test for the reopen row now checks that Continue is offered on a no-cause row the host wrote, and the transcript hook test checks that a derived note never offers Continue.
Updated existing host, shared and mobile tests from the old red wording to the neutral row. Deleted the test file that pinned "stored red for clients that predate the cause".
Ran: every test file that touches these rows (36 files, 444 tests) plus the two mobile tests.
orca-ci-checks: see the PR's CI.AI Disclosure
Review
Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)