Skip to content

fix(remote): reopening a slept tab resumes when the other holder's agent has proven exited - #29588

Merged
nwparker merged 1 commit into
mainfrom
nwparker/resume-proven-exit-holder
Oct 16, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/resume-proven-exit-holder

Conversation

@nwparker

@nwparker nwparker commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​13 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​11
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​20 $\color{#cf222e}{\Huge{\mathbf{−}}}$​14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​6

ELI5

On a paired phone or other client, reopening a slept agent tab could give you a plain shell instead of resuming the conversation. That happened when a different pane had once held the same conversation and still had a terminal open after its agent quit. Now the tab resumes in that case.

What Changed

Before: when a paired client reopens a slept tab, the host first checks whether another pane still holds the same agent conversation, because resuming it twice would put two writers on one transcript. The check (#29272) treated any other pane with a live terminal as a holder. An agent that exits back to its shell leaves the terminal alive, so the check kept refusing even though the host's agent-status store had already proved that agent exited (#29483). The tab then opened a plain shell.

After: each candidate holder is checked against the host's agent-status store. A holder whose agent the store proves exited no longer blocks the resume. A holder that is live or unverifiable, or that has no evidence either way, still blocks it, so a dropped SSH connection is never taken as an exit.

Mechanism: isProviderSessionLiveInAnotherPane is now async and asks checkHookAgentPresence(paneKey, 0) about each pane that still holds the conversation. That call is the runtime's existing binding to the hook store's presence check and recorded exits.

Why

The agent-status store on the execution host owns agent liveness, and the runtime already reads it through checkHookAgentPresence elsewhere (PTY exit confirmation, orphan adoption). Reusing it keeps one source of truth. The alternatives were exposing agentPresence on the snapshot rows (a wider shape change that reaches every reader) or treating a PTY with no foreground agent as exited (a guess, and wrong over SSH).

Linked Issue

Follow-up to #29272 and #29483 (found in a review of today's merges).

Visual Proof

N/A: this changes host-side resume selection, which is covered by runtime tests.

Testing

  • pnpm test src/main/runtime/orca-runtime.test.ts -t "holder|another pane|hook store": new cases. A live-PTY holder whose agent the hook store proves exited now resumes (fails before the fix). An unverifiable holder still gets a plain shell. The existing holder tests still pass.

  • pnpm tc:node, pnpm run check:code-quality:changed.

  • Verified live: nothing. Verified only in tests: all of the above. A live check needs a paired client, a slept tab, and a second pane holding the same provider session whose agent has exited to its shell.

  • I manually tested these changes locally

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

Review

Codex review (gpt-6.1-sol, high): no findings.

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

SSH: for a remote-owned row, the hook store's presence check returns unverifiable unless it holds a recorded exit, so a disconnected remote holder still blocks the resume. Wire: no change. Folder workspaces: unaffected (pane-keyed).

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)

…ent has proven exited

A pane whose shell outlived its agent kept counting as the session's live
holder because its PTY was alive, so a paired client got a plain shell.
Ask the hook store: a holder it proves exited no longer blocks the resume;
unverifiable still does.
@nwparker
nwparker merged commit 17a14a9 into main Oct 16, 2026
3 checks passed
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