Repository navigation
fix(ssh): saved terminal history no longer blocks a host's move to its Orca server (#30126) - #30188
Merged
Merged
Conversation
…o a big saved buffer no longer blocks a host's move (#30126)
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 2 minutes. View limit details
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. Comment |
7 of 9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
When Orca moves an SSH host's saved state onto its new Orca server, it packs everything into one signed bundle with a 768 KB size limit. Saved terminal history is supposed to travel separately, in chunks. One kind of saved terminal history (what Orca keeps when you switch away from a workspace) was packed into the bundle anyway. A few busy terminals pushed the bundle over the limit, and the host could not connect at all.
What Changed
Before: A host with a few terminals full of output failed to connect with
orcad_migration_manifest_too_large. That message said nothing about the cause or the fix. The reporter's only way out was to remove a project.After: All saved terminal history moves through the existing chunked transfer channel, so terminal output no longer counts toward the 768 KB limit. If a host's saved state is still too big for some other reason, the error names its largest parts and says what to trim. For example: "This SSH host's saved state is too large to move to its Orca server (limit 768 KB). Largest parts: saved tabs and panes (1712 KB), ... Close tabs you no longer need or remove unused projects for this host, then reconnect."
Mechanism:
terminalLayoutsByTabId[*].buffersByLeafId, and the local-onlylocalOnlyScrollbackByTabIdthat the ordinary park writes. The migration export (projectOrcadMigrationSessionScrollback) already moved the shared copy out of the manifest into scrollback snapshots, which is the channel feat(orcad-migration): a capability-gated blob channel beside scrollback (D1b-6a) #28866 built on. The local-only copy came along inline throughextractSessionOwnersForTransfer, and nothing stripped it. That inline copy is what overflowed the manifest, not the layout buffers the issue suspected. A unit repro with three large parked tabs showedlocalOnlyScrollbackByTabIdat about 1.1 MB in the manifest while the layouts were about 500 bytes.resolveLeafScrollbackBuffers). It emits one snapshot descriptor and onescrollbackRefsByLeafIdentry per pane, and dropslocalOnlyScrollbackByTabIdfrom the payload. The source's chunk reader (findSnapshotBytes) reads the same copy.orcad_migration_source_snapshot_changed. Codex caught this one.createOrcadMigrationManifestturns the bareorcad_migration_manifest_too_largeinto the actionable message above. The code stays at the end for diagnostics.Why
scrollbackRefsByLeafIdhave been part of manifest v1 since the first migration-capable server, so an older server installs these panes exactly like any other dormant pane. No new field, opcode or capability is involved.Linked Issue
Fixes #30126
Visual Proof
N/A: the change is in the main process. The only visible change is the wording of an error string, and its new text is quoted above.
Testing
src/main/persistence/migrating-orcad-catalog/orcad-source-export.test.ts:orcad_migration_manifest_too_large.src/main/ssh/orcad-migration-manifest-export.test.ts: the oversized-manifest message names its largest part and what to trim.tests/e2e/ssh-orcad-auto-convert.spec.ts: this runs in the Docker managed-orcad lane on a real sshd container with a real orcad deploy. The relay-era conversion seed now has a split terminal with two parked panes, about 900 KB of local-only scrollback in total. The test asserts that the conversion completes and that the journaled manifest carries both panes as snapshots of the seeded size, with no inline local-only scrollback.pnpm tc, all the steps of the static-analysis job (including the focus-read and layout-writer ratchets), and every test file undersrc/main/persistence/migrating-orcad-catalog,src/shared/orcad-migration*,src/main/ssh/orcad-migration*,src/main/persistence-orcad-migration*andsrc/main/persistence/moving-wsl-projects.Notes