Skip to content

fix(runtime): resolve session tab workspace path aliases - #29543

Merged
nwparker merged 2 commits into
mainfrom
nwparker/session-tabs-windows-path-alias
Oct 16, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/session-tabs-windows-path-alias

Conversation

@nwparker

@nwparker nwparker commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​529 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​525
Prod 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​137 $\color{#cf222e}{\Huge{\mathbf{−}}}$​28 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​109

ELI5

On a Windows host, the same workspace folder can be spelled G:\git\example or G:/git/example. The host saves its tabs under one spelling. When a paired client (phone, web, or another desktop) asked for that workspace's tabs using the other spelling, the host answered "no tabs", even though the tabs and their processes were still running.

What Changed

Before: asking for a workspace's tabs by explicit id only matched the exact characters, so a separator-only difference returned an empty tab list (11 tabs vs. 0 in the report).

After: when the requested id has no exact match, the host looks for one already-known id (published tab snapshots, saved session tabs, live PTYs) that is the same workspace under the shared worktreeIdsEqual comparison, and answers with the host's own stored spelling. Tab list, activate, close, move, rename, create-and-select, subscribe/unsubscribe and terminal listing all go through this one resolver (getExplicitSessionWorktreeIdSelector).

Guard rails:

  • An exact match always wins, including an id a live PTY is registered under, so working spellings are never rewritten.
  • If more than one known spelling matches, the request fails with selector_ambiguous instead of guessing.
  • If the matched tabs' terminals belong to a different execution host than the repository (another SSH target, another runtime environment, or an unattributed remote terminal under a local repo), the request fails with worktree_execution_host_unresolved, so an alias can never adopt a foreign terminal.
  • Folder-workspace instance suffixes and repo ids still compare exactly; POSIX paths stay case-sensitive.

This is the contributor fix from #27264 by @SimonSQLML (commit cherry-picked with authorship intact), rebased onto current main, plus one follow-up commit from review: keep exact live-PTY spellings and reject unattributed remote PTYs under a local owner.

Why

The host already has the correct comparison (worktreeIdsEqual, used by path: selectors); the explicit-id fast path just skipped it. Resolving to the host's stored spelling, rather than renaming stored sessions, keeps live processes and saved state untouched and needs no Git/SSH scan during polling. Normalizing ids on clients was rejected because clients and hosts update independently: an older client would still send the old spelling.

Wire compatibility: no RPC param or stream frame changes. The only visible difference to older clients is that a reply may name the host's spelling instead of the alias they sent; mobile already reuses the returned id for follow-up calls.

Linked Issue

Fixes #27260

Visual Proof

N/A: host-side id resolution with no UI change. The issue includes the contributor's before/after screenshots from a controlled Windows-host reproduction.

Testing

  • I manually tested these changes locally

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

  • src/main/runtime/orca-runtime-session-tabs-path-alias.test.ts (new) fails on main and passes here: both slash directions, activation without a second process, early subscribers, ambiguity, cross-host refusal (SSH, runtime, unattributed remote), folder instances, POSIX case.

  • The session-tabs subscribe/unsubscribe suites were updated for the comparison-key cleanup prefix.

  • The 3 suites (80 tests) also pass natively on a Windows 11 host under Node.

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

AI Disclosure

Review

Codex review (gpt-6.1-sol, high): round 1 raised two P2s, both fixed in the follow-up commit with regression tests. Round 2 raised one P2, which was dismissed: if a host has separately stored snapshots under two spellings of the same folder, a legacy unsubscribe that sends no subscriptionId on that connection ends both streams. Both spellings name the same directory, and the client resubscribes. Fixing it would need cross-spelling subscription bookkeeping for a state the alias resolver already treats as ambiguous.

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

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)

SimonSQLML and others added 2 commits October 16, 2026 01:26
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 <noreply@anthropic.com>
…nder local owners

Addresses Codex review of the #27264 alias resolver.
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.

[Bug]: Windows remote workspace tabs disappear when explicit IDs use forward slashes

2 participants