Skip to content

fix(native-chat): keep a chat's Failed / Interrupted mark on the worktree card and tab past 30 minutes - #28672

Closed
brennanb2025 wants to merge 1 commit into
mainfrom
brennanb2025/native-chat-mark-outlives-window
Closed

brennanb2025 wants to merge 1 commit into
mainfrom
brennanb2025/native-chat-mark-outlives-window

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​35 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​35
Prod 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​41 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​37

ELI5

When a chat in the native chat view ends badly (you pressed Stop, the agent failed, or Orca couldn't confirm how the reply ended), the worktree card in the sidebar and the chat's tab show a mark for it: Interrupted, Failed, or Couldn't confirm. On desktop that mark quietly disappeared about 30 minutes later, even though nothing about the chat had changed. The agent row under the card and the phone kept showing it. Now the card and tab keep it too, until the chat's next turn changes it or you close the chat.

What Changed

The problem. The desktop worktree card and the tab bar stop trusting an agent's status row once its evidence is 30 minutes old. That rule exists for terminal agents: they report status through hooks, and if the agent process dies without a last report, an old "working" row would otherwise spin forever. Native chat rows don't work that way. The machine running the chat (the "host") rebuilds the row from the chat's saved history every time it changes, and publishes it again after Orca restarts. A settled result like "you stopped this reply" is still true an hour later. But the 30-minute rule applied to it anyway, so:

  • Before: you stop a native chat reply, walk away, and after ~30 minutes the card and tab lose the Interrupted mark. They show nothing, while the agent row under the card and the phone still say Interrupted.
  • After: the card and tab keep showing Interrupted (or Failed, or Couldn't confirm) until the chat's next turn replaces it or the chat is closed. A clean finish still fades after 30 minutes, as before.

The mechanism.

  • The host already labels every native chat row with where it came from (structuredHost). The renderer's status bridge for native chats (StructuredAgentSessionStatusBridge) now copies that label onto the row it writes into the renderer's status store. Nothing new is saved to disk and nothing new crosses the wire: the bridge derives the label from a field the host already sends (hostExecutionOwned).
  • A new check, isSettledNativeChatVerdict (src/renderer/src/lib/pane-agent-evidence.ts), recognizes a native chat row that is finished and carries a bad-ending result. The worktree card and the tab bar now show a row when it is fresh or passes that check (isAgentStatusShownOnDot).
  • Nothing else uses the new check. Terminal-agent rows, live work, and the shared freshness check used for subagents, attention sorting and cleanup behave exactly as before. The order in which the card picks which status to show among several agents is also unchanged.

Why

The 30-minute window answers "is this report still current?" For a hook stream that can go silent, age is the only signal. For a native chat row, the host keeps the row current itself, so age says nothing. The chat's next turn or closing the chat is what ends the mark, and both already replace or remove the row. That means nothing new can strand: no flag is stored, and the existing replace and remove paths are what clear it.

Alternatives considered:

Design choices:

  • Intended: a native chat's sidebar status comes from its current saved state, with no time-based expiry for bad-ending marks. It keeps the 30-minute expiry for terminal-agent rows, because those come from a hook stream that can go silent without a final report.
  • Intended: while the status connection to a remote host is down, the card keeps the chat's last settled mark. Losing contact is not evidence that the chat changed, and the agent row under the card behaves the same way.

Linked Issue

Replaces part of #25670

Fixes #

Visual Proof

Pending: QA to follow

Testing

  • StructuredAgentSessionStatusBridge.test.tsx: one test of the whole path, from the host's status, through the bridge and the store, to the worktree card summary and the tab status. A chat stopped more than 30 minutes ago still shows Interrupted on both. A terminal agent's row of the same age still expires. A new turn then replaces the mark with Working. The test fails on main (the tab reads inactive instead of interrupted) and passes with this change.

  • Existing card, tab-bar and freshness tests pass unchanged.

  • Platforms: macOS, unit tests only. No platform-specific code. For SSH and remote hosts the bridge runs in the local window either way, and the host field it reads already exists on every host version that publishes native chat status.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

  • Mobile: unaffected. The phone already keeps the mark.
  • Mixed versions: nothing on the wire changes.
  • Performance: one extra cheap check per stale row, inside loops that already run per status update.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

… tab past 30 minutes

A native chat's row is re-derived by its host from the chat's journal, so its
Failed / Interrupted / Couldn't confirm mark no longer ages out of the desktop
card and tab bar; the next turn or closing the chat clears it. Terminal-agent
rows and clean finishes keep the 30-minute window.
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Fixed on main by #28686.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant