Skip to content

fix(ssh): don't refuse a host's move over a pane that saved no terminal history - #33681

Merged
nwparker merged 4 commits into
mainfrom
fix/33471-empty-scrollback-move
Oct 26, 2026
Merged

nwparker merged 4 commits into
mainfrom
fix/33471-empty-scrollback-move

Conversation

@nwparker

@nwparker nwparker commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​132 $\color{#cf222e}{\Huge{\mathbf{−}}}$​14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​118
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​29 $\color{#cf222e}{\Huge{\mathbf{−}}}$​15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​14

ELI5

When Orca moves an SSH host onto its managed server, it brings each terminal pane's saved history along. If a pane had no saved history at all, Orca still refused the move and said it "could not read" that pane's history. Now a pane with nothing saved simply moves without history. History that exists but can't be read still stops the move, as before.

This builds on @younghwan91's fix in #33472 (their commit is kept as is, with their authorship), plus one follow-up commit.

What Changed

Before: a pane with an empty saved buffer, a snapshot file that no longer exists, or a zero-byte snapshot file made the move refuse with "This SSH host cannot move yet: saved tabs and panes (saved terminal history Orca could not read for tab ...)". Only Move anyway got past it.

After: those panes move with no history and no refusal. A snapshot that exists but can't be read (a permission error, a file locked by another process, a file over the store size limit) still refuses the move and still offers Move anyway.

Mechanism:

  • readTerminalScrollbackStoredSnapshotSync (from fix(ssh): don't refuse a host's move over a pane that saved no terminal history #33472) tells "nothing saved" ('absent') apart from "saved but unreadable" (null). projectOrcadMigrationSessionScrollback skips absent panes instead of filing them as unreadable.
  • Follow-up commit: an empty file in the primary snapshot root no longer ends the search. Orca checks the fallback root too, so history saved there is carried instead of being treated as absent and dropped from the move. The missing-file check is also done inline rather than through an import from an unrelated window module.

Why

The refusal is there so a move never silently drops history. When nothing was saved there is nothing to drop. Snapshot files are written via temp file plus rename and are never written empty, so a missing or empty file means no history survives in that root. Real read failures keep blocking, because leaving those behind would lose history the user has.

Linked Issue

Fixes #33471

Thanks to @younghwan91 for the report and the fix in #33472.

Visual Proof

N/A: no UI change. The existing refusal just stops appearing for panes with no saved history.

Testing

  • orcad-source-scrollback-state.test.ts: panes with an empty buffer, a deleted snapshot, or a zero-byte snapshot move with no blocker (fails on main). History in the fallback root is carried when the primary copy is empty or missing (fails on main and on fix(ssh): don't refuse a host's move over a pane that saved no terminal history #33472 alone). An over-limit snapshot still blocks.

  • orcad-runtime-conversion.test.ts (from fix(ssh): don't refuse a host's move over a pane that saved no terminal history #33472): the "unreadable scrollback" cases now use an over-limit snapshot as their unreadable example, since a missing file is now "nothing saved". Their assertions are unchanged.

  • ssh-orcad-legacy-relay-bridge.spec.ts: the "unreadable saved scrollback can be skipped" case seeded a missing snapshot file as its unreadable history. That failed on the Docker lane with this change, because a missing file now correctly moves without a refusal. It now seeds an over-limit snapshot, so it still covers the refusal and Move anyway.

  • Ran every test file related to the changed modules by import graph, the full static job locally, and the managed-orcad Docker e2e lane on this branch.

  • I manually tested these changes locally

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

AI Disclosure

Review

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

Desktop-side main process only, during the move's projection. No wire or protocol change, so mixed client and server versions are unaffected. The desktop's own copy of the session is untouched. SSH and WSL hosts and folder workspaces all go through the same projection. ENOENT means the same thing on macOS, Linux and Windows. A Windows file locked by another process reports EBUSY or EPERM, not ENOENT, so it still blocks.

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)

younghwan91 and others added 2 commits October 25, 2026 16:24
…al history

A pane with an empty inline buffer, a deleted snapshot, or a zero-byte
snapshot has no history to lose, but the move's projection filed it
under "saved terminal history Orca could not read" and refused the whole
host. Tell absent snapshots apart from unreadable ones and move the
former without history; unreadable history still blocks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t is empty

A zero-byte snapshot in the primary root returned 'absent' without checking
the fallback root, so a pane whose history lived there moved without it.
Also check ENOENT inline rather than importing a window staging helper.
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 861ed182-86c6-4ddf-9be3-0e6902655a46
Commits

Reviewing files that changed from the base of the PR and between e837361 and 5307ea5.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b1a07160-9dda-4ce9-a42d-c480670bcc32
Commits

Reviewing files that changed from the base of the PR and between 3aec926 and e837361.

Files selected for processing: 5
  • src/main/managed-server/lifecycle/orcad-runtime-conversion.test.ts
  • src/main/persistence/migrating-orcad-catalog/orcad-source-scrollback-state.test.ts
  • src/main/persistence/migrating-orcad-catalog/orcad-source-scrollback-state.ts
  • src/main/terminal-scrollback-snapshots.ts
  • tests/e2e/ssh-orcad-legacy-relay-bridge.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

Walkthrough

The snapshot reader now distinguishes absent saved history from unreadable snapshots and checks later configured roots when a file is empty or missing. Migration projection skips panes with no saved history while retaining blocking behavior for unreadable or oversized history. The conversion and SSH relay bridge tests now use oversized snapshots to exercise unreadable-history cases.

Fixed issue severity: <fixed_issue_severity>Low</fixed_issue_severity>

Priority: Normal

Merge Risk: Minimal · up to e8373

The reviewed change appears ready to merge after normal checks; empty inline history does not block the move or create a snapshot.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the main behavior change: a pane with no saved terminal history no longer blocks an SSH host move. The changeset matches it: absent, missing, and zero-byte snapshots now move without a…
Description check Passed The description follows the repository template closely. It has the ELI5, What Changed (before and after plus mechanism), Why, Linked Issue (Fixes #33471), Visual Proof marked N/A with a reason, Testi…
Linked Issues check Passed Issue #33471 requires panes with no saved history to move without a refusal, while existing unreadable history must still block. projectOrcadMigrationSessionScrollback skips the 'absent' result. `…
Out of Scope Changes check Passed The changed source files implement the scrollback classification and migration behavior required by #33471. The test updates cover the changed behavior and preserve unreadable-history refusal paths. T…
Full details: Title check

Explanation

The title names the main behavior change: a pane with no saved terminal history no longer blocks an SSH host move. The changeset matches it: absent, missing, and zero-byte snapshots now move without a refusal, and unreadable or over-limit snapshots still block. The title uses the conventional fix(ssh) prefix and is 79 characters, which is within a reasonable length for a single-line title.

Full details: Description check

Explanation

The description follows the repository template closely. It has the ELI5, What Changed (before and after plus mechanism), Why, Linked Issue (Fixes #33471), Visual Proof marked N/A with a reason, Testing with automated test details and checked box, Agent skill upstream boundary checked, Notes covering security, cross-platform, SSH, and backwards compatibility, and a completed checklist. Gaps: the AI Disclosure and Review sections are empty headings, and the Notes do not explicitly address mobile or performance beyond the checklist. The AI Disclosure section is optional for stablyai team members, so this gap is minor. The manual testing box is unchecked, and the author does not say whether manual testing occurred. Since the Testing section lists automated and Docker e2e runs, this is acceptable.

Full details: Linked Issues check

Explanation

Issue #33471 requires panes with no saved history to move without a refusal, while existing unreadable history must still block. projectOrcadMigrationSessionScrollback skips the 'absent' result. readTerminalScrollbackStoredSnapshotSync treats missing and zero-byte snapshots as absent, checks the fallback root, and returns null for read errors or oversized snapshots. The reported tests cover empty, missing, zero-byte, fallback, and over-limit cases.

Full details: Out of Scope Changes check

Explanation

The changed source files implement the scrollback classification and migration behavior required by #33471. The test updates cover the changed behavior and preserve unreadable-history refusal paths. The E2E update changes its fixture from a missing file to an over-limit file so it continues to test the intended blocker. No unrelated change is established.

Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

nwparker and others added 2 commits October 25, 2026 16:45
A missing snapshot file now means the pane saved no history, so the
leave-behind spec needs history that exists but cannot be read.
@nwparker
nwparker merged commit c0a51bc into main Oct 26, 2026
51 of 52 checks passed
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]: An SSH host's move to a managed server is refused over a terminal pane that saved no history

2 participants