Skip to content

Gate paired-runtime terminal mounts on host snapshots - #15624

Open
revofusion wants to merge 2 commits into
stablyai:mainfrom
revofusion:revofusion/fix-remote-terminal-restore-storm
Open

revofusion wants to merge 2 commits into
stablyai:mainfrom
revofusion:revofusion/fix-remote-terminal-restore-storm

Conversation

@revofusion

@revofusion revofusion commented Aug 20, 2026 •

Copy link
Copy Markdown

ELI5

Orca now waits for the current remote host's terminal list before mounting saved tabs, so dead entries cannot open duplicate shells.

What Changed

  • Gate paired-runtime mounts on a connection-matched session.tabs snapshot.
  • Keep PTY-less rows deferred across later renders.
  • Make snapshot acceptance reactive.

Why

Persisted rows mounted before the host snapshot and each mount created a remote shell.

Linked Issue

Fixes #15622

Visual Proof

N/A — this is a terminal lifecycle guard with no static visual output.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Focused Vitest: 2 files, 32 tests. Renderer typecheck and changed-file lint pass.

AI Disclosure

OpenAI Codex.

Review

Addressed CodeRabbit's reactivity finding: an empty accepted snapshot keeps stale PTY-less rows deferred on later renders.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

No PTY teardown changes. Live host shells remain mountable. Local and SSH terminals are unchanged.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • 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)

@coderabbitai

coderabbitai Bot commented Aug 20, 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 Plus

Run ID: 1a013c23-44ee-499e-a93a-7266bbf961d8

📥 Commits

Reviewing files that changed from the base of the PR and between eebf9d0 and 7070fed.

📒 Files selected for processing (4)
  • src/renderer/src/components/Terminal.tsx
  • src/renderer/src/components/terminal/background-terminal-worktree-mount.test.ts
  • src/renderer/src/components/terminal/paired-runtime-terminal-mount.ts
  • src/renderer/src/runtime/web-session-tabs-sync.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Terminal startup now reacts to accepted web-session snapshot revisions and validates snapshots against runtime connection identity. It identifies terminal tabs owned by the active paired runtime environment. While the host snapshot is unavailable, it resets activation planning and restricts mounts to host-recognized tabs. The new restriction helper updates allowed and deferred tab state. Tests cover snapshot authority and empty host snapshots.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.25% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes implement issue #15622 by waiting for connection-matched accepted snapshots before mounting restored paired-runtime terminals.
Out of Scope Changes check ✅ Passed The code and test changes are focused on host snapshot gating and reactive paired-runtime terminal restoration.
Title check ✅ Passed The title clearly and concisely describes the main change: gating paired-runtime terminal mounts on host snapshots.
Description check ✅ Passed The description covers the required sections, explains the change and rationale, links issue #15622, and documents testing and checklist status.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d58e5781-fd05-4094-b841-7a3b4b59c58b

📥 Commits

Reviewing files that changed from the base of the PR and between d8e9fa1 and eebf9d0.

📒 Files selected for processing (5)
  • src/renderer/src/components/Terminal.tsx
  • src/renderer/src/components/terminal/background-terminal-worktree-mount.test.ts
  • src/renderer/src/components/terminal/background-terminal-worktree-mount.ts
  • src/renderer/src/runtime/web-session-tabs-sync-terminal-bootstrap.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

This branch has not been deployed

No deployments
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.

Opening a paired-runtime workspace can respawn every stale terminal

1 participant