Repository navigation
fix(runtime): resolve session tab workspace path aliases - #27264
SimonSQLML wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Apply the execution-host boundary to live alias… · orca-runtime-resolve-browser-network-execution-host-for-worktree.ts:241-259
src/main/runtime/orca-runtime-resolve-browser-network-execution-host-for-worktree.ts:241-259
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winApply the execution-host boundary to live alias candidates.
When equivalent worktree IDs exist on different local or SSH hosts, this selector can match the foreign host because
knownIdsincludes all live tab and PTY candidates.worktreeIdsEqualdoes not compare execution hosts. Activation can therefore select the foreign tab, and the selected terminal handle routes both output and input to that foreign PTY.Filter live snapshot and PTY candidates by the requested execution host before exact-key and alias matching. Keep ambiguity handling for candidates on that host.
🟡 Minor · Re-resolve the worktree after refreshing during… · orca-runtime-perform-mobile-session-pty-records-refresh.ts:111-117
src/main/runtime/orca-runtime-perform-mobile-session-pty-records-refresh.ts:111-117
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winRe-resolve the worktree after refreshing during activation.
When no equivalent ID is known before refresh,
getExplicitSessionWorktreeIdSelectorkeeps the requested alias. The refresh can register the discovered PTY under the canonical worktree ID. Activation then looks up the snapshot with the stale alias and can throwtab_not_found.Use the same post-refresh resolution and paired-terminal restoration as listing.
Suggested fix
- const worktreeId = + let worktreeId = explicitWorktreeId ?? (await this.resolveWorktreeSelector(worktreeSelector)).id this.hydrateHeadlessMobileSessionTabsFromWorkspaceSession(worktreeId) await this.refreshMobileSessionPtyRecords(worktreeId) + worktreeId = + this.getExplicitSessionWorktreeIdSelector(worktreeSelector) ?? worktreeId + this.restoreLivePairedRendererSessionOwnedMobileTerminals(worktreeId) const snapshot = this.mobileSessionTabsByWorktree.get(worktreeId)
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
df112034-5da9-4faa-9431-a4eeb8df3d36
📥 Commits
Reviewing files that changed from the base of the PR and between acdfdaf40d987f0cc30159e5d816f42671e5f476 and c83110a18bfa5b7786afd367c6bc165bbbde94a0.
📒 Files selected for processing (1)
src/main/runtime/orca-runtime-session-tabs-path-alias.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
|
@coderabbitai run pre-merge checks Updated in 8eb02ac4 after reading the latest review and obtaining an independent Claude review before changes. Both outside-diff findings have focused follow-ups:
The four newly introduced functions and changed subscription fixture now have concise JSDoc. The coverage threshold and bot configuration are unchanged. 194 tests / 14 suites, Node typecheck, changed-code quality, and the JS app build pass. The latest development host also returns the same two existing terminals for both separator spellings in an isolated real-app RPC check. Claude's final review found no blockers. Please also reassess Severity of issue fixed as High, separately from merge risk. The reported failure blocks access to all existing conversations/terminals in an affected remote workspace: the same running Windows host returns 11 tabs for its stored ID and 0 for the alternate spelling, silently, while the processes remain alive. This prevents resuming existing work through the affected client flow. A fresh isolated comparison returns 2/0 before and 2/2 after. Host access or alternate CLI selectors bypass the lookup but do not recover that client flow. This request is scoped to the demonstrated Windows identity failure. No data loss, all-user outage, native macOS/Linux validation, or end-to-end paired-client UI recovery is claimed; the original client's outgoing request and reproducing UI screenshot remain outstanding. The PR and linked issue now state both the impact and these limits. |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
eeb754bb-93a6-4d81-a268-9623ff878b6c
📥 Commits
Reviewing files that changed from the base of the PR and between c83110a18bfa5b7786afd367c6bc165bbbde94a0 and 8eb02ac40ffecf1d24eedce9c84d19c80c93a6f2.
📒 Files selected for processing (4)
src/main/runtime/orca-runtime-perform-mobile-session-pty-records-refresh.tssrc/main/runtime/orca-runtime-resolve-browser-network-execution-host-for-worktree.tssrc/main/runtime/orca-runtime-session-tabs-path-alias.test.tssrc/main/runtime/rpc/methods/session-tabs-unsubscribe.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/main/runtime/rpc/methods/session-tabs-unsubscribe.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
|
✅ Actions performedRunning Pre-merge checks. Results will be posted in the summary comment once complete. |
|
@OrcaWin @nwparker Could you review this when you have time? Your recent session-tab recovery, host-ownership, and cross-platform work (#27094, #27246, #17159) looks directly relevant. This fixes #27260: a Windows workspace remains visible remotely, but a separator-only difference in its explicit ID hides its existing tabs. On the reported host, the stored ID returns 11 tabs while the alternate spelling returns 0. The fix reuses the existing workspace-ID comparison and preserves the host's stored identity, without adding a subsystem or migrating session IDs. Most added lines are regression tests. Please focus on alias resolution across repository, folder-instance, and execution-host boundaries, including nested SSH/runtime ownership and compatibility with macOS/Linux clients. Current head: We also documented why losing access to every existing tab in an affected workspace may warrant High issue severity; your assessment of that impact would be welcome. Thanks! CI workflow approval needed: The four GitHub Actions runs for Could either of you approve the pending workflows via Awaiting approval, then Approve workflows to run on this PR? This PR does not change any workflow files. My account has read access to the upstream repository and cannot approve these fork runs. Thank you! |
An explicit worktree ID that differs from the host's stored spelling only by Windows path separators (or another worktreeIdsEqual-equivalent form) returned an empty session tab snapshot, hiding a workspace's existing tabs from paired clients. Resolve explicit session selectors against the IDs the host already knows (published snapshots, saved session tabs, surviving renderer-owned PTYs) with the shared worktreeIdsEqual comparison, keep the host's stored spelling, reject ambiguous aliases, and refuse alias adoption across execution hosts. Session-tab subscriptions match and clean up by the normalized key. Fixes stablyai#27260 Co-Authored-By: Claude Opus 5.5 <[email protected]>
5dda2bf to
cc8bff9
Compare
…nder local owners Addresses Codex review of the #27264 alias resolver.
|
Thanks @SimonSQLML. Fork CI couldn't run here, so your commit has been carried, with you as its author, into #29543. That PR is rebased onto current main and adds one review follow-up: an exact live-PTY spelling is never rewritten, and an unattributed remote PTY under a local repository is rejected. This PR will be closed once #29543 lands. |
* fix(runtime): resolve session tab workspace path aliases An explicit worktree ID that differs from the host's stored spelling only by Windows path separators (or another worktreeIdsEqual-equivalent form) returned an empty session tab snapshot, hiding a workspace's existing tabs from paired clients. Resolve explicit session selectors against the IDs the host already knows (published snapshots, saved session tabs, surviving renderer-owned PTYs) with the shared worktreeIdsEqual comparison, keep the host's stored spelling, reject ambiguous aliases, and refuse alias adoption across execution hosts. Session-tab subscriptions match and clean up by the normalized key. Fixes #27260 Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(runtime): keep exact live PTY spellings and reject foreign PTYs under local owners Addresses Codex review of the #27264 alias resolver. --------- Co-authored-by: Simon Cho <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
|
Landed on main via #29543 with your commit and authorship intact (Co-authored-by on the squash), plus one review follow-up. Thank you, @SimonSQLML! |
ELI5
A Windows workspace can be visible remotely while all of its existing terminal/conversation tabs appear missing. If the client spells the workspace path with
/but the host stored it with\, the host currently returns an empty tab list. Resolve that spelling to the host's existing session identity so its tabs can be listed and activated.What Changed
Scope: 13 files: 10 existing production files (+138/-28 lines) and 3 test files (+512/-4). Several production files only change one selector call, and three only add the abstract declaration that main's split runtime classes need. Listing, tab actions, terminal polling, and subscription cleanup must agree on the workspace identity because clients keep sending the requested spelling.
worktreeIdsEqualcomparison.Why
The explicit-ID fast path bypasses the full selector resolver and looks up exact map keys. Reusing the existing comparison fixes that boundary without rewriting persisted/live PTY identities or adding Git/SSH scans to polling.
The requested issue severity is High: for an affected remote workspace, every existing conversation/terminal can become inaccessible even though the workspace remains visible and its processes remain alive. On the reported running Windows host, changing only separators returns 11 tabs versus 0, with a successful response rather than an actionable error. This blocks resuming existing work through the affected client flow. Host access and alternate CLI selectors are diagnostic workarounds, not recovery within that flow. No data loss or universal remote outage is claimed; the affected client's exact outgoing request remains uncaptured.
Linked Issue
Fixes #27260
Closest prior reports: #15598 (Windows slash/backslash identities; related PR #15616), #12303 (Windows path selectors), #19092 and #15710 (workspace visible but live remote tabs missing), #23429 (older live tabs omitted by another hydration path), and #10750 (folder instance identity). The implementation reuses the comparison introduced by #16494.
The related-report inventory links 37 related reports, their differences, and previous fixes. Those reports are context and regression boundaries, not additional fixes claimed by this PR.
Visual Proof
Controlled before/after reproduction with real paired Windows hosts and the same built mobile session screen. Each isolated host starts with two real terminal sessions. The screen opens the backslash alias of the stored slash ID. Before: the workspace is visible with 0 tabs. After: both existing tabs appear; list and subscription replies retain their original tab IDs.
Captured via Playwright/CDP in hidden Electron windows. A test bridge forwards the mobile screen's RPC requests and subscriptions to each real paired host, without replacing its tab responses. Only the initial route is seeded with the alternate spelling. Temporary profiles and a disposable repository keep the user's sessions untouched. This demonstrates tab recovery for the controlled alias input; it is not a capture of the original client's request, a physical-phone test, or proof of chat-transcript rendering.
To repeat: create two terminals in an isolated Windows host, obtain the stored ID via
session.tabs.listwith apath:selector, change only separators in its path portion, and open that ID in the mobile session route. Compare list/subscription tab IDs and the rendered tab count between hosts.Testing
Tested on native Windows. Direct Vitest execution passed 214 tests across 14 suites. The session-tab entry point now covers POSIX trailing/repeated slashes, macOS NFC/NFD Unicode spelling, and WSL UNC aliases, alongside the Windows regression. These include direct, layout-bound, and unpublished PTYs; both local/SSH directions; matching and different runtime environments; a same-named client SSH impostor; legitimate plain runtime handles; ambiguous ownership; and the activation publication race. They are fixture and string tests executed on Windows, not native macOS/Linux or actual SSH execution.
Also passed
pnpm tc:node,pnpm run check:code-quality:changed upstream/main, changed-file formatting, andgit diff --check. Tests run withORCA_BACKGROUND_LAUNCH=1.Also built the Electron main/preload/renderer in E2E mode, the CLI, and the paired web bundle. Rebuilt the latest Electron main and mobile web bundle; the real paired-host screen comparison above passed with 0 tabs before and 2 after. Electron 43.7.5 native preflight passed using matching native artifacts copied from the installed Orca into ignored local dependency directories. This validates that local runtime setup, not compilation of the native modules; the Visual Studio C++ toolchain is absent. No binaries or evidence scripts are committed. The standard full test wrapper, full packaged-app build, full test suite, native macOS/Linux, physical mobile devices, actual SSH, and recovery of the original incident were not validated. The rendered UI comparison was automated; the manual-testing box remains unchecked.
Rebased onto main
ebef2ea9(2026-10-15). main's runtime refactor moved 9 of the touched files intosession-tabs/,session-lifecycle/,terminal/launch/andconstruction/. The conflicts were import paths plus the newoptionsargument togetMobileSessionTabsForWorktree. The rebase is squashed into one commit. It adds a reverse-direction row (stored/, requested\, as reported in #27260 by @DaveDev42) and fails without the fix. Re-verified on macOS:pnpm tc(all projects); oxlint, anti-slop, native-plugin, type-aware and changed-code quality; the max-lines, ts-nocheck, runtime-Electron, focus-read and layout-writer ratchets; reliability gates; the RPC params catalog. The 14 suites above pass (230 tests), as does everything undersrc/main/runtime+src/shared/worktree(12,766 passed, 29 skipped, 0 failed). The visual before/after comparison was not re-captured after the rebase.AI Disclosure
Implemented with OpenAI Codex (GPT-6). Independent pre-PR review by Claude Code (claude-fable-5-1 / Claude Fable 5.1); two review passes completed before opening this PR. Rebase onto main and the reverse-direction regression row by Claude Code (Claude Opus 5.5).
Review
Claude Code independently reviewed the implementation, scope, cross-platform risks, and the follow-up review fixes. The new activation fix only repeats resolution after the await; it adds no new restoration behavior. Five short JSDoc comments document the touched selector and test helpers without changing the docstring threshold. Final follow-up review found no blocking findings.
Agent skill upstream boundary
Notes
No RPC schema changes or new client capabilities. Published/saved workspace identity remains host-owned. Alias-based terminal listings report that existing host spelling as well. The host-conflict guard applies only to newly adopted aliases with known host ownership, including encoded runtime environment IDs. Alias requests whose repository rows name conflicting hosts intentionally return
worktree_execution_host_unresolved, including initial subscription requests. Existing exact-ID, exact-empty, and unknown-evidence behavior is preserved; plain handles remain accepted under runtime owners because local connection metadata cannot establish their remote owner; this does not redesign the host-blind snapshot map. The live host's alias mismatch is reproduced; the affected client's precise outgoing request was not captured, so full incident recovery is not claimed from unit tests alone.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)