You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Keep remote terminal input working after a failed viewport restore - #34716
A remote terminal could keep ignoring keystrokes after reconnecting, even after its size recovered. A failed passive viewport update now preserves the stream's existing input permission.
What Changed
Keep passive resize results separate from explicit viewport claims in both multiplex and legacy binary subscriptions. Preserve promise ordering, rejected explicit claims, older clients' implicit claims, and phone input locks.
Why
A reconnecting viewer can restore orphaned ownership while its layout application fails. The stream previously latched that geometry failure into a permanent false input claim, then acknowledged and discarded later keys. Successful passive resizes could not repair it.
Linked Issue
Remote-terminal report supplied for this work: intermittent inability to type.
Visual Proof
Before: the control input renders; input after a failed passive resize disappears.
(screenshot removed: contained real product data)
After: the same keyboard input renders after the resize failure.
(screenshot removed: contained real product data)
Phone ownership still blocks desktop input and shows the existing overlay.
(screenshot removed: contained real product data)
Testing
Six final RPC cases exercise the real remote desktop floor, orphan ownership restoration, refused/thrown layout, subsequent typing, explicit claim rejection, and legacy recovery; all pass. An earlier failure-injection variant failed four delivery cases on baseline. The independent real-floor baseline/target replay also reproduced dropped input before the fix and delivery after it.
Independent review passed 69 tests across seven suites, including mobile locks, claim ordering, input acknowledgements, and reconnect ownership.
Strengthened all four explicit-client failure cases to hold the passive resize pending and prove later input cannot overtake it. Six focused cases pass; removing the ordering await makes exactly those four new assertions fail, while the two legacy controls still pass.
Separate hidden Electron before/after runs used a real paired E2EE multiplex connection and actual keyboard input. A one-shot resize failure was injected at the compiled runtime boundary. Failed explicit claims still blocked; a new successful claim recovered; simulated phone ownership blocked typing.
Required local ORCA_BACKGROUND_LAUNCH=1 pnpm check:changed --maxWorkers=2: 20/21 checks passed; the unit check had 458 passing suites and 5,999 passing tests. Three cross-version suites timed out during release-source preparation, and one readiness assertion failed under the broad run; the readiness suite passed all four cases in isolation. All four initially failing suites passed in targeted reruns: readiness 4/4 and cross-version 51/51 (ORCA_DISABLE_SHARED_RELEASE_CACHE=1, one worker). The final test-only incremental gate passed all 20 checks. Initial failure logs are retained.
Final-head CI: all 43 reported checks settled successfully, including the automatically retried Debian WSL job and the retarget review.
Review
The natural failure path is same-client orphan ownership restoration, rather than an ordinary already-owned passive resize. Layout work and input ordering are unchanged. No new scans, timers, polling, subprocesses, resource owners, or wire fields. Folder workspace identity is untouched. Old-client implicit claims retain their previous behavior.
Agent skill upstream boundary
No upstream skill-installer source was copied.
Notes
Targets main after #34721 was merged. The original parent commit includes that already-merged one-line test-import repair.
Runtime proof used macOS loopback paired transport. Legacy binary delivery was exercised in automated tests. Physical SSH, native Linux/Windows, and an actual phone were not run for this case; phone ownership was simulated through the real server driver state.
Checklist
Focused fix with independent review and before/after evidence.
Cross-platform, mixed-version, mobile, cleanup, and performance behavior reviewed.
Required local affected checks, scoped reruns, final incremental gate, and final-head CI complete.
Passive resize handlers now catch viewport-update failures. When desktop viewport claims are supported, they preserve the prior claim regardless of the resize result. Tests cover standard and multiplexed subscriptions, input around refused or throwing layout updates, explicit claim recovery, and implicit-claim retry for older clients.
Priority: Normal
Merge Risk: Minimal · up to 96959
Passive resize failures preserve input permission while phone ownership still blocks desktop input. An additional transition test is recommended, but no merge-blocking risk was identified.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly and concisely describes the primary fix: preserving remote terminal input after a failed viewport restore.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The pull request description is detailed and covers the ELI5 summary, changes, rationale, testing, visual proof, review notes, compatibility considerations, and checklist. The Linked Issue section doe…
Full details: Description check
Explanation
The pull request description is detailed and covers the ELI5 summary, changes, rationale, testing, visual proof, review notes, compatibility considerations, and checklist. The Linked Issue section does not contain an actual issue link, and the AI Disclosure section is omitted, but the description is otherwise complete and directly aligned with the pull request objectives.
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 4 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches: 💡 1
📝 Generate docstrings: 💡
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.
Hold the passive resize promise before sending input.
mockRejectedValueOnce and mockResolvedValueOnce settle immediately. The test only checks the final processWrites array, so it can pass if input bypasses the passive resize tail. The multiplex test covers a pending explicit claim, but the passive resize path and the legacy handler need this ordering assertion too.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
Add coverage for ownership changes during a pending failed resize.
The binary and multiplex paths can both start desktop input while the driver is idle, wait on the pending resize claim tail, and then observe mobile ownership after the resize fails. Add a case for both multiplex values. The current tests keep the driver idle and do not detect a missing post-tail ownership check.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
Move the desktopClaimTail passive-resize rule into chainPassiveDesktopResize
so the multiplex and binary-subscribe transports use one implementation, drop
the unreachable outer catch, and pass startStream test options as an object.
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
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
A remote terminal could keep ignoring keystrokes after reconnecting, even after its size recovered. A failed passive viewport update now preserves the stream's existing input permission.
What Changed
Keep passive resize results separate from explicit viewport claims in both multiplex and legacy binary subscriptions. Preserve promise ordering, rejected explicit claims, older clients' implicit claims, and phone input locks.
Why
A reconnecting viewer can restore orphaned ownership while its layout application fails. The stream previously latched that geometry failure into a permanent false input claim, then acknowledged and discarded later keys. Successful passive resizes could not repair it.
Linked Issue
Remote-terminal report supplied for this work: intermittent inability to type.
Visual Proof
Before: the control input renders; input after a failed passive resize disappears.
(screenshot removed: contained real product data)
After: the same keyboard input renders after the resize failure.
(screenshot removed: contained real product data)
Phone ownership still blocks desktop input and shows the existing overlay.
(screenshot removed: contained real product data)
Testing
Six final RPC cases exercise the real remote desktop floor, orphan ownership restoration, refused/thrown layout, subsequent typing, explicit claim rejection, and legacy recovery; all pass. An earlier failure-injection variant failed four delivery cases on baseline. The independent real-floor baseline/target replay also reproduced dropped input before the fix and delivery after it.
Independent review passed 69 tests across seven suites, including mobile locks, claim ordering, input acknowledgements, and reconnect ownership.
Strengthened all four explicit-client failure cases to hold the passive resize pending and prove later input cannot overtake it. Six focused cases pass; removing the ordering await makes exactly those four new assertions fail, while the two legacy controls still pass.
Separate hidden Electron before/after runs used a real paired E2EE multiplex connection and actual keyboard input. A one-shot resize failure was injected at the compiled runtime boundary. Failed explicit claims still blocked; a new successful claim recovered; simulated phone ownership blocked typing.
Required local
ORCA_BACKGROUND_LAUNCH=1 pnpm check:changed --maxWorkers=2: 20/21 checks passed; the unit check had 458 passing suites and 5,999 passing tests. Three cross-version suites timed out during release-source preparation, and one readiness assertion failed under the broad run; the readiness suite passed all four cases in isolation. All four initially failing suites passed in targeted reruns: readiness 4/4 and cross-version 51/51 (ORCA_DISABLE_SHARED_RELEASE_CACHE=1, one worker). The final test-only incremental gate passed all 20 checks. Initial failure logs are retained.Final-head CI: all 43 reported checks settled successfully, including the automatically retried Debian WSL job and the retarget review.
Review
The natural failure path is same-client orphan ownership restoration, rather than an ordinary already-owned passive resize. Layout work and input ordering are unchanged. No new scans, timers, polling, subprocesses, resource owners, or wire fields. Folder workspace identity is untouched. Old-client implicit claims retain their previous behavior.
Agent skill upstream boundary
Notes
Targets
mainafter #34721 was merged. The original parent commit includes that already-merged one-line test-import repair.Runtime proof used macOS loopback paired transport. Legacy binary delivery was exercised in automated tests. Physical SSH, native Linux/Windows, and an actual phone were not run for this case; phone ownership was simulated through the real server driver state.
Checklist