Skip to content

Fix p1 remote terminal resync - #10089

Merged
AmethystLiang merged 3 commits into
mainfrom
fix-p1-remote-terminal-resync
Jul 23, 2026
Merged

AmethystLiang merged 3 commits into
mainfrom
fix-p1-remote-terminal-resync

Conversation

@AmethystLiang

Copy link
Copy Markdown
Contributor

Summary

Describe the user-visible change.

Screenshots

  • Add screenshots or a screen recording for any new or changed UI behavior.
  • If there is no visual change, say No visual change.

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • pnpm build
  • Added or updated high-quality tests that would catch regressions, or explained why tests were not needed

AI Review Report

Summarize the code review you ran with your AI coding agent. Include the main risks it checked, what it flagged, and what you changed or verified as a result.
Confirm that the review explicitly checked cross-platform compatibility for macOS, Linux, and Windows, including shortcuts, labels, paths, shell behavior, and any Electron-specific platform differences touched by this PR.

Security Audit

Provide a basic security audit summary from your AI coding agent. Call out any input handling, command execution, path handling, auth, secrets, dependency, or IPC risks that were reviewed, plus any follow-up needed.

Notes

Call out any platform-specific behavior, risks, or follow-up work.

After an untagged resync snapshot, the client resets to the snapshot's output
high-water. Buffered output generated while serializing is already included in
the snapshot, so replaying the entire buffer afterward renders those bytes
twice. Trim to output after the snapshot seq.

Tagged snapshots feed side consumers and need all buffered output unchanged.
Add exponential backoff for truncated recovery retries to avoid stampeding
flooded servers.
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Terminal snapshot replay now trims buffered output already covered by untagged snapshots while preserving full replay for tagged requests. The remote multiplexer tracks recovery sequences, suppresses duplicate output, validates recovery snapshots, and retries incomplete or failed resynchronization with timers and backoff. New tests cover replay trimming, truncated snapshots, missing end frames, held responses, JSON errors, deferred recovery, and timeout-triggered retries.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description only repeats the template placeholders and lacks actual PR content. Add concrete Summary, Screenshots, Testing, AI Review Report, Security Audit, and Notes content specific to this PR.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: remote terminal resynchronization fixes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/runtime/rpc/methods/terminal.ts (1)

471-475: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Confirm chunk.data.length === chunk.meta.rawLength before using rawLength for slicing.

getOutputAfterSnapshotSeq() subtracts meta.rawLength from chunk.meta.seq, but chunk.data.slice() indexes the actual UTF-16 length. Keep the emit/batching contract guaranteeing raw-only chunks, or split non-matching streams into OutputSpan/transformed chunks before buffering this slice.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 158e1065-9bda-42c5-8361-c9c5dbde4548

📥 Commits

Reviewing files that changed from the base of the PR and between 1d8ce38 and 5d656ae.

📒 Files selected for processing (4)
  • src/main/runtime/rpc/methods/terminal.ts
  • src/main/runtime/rpc/terminal-multiplex-resync-replay-trim.test.ts
  • src/renderer/src/runtime/remote-runtime-terminal-frame-drop-resync.test.ts
  • src/renderer/src/runtime/remote-runtime-terminal-multiplexer.ts

@AmethystLiang
AmethystLiang merged commit 1c477f9 into main Jul 23, 2026
2 checks passed
gal064 pushed a commit to gal064/orca that referenced this pull request Jul 25, 2026
* fix(terminal): resume output after recovery resync

* fix(terminal): harden recovery resync boundaries

* fix(terminal): prevent double rendering on frame-drop resync

After an untagged resync snapshot, the client resets to the snapshot's output
high-water. Buffered output generated while serializing is already included in
the snapshot, so replaying the entire buffer afterward renders those bytes
twice. Trim to output after the snapshot seq.

Tagged snapshots feed side consumers and need all buffered output unchanged.
Add exponential backoff for truncated recovery retries to avoid stampeding
flooded servers.
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* fix(terminal): resume output after recovery resync

* fix(terminal): harden recovery resync boundaries

* fix(terminal): prevent double rendering on frame-drop resync

After an untagged resync snapshot, the client resets to the snapshot's output
high-water. Buffered output generated while serializing is already included in
the snapshot, so replaying the entire buffer afterward renders those bytes
twice. Trim to output after the snapshot seq.

Tagged snapshots feed side consumers and need all buffered output unchanged.
Add exponential backoff for truncated recovery retries to avoid stampeding
flooded servers.
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.

1 participant