Repository navigation
fix(remote-terminal): draw the host's saved screen when a reattached pane's first image is blank - #29261
Merged
Conversation
… replays no image A remote pane that reattached to an idle long-lived agent and received an empty (or over-limit) initial snapshot never asked the host again, so it stayed blank with only a cursor until the agent printed something. Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
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 4 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 |
…-pane # Conflicts: # src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
nwparker
force-pushed
the
nwparker/remote-blank-pane
branch
from
October 16, 2026 00:12
0afa2d0 to
392004d
Compare
This was referenced Oct 26, 2026
This was referenced Nov 5, 2026
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
Sometimes a terminal on a remote Orca machine opens as a blank pane with just a cursor, even though the machine still has the full screen. This happens most with agent sessions that have been sitting idle for a long time. The pane was waiting for the agent to print something new, and an idle agent never does. Now, if the first picture of the screen the pane receives is blank, the pane asks the remote machine for its saved copy and draws that.
What Changed
Before: you click an existing remote session and see a blank pane with a cursor in the top-left. Resizing, switching tabs and restarting the client don't help, because each reattach takes the same path. Closing the tab and starting a new session is the only way back.
After: the pane draws the screen the remote machine has saved, using the same request the pane already makes after a dropped connection.
Mechanism (
remote-runtime-pty-transport.ts, inonSubscribed): when a pane attaches, the remote machine pushes an image of the screen. Three kinds of image left the pane with nothing to draw:In all three cases the pane only asked for the saved screen when it was recovering from a dropped connection, never on a first attach. It now asks whenever the first image had nothing visible. The one exception is a terminal this pane has just created: a brand-new shell has no history, so there is nothing to fetch. The request goes through the existing
onStreamRecoveredpath, so a hidden pane waits until it is shown before drawing.Why
The remote machine's saved screen is the most complete copy it has. The pushed image comes from whichever copy the machine reaches first, and that copy can be a partial one that holds only the bytes received since the reattach. The reporter of #21208 measured exactly this: the machine sent an empty image for one blank pane, while
orca terminal read --screenreturned the full frame. Asking for the saved screen when the image is empty fixes this on the client, so it also works with older remote hosts.Alternatives I considered:
Linked Issue
Related: #18464, #21208, #23884. This fixes the "first image was empty or blank" path behind these reports. I'm not marking them fixed, because none of them comes with a reproduction that shows this was their only cause:
orca serverestart report, the host image may have contained visible text from a partial host copy. This PR doesn't cover that case.Visual Proof
N/A: the bug needs a long-idle agent on a paired remote host whose host copy is partial, and I can't reproduce that on demand. The new transport tests drive each first-image shape through the real transport and the real frame decoder.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
New
remote-runtime-pty-transport-empty-initial-snapshot.test.tscovers both reattach paths (attachwith a persisted handle, andconnectto an existing terminal). It checks an empty image, a control-code-only image, and an image over the 2 MiB limit, and that each one requests the saved screen. It also checks that an image with visible text and a freshly created terminal make no extra request. With the source change reverted, the empty, control-code-only and over-limit cases fail.pnpm test src/renderer/src/components/terminal-pane src/renderer/src/runtime: everything passed except timeouts. Under a load average above 60,remote-snapshot-alt-screen-host-chainand the type-ahead / pairing-rotation files time out on unmodifiedmainas well, and they pass when the machine is idle.pnpm tcandpnpm run check:code-quality:changedpass.AI Disclosure
Review
Codex review (gpt-6.1-sol, high effort) on the branch found no issues.
Agent skill upstream boundary
Notes
onSubscribed.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)