Repository navigation
fix(ssh): don't refuse a host's move over a pane that saved no terminal history - #33681
Conversation
…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.
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
A missing snapshot file now means the pane saved no history, so the leave-behind spec needs history that exists but cannot be read.
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).projectOrcadMigrationSessionScrollbackskips absent panes instead of filing them as unreadable.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
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
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)