Repository navigation
fix(terminal): preserve remote pane output after host restart - #13158
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughPTY attachment now returns provider sequence data through the provider contract, daemon adapters, routers, and degraded-provider routing. The runtime attach path records the current output sequence and synchronizes it when the provider returns a sequence. Tests cover sequence adoption, legacy attach behavior, runtime synchronization, forwarding through daemon layers, and host-restart reconnection. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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 |
|
Follow-up path audit after review:
Fresh source audit found only three production PTY provider attach calls:
The daemon adapter is the only producer of attach sequence metadata. Local and SSH provider attach implementations remain Validation after the follow-up:
|
Summary
Fix preserved remote terminal panes that stop updating after a paired host runtime restarts while its PTY daemon survives.
The subscriber-driven daemon attach path now forwards the daemon's atomic output sequence to the runtime's existing sequence synchronizer. This keeps snapshot deduplication and subsequent live stream chunks in the same sequence domain.
No reconnect timing, retry policy, subscription lifecycle, renderer recovery, PTY recreation, terminal resize, or wire protocol behavior changes.
Root cause and reproduction
Live instrumentation on the affected pinned
milkfish/Setuppane proved:The existing provider spawn/reattach path already synchronizes this sequence. The subscriber-driven attach path used after a paired viewer reconnects called the same atomic daemon
createOrAttachoperation but discarded its snapshot sequence.The E2E regression now creates pane demand before reconnect and avoids
terminal.show, which previously exercised the already-correct ordinary reattach path and masked this failure.Screenshots
No visual change.
Testing
pnpm lint— full lint is left to CI; changed-code quality and oxlint pre-commit checks passpnpm typecheck—pnpm run typecheck:nodepassespnpm test— focused suites pass: 619 testspnpm build— the Electron E2E build and bundled CLI build passAdditional validation:
main.pnpm run check:code-quality:changedpasses with zero findings.pnpm exec oxfmt --checkpasses for all changed files.git diff --checkpasses.AI Review Report
The review traced renderer input/output through the paired runtime, multiplex stream, host runtime, daemon adapter, and surviving PTY. It checked the main regression risks: duplicate or missing bytes around the attach boundary, daemon generations, older daemon compatibility, unrelated PTY lifecycle changes, reconnect policy changes, broad fanout, and local/SSH provider behavior.
The implementation uses the daemon's existing atomic snapshot boundary and the runtime's existing synchronization function. It does not introduce polling or timers. The attach result is consumed only by the durable daemon provider; local and SSH providers continue returning no sequence.
Cross-platform compatibility was reviewed for macOS, Linux, and Windows. The change is platform-neutral TypeScript and touches no shortcuts, labels, paths, shell invocation, native module, or Electron platform branch. The reported failure was instrumented on the physical Windows paired host, and the deterministic paired Electron regression runs on the standard test topology.
Security Audit
No new external input, command execution, path handling, authentication, secrets, dependency, or renderer IPC surface is introduced. The returned value is an existing daemon-produced numeric snapshot sequence, validated by the existing synchronizer as finite and non-negative before use. No follow-up security work is needed.
Notes
outputSequencereturn no sequence and preserve existing behavior.attachcontract surface and reliance on the daemon snapshot sequence being authoritative. That sequence is already the authority used by the ordinary reattach path, and the synchronizer rejects invalid values.