Repository navigation
Conversation
Extend @bbingz's runtime-owner matrix with folder workspaces, active-runtime global fallback (paired client), and re-entrant activation/startup races. Convert the handoff repro into a source-level regression guard that asserts the choke-point gate remains present.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds a runtime-ownership gate to 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Associating this PR with related issue(s): #8871 |
|
Related to #9952 (sessions vanishing over remote Orca link). |
|
Associating this PR with related issue(s): #8871 |
|
Closing as superseded — the linked issue(s) for this PR were fixed by another change that has already been merged.
Superseding merge: #9687 Thank you for the contribution! If anything remains unaddressed, please open a new issue or PR against current |
Description
Fixes #8878. A paired remote client (web client or a second Orca desktop) could launch
codex resume <id>/claude --resumefor agent sessions that are still alive and daemon-backed on the host, spawning a second TUI on the same provider session. The client-side resume pass runs before the async session-tabs mirror arrives, and every guard reads client-local state, so a live host session is invisible to it.resumeSleepingAgentSessionsForWorktreenow short-circuits when the target worktree is runtime-owned (host-authoritative) — the same host-authority predicate the plain-terminal auto-create gate already uses inTerminal.tsx(isWebRuntimeSessionActive(getRuntimeEnvironmentIdForWorktree(...))), applied at the single choke point that covers activation, startup hydration, and background wake. The host renderer keeps wake authority (its worktrees are not runtime-owned there); local, SSH, and WSL worktrees are unaffected.Credit: Core fix and original runtime-owner matrix by @bbingz in #8887 (cherry-picked and rebased onto current
main). This PR takes over that approach with adversarial coverage (folder workspaces, active-runtime global fallback, re-entrant activation/startup races) and the handoff-branch repro flipped into a positive regression guard.Evaluated and not used: #9074 (
@brennanb2025) — unrelated AskUserQuestion amber-status linger work; no overlap with the resume ownership gate.Deliberate follow-ups tracked in #8878 (out of scope here): host-side provider-session dedup in
terminal.create, and retiring resume records on tab close. Interaction with #8871: mirror-echo kills currently convert live sessions into pending duplicate resumes — this PR stops the duplicate-resume half on clients.Evidence
tabsByWorktree/ claim maps; host tabs arrive async via session-tabs mirror.src/renderer/src/lib/resume-sleeping-agent-session.ts— early return whenisWebRuntimeSessionActive(getRuntimeEnvironmentIdForWorktree(...)).pnpm exec vitest run --config config/vitest.config.ts \ src/renderer/src/lib/resume-sleeping-agent-session-runtime-owner.test.ts \ src/renderer/src/lib/repro-8878-remote-resume-no-runtime-gate.test.ts \ src/renderer/src/lib/resume-sleeping-agent-session.test.ts \ src/renderer/src/lib/resume-sleeping-agent-session-replay.test.ts \ src/renderer/src/lib/resume-sleeping-agent-session-suppress-navigation.test.ts \ src/renderer/src/lib/wake-sleeping-agents-in-background.test.ts \ src/renderer/src/lib/worktree-activationexpected 1 to be +0(client resumes a live host session); with the gate, all pass.runtime:*worktree / repo host → skiplocal/ssh:*/ WSL-local → still resumefolder:*workspace keys via runtime project groupELI5
When you open a worktree from another computer that's connected to your main Orca machine, that remote computer used to try to "wake up" agent sessions it thought were asleep. But those sessions were still running fine on the main machine — so you got two chat windows fighting over the same agent. Now the remote computer knows "this worktree belongs to the host machine" and leaves wake-up to the host, same rule we already use for not auto-creating extra empty terminals.
User-regression-tradeoffs
origin:live/quitrecords for host sessionsterminal.createprovider-session dedup