Skip to content

fix(runtime): isolate durable Active Server preference - #10010

Closed
OrcaWin wants to merge 2 commits into
fix/node-types-stat-nonnullfrom
fix/active-server-preference-isolation
Closed

OrcaWin wants to merge 2 commits into
fix/node-types-stat-nonnullfrom
fix/active-server-preference-isolation

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Jul 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Make Advanced > Active Server the only durable writer of activeRuntimeEnvironmentId.
  • Keep connect, pairing, navigation, reveal/create, browser/mobile handoff, reconnect, and cleanup on transient or target-owner routing.
  • Route a local terminal reveal by the owning workspace even after visiting Windows 2.
  • Fence stale async browser/profile results and prevent web pairing from importing a host default.

Deterministic reproduction

The regression starts with Active Server = Local desktop, connects to Windows 2, opens a Windows 2 workspace, and then reveals a local terminal. Before this change, connection/navigation could persist Windows 2 and the reveal failed with:

Local terminal reveal is unavailable while a remote runtime is active.

The new composed test repeats Local -> connect Windows 2 -> remote workspace -> local terminal reveal -> restart. Reveal succeeds and the durable preference remains Local desktop throughout. Multi-client, multi-server, browser-host overrides, pairing, generic settings writes, stale async completions, and restart are also covered.

Contract

Only the dedicated validated preference IPC, invoked by the Advanced Active Server control, can persist the setting. Workspace operations still route to their owning host without rewriting the default.

Validation

  • 9 focused files, 271 tests passed on latest main.
  • Typecheck passed before the latest locked dependency refresh. With the refreshed lockfile install, current main and this PR reproduce the same unrelated @types/node errors in src/main/ipc/worktree-common-git-directory.ts and src/main/skills/skill-installation-topology.ts; CI verify is blocked there.
  • Changed-file oxlint passed.
  • Max-lines ratchet and reliability manifest passed.
  • Full lint reaches one unrelated existing switch-exhaustiveness error in src/renderer/src/components/skills/skill-freshness-group.tsx.

Review

Manual adversarial review covered desktop/web persistence boundaries, unknown/unreachable servers, multi-client routing, stale completions, restart, SSH/WSL owner routing, and generic settings bypasses. The requested internal-review-until-clean skill was unavailable in this environment; repeated manual review passes found no remaining in-scope findings.

@OrcaWin
OrcaWin force-pushed the fix/active-server-preference-isolation branch from 9a45af0 to 404eeb3 Compare July 22, 2026 23:33
@OrcaWin
OrcaWin changed the base branch from main to fix/node-types-stat-nonnull July 22, 2026 23:33
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4338d3a4-af3f-4de6-8cd0-772410ecc7cb

📥 Commits

Reviewing files that changed from the base of the PR and between 01bcc57 and 9a45af0e746da859e6dbc6700f3ced6ba5872015.

📒 Files selected for processing (27)
  • config/reliability-gates.jsonc
  • src/main/index.ts
  • src/main/ipc/ephemeral-vm-runtime-handlers.ts
  • src/main/ipc/ephemeral-vm.test.ts
  • src/main/ipc/runtime-environments.test.ts
  • src/main/ipc/runtime-environments.ts
  • src/main/ipc/settings.test.ts
  • src/main/ipc/settings.ts
  • src/main/runtime-environment-focus-self-heal.test.ts
  • src/main/runtime-environment-focus-self-heal.ts
  • src/preload/api-types.ts
  • src/preload/index.ts
  • src/renderer/src/components/settings/BrowserPane.tsx
  • src/renderer/src/components/settings/RuntimeEnvironmentsPane.tsx
  • src/renderer/src/components/settings/Settings.tsx
  • src/renderer/src/components/sidebar/use-add-repo-host-selection.test.ts
  • src/renderer/src/components/sidebar/use-add-repo-host-selection.ts
  • src/renderer/src/components/status-bar/SshStatusSegment.test.ts
  • src/renderer/src/components/status-bar/SshStatusSegment.tsx
  • src/renderer/src/hooks/useIpcEvents.test.ts
  • src/renderer/src/hooks/useIpcEvents.ts
  • src/renderer/src/store/slices/browser.test.ts
  • src/renderer/src/store/slices/browser.ts
  • src/renderer/src/store/slices/settings.test.ts
  • src/renderer/src/store/slices/settings.ts
  • src/renderer/src/web/web-preload-api.test.ts
  • src/renderer/src/web/web-preload-api.ts
💤 Files with no reviewable changes (4)
  • src/main/runtime-environment-focus-self-heal.ts
  • src/main/runtime-environment-focus-self-heal.test.ts
  • src/main/ipc/ephemeral-vm-runtime-handlers.ts
  • src/main/index.ts

📝 Walkthrough

Walkthrough

The change introduces a dedicated Active Server preference IPC and preload API, prevents generic settings updates from mutating it, and preserves it across web runtime synchronization. Environment removal and ephemeral cleanup no longer clear the preference automatically. Renderer settings, host selection, connection flows, browser operations, and terminal creation now route by selected host or workspace ownership while keeping durable Active Server state separate. Tests and a reliability gate cover persistence, lifecycle, browser, and terminal routing behavior.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately captures the main change: isolating the durable Active Server preference.
Description check ✅ Passed The description is mostly complete and on-topic, but it omits the template's Screenshots, Security Audit, and Notes sections.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@OrcaWin

OrcaWin commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #10011, which now combines Active Server preference isolation with guarded orphan PTY adoption and targets main directly.

@OrcaWin OrcaWin closed this Jul 22, 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.

1 participant