Skip to content

Keep workspace activation and session refresh on the selected owner - #27045

Closed
nwparker wants to merge 9 commits into
nwparker/session-workspace-owner-10-09from
nwparker/workspace-activation-session-owner-10-09
Closed

nwparker wants to merge 9 commits into
nwparker/session-workspace-owner-10-09from
nwparker/workspace-activation-session-owner-10-09

Conversation

@nwparker

@nwparker nwparker commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 25 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2337 $\color{#cf222e}{\Huge{\mathbf{−}}}$​7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2330
Prod 73 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1228 $\color{#cf222e}{\Huge{\mathbf{−}}}$​262 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​966

ELI5

When paired hosts published checkouts with the same ID, opening one could select another host’s checkout and then read its files or terminals. The selected workspace now keeps its publisher, execution host and checkout instance through activation and session refresh.

What Changed

One optional checked owner extends the existing active-workspace state. Existing selectors, operation routes, watchers, persistence, reset paths and asynchronous focus guards carry that selection. Activation rechecks it before changing views or preparing terminals. Host notification, immediate inventory, subscriptions, request coalescing and bounded recovery use the existing exact identity selector and refuse a retired or ambiguous owner.

Older identity-less inventory frames remain compatible with a genuinely absent catalog or one current matching owner. Known unresolved rows cannot disappear during publisher filtering. Local structured chats use the existing local publisher mapping, and paired-status test rows now use the real catalog producer.

Why

The loss happened when readers reduced a checked selection back to a bare checkout ID or one host alias. Carrying the owner through the existing state and request boundaries repairs that loss while keeping published IDs, persistence keys and ownership stores intact.

Linked Issue

Stacked on host session ownership #27030. Internal reproducible audit; no new issue. The bounded related-work receipts and contributor ledger are retained with the review packet. No donor implementation was copied.

Visual Proof

N/A — this change adds checked selection and routing without changing renderer layout or styling. The proof exercises the actual Store and registered RPC path; no native app demo is claimed.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated

Tested tree 63eff378f106199b1b9859d1f3649f9f2a29257e is a normal stack on backend b991379fd31533b3402a785291f23e3cc30aa46e. All 29 backend files are retained exactly. Direct Node and Orca’s canonical Bun coordinator with registered Node-runtime boundaries each passed 125 suites and 1,320 checks. All three type checks, changed-file quality (98 paths, zero new findings), and diff checks passed. Web type checking used the private pinned Shiki closure with the canonical file list, compiler options and existing aliases preserved.

A separate 11-check proof includes the actual automation open action with default host notification, real client Store/activation, registered backend/controller, SQLite sessions, immediate inventory and bounded recovery. It imports the frozen automation consumer read-only; that consumer remains a separate follow-up. Provider transports, initial terminal startup and external wake/resume edges are isolated. No native PTY, app launch or desktop focus was exercised. The direct Bun attempt refused five existing Node-runtime contracts as designed; the canonical launcher then passed them.

Review

The original selected-owner and transport changes, normal source unions and final production correction were reviewed. Independent review passed 16 meaningful owner controls and verified retained source; two later redundant fixture-cast removals preserve that production and those controls. Final immutable commit review precedes publication. Original failing controls and source witnesses are retained.

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

The selected owner and persisted field are optional. Unique legacy and folder-workspace behavior remain covered. Older hosts that reject the exact selector are not retried with a bare ID; missing-identity replies refuse known ambiguous owners. No new opcode, capability, ID migration, owner registry or transport-loss process-death inference is introduced.

Checklist

  • I explained the before/after, mechanism and reason
  • N/A visual proof with reason
  • Self-reviewed for correctness, security and performance
  • Cross-platform, SSH/remote, folders and backward compatibility considered
  • Automated composition, type and quality gates pass; final review precedes publication

@OrcaWin

OrcaWin commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator

Closing as superseded. Workspace activation, file and terminal routing on main now follow the selected workspace's owner (the D4 owner-routing stack: #27176, #27218, #27278, #27279, #27283), with the owner-routing lint gate at zero. This 3,500-line draft on an unmerged stack would re-plumb the same paths a second way.

@OrcaWin OrcaWin closed this Oct 11, 2026
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.

2 participants