Repository navigation
Conversation
|
Important Review skippedWe couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting You can disable this status message by setting the Use the checkbox below for a quick retry:
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
🔇 Additional comments: 27
src/main/terminal-scrollback-snapshot-nonblocking-reads.ts: 1
1-71: LGTM!src/main/terminal-scrollback-snapshots.ts: 1
57-60: LGTM!Also applies to: 125-129, 267-272
src/main/persistence/loading-store/session-host-partitions.ts: 1
119-139: LGTM!src/main/persistence-workspace-session-scrollback.test.ts: 1
413-418: LGTM!src/main/persistence/migrating-orcad-catalog/orcad-source-scrollback-cleanup.ts: 1
17-17: LGTM!src/main/ipc/session.ts: 1
78-86: LGTM!src/preload/api/session-bridge.ts: 1
13-15: LGTM!src/preload/api/workspace-session-api.ts: 1
25-26: LGTM!src/renderer/src/web/preload-api/web-workspace-session-api.ts: 1
88-90: LGTM!src/shared/rpc-contract/session-terminal-scrollback-params.ts: 1
1-11: LGTM!src/shared/session-tabs-runtime-capabilities.ts: 1
10-18: LGTM!src/main/runtime/runtime-store-contract.ts: 1
56-57: LGTM!src/main/runtime/host-terminal-scrollback-read.ts: 1
1-57: LGTM!src/main/runtime/orca-runtime-migration-catalog.ts: 1
157-177: LGTM!src/main/runtime/rpc/methods/session-terminal-scrollback.ts: 1
1-13: LGTM!src/main/runtime/rpc/methods/index.ts: 1
75-75: LGTM!src/main/runtime/runtime-rpc/runtime-rpc-mobile-method-routing.ts: 1
166-166: LGTM!src/main/runtime/rpc/methods/session-terminal-scrollback.test.ts: 1
1-29: LGTM!src/main/runtime/host-terminal-scrollback-read.test.ts: 1
1-135: LGTM!src/renderer/src/runtime/runtime-compatibility-cache.ts: 1
1-130: LGTM!src/renderer/src/runtime/runtime-rpc-client.ts: 1
12-26: LGTM!Also applies to: 103-104, 120-120, 149-150, 167-167
src/renderer/src/runtime/runtime-rpc-client-capability-peek.test.ts: 1
1-71: LGTM!src/renderer/src/runtime/host-terminal-scrollback-hydration.test.ts: 1
1-234: LGTM!src/renderer/src/components/terminal-pane/use-host-terminal-scrollback-hold.ts: 1
1-35: LGTM!src/renderer/src/components/terminal-pane/use-host-terminal-scrollback-hold.test.ts: 1
1-53: LGTM!src/renderer/src/components/terminal-pane/TerminalPane.tsx: 1
2-18: LGTM!src/renderer/src/runtime/host-terminal-scrollback-hydration.ts-99-117: 1
99-117: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.Do not cache
localSnapshotRefspermanently.
localSnapshotRefsstores a positive result and never removes it. A local snapshot can disappear later in the same renderer session. The orcad migration cleanup deletes local copies of host-run panes, and the comment atorcad-source-scrollback-cleanup.tsLine 17 says those panes recover from the host. If a ref was cached before that deletion,planHostScrollbackHydrationstill skips the leaf. The pane then mounts with no history and does not ask the host.The cached stat is cheap to repeat because the plan runs only for leaves with no PTY and no buffer. Remove the cache, or remove a ref from it when the local read returns null.
Proposed fix
function hasLocalSnapshotCached(ref: string, deps: HostTerminalScrollbackHydrationDeps): boolean { - if (localSnapshotRefs.has(ref)) { - return true - } - if (!deps.hasLocalSnapshot(ref)) { - return false - } - localSnapshotRefs.add(ref) - return true + return deps.hasLocalSnapshot(ref) }
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
aa9ecf77-dd87-467f-b2c8-24acfd423466
⛔ Files ignored due to path filters: 1
src/shared/rpc-contract/rpc-params-catalog.generated.tsis excluded by!**/*.generated.*
📒 Files selected for processing: 27
src/main/ipc/session.tssrc/main/persistence-workspace-session-scrollback.test.tssrc/main/persistence/loading-store/session-host-partitions.tssrc/main/persistence/migrating-orcad-catalog/orcad-source-scrollback-cleanup.tssrc/main/runtime/host-terminal-scrollback-read.test.tssrc/main/runtime/host-terminal-scrollback-read.tssrc/main/runtime/orca-runtime-migration-catalog.tssrc/main/runtime/rpc/methods/index.tssrc/main/runtime/rpc/methods/session-terminal-scrollback.test.tssrc/main/runtime/rpc/methods/session-terminal-scrollback.tssrc/main/runtime/runtime-rpc/runtime-rpc-mobile-method-routing.tssrc/main/runtime/runtime-store-contract.tssrc/main/terminal-scrollback-snapshot-nonblocking-reads.tssrc/main/terminal-scrollback-snapshots.tssrc/preload/api/session-bridge.tssrc/preload/api/workspace-session-api.tssrc/renderer/src/components/terminal-pane/TerminalPane.tsxsrc/renderer/src/components/terminal-pane/use-host-terminal-scrollback-hold.test.tssrc/renderer/src/components/terminal-pane/use-host-terminal-scrollback-hold.tssrc/renderer/src/runtime/host-terminal-scrollback-hydration.test.tssrc/renderer/src/runtime/host-terminal-scrollback-hydration.tssrc/renderer/src/runtime/runtime-compatibility-cache.tssrc/renderer/src/runtime/runtime-rpc-client-capability-peek.test.tssrc/renderer/src/runtime/runtime-rpc-client.tssrc/renderer/src/web/preload-api/web-workspace-session-api.tssrc/shared/rpc-contract/session-terminal-scrollback-params.tssrc/shared/session-tabs-runtime-capabilities.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
371a5d0 to
9b87fc4
Compare
b86fcc6 to
2e3663b
Compare
f24ad83 to
d034364
Compare
326cf4f to
50762d2
Compare
d034364 to
b303971
Compare
… scrollback, and never read bytes in render (D1b-6d-1)
…the focused one (D1b-6d-1)
…e the shared RPC error check, after main moved both (D1b-6d-1)
50762d2 to
c9acece
Compare
b303971 to
4a74631
Compare
|
Contained in the dark landing PR #34059 (its head commit is an ancestor of the landing branch). Closing in favour of it; branch kept. |
Shared paths this PR touches
TerminalPanecan hold mount for up to 3 s, but only when the tab's own host is already known to serve scrollback reads.runtime-compatibility-cache.ts, moved fromruntime-rpc-client.tswith re-exports): it now also remembers "unsupported" for the peek. Async callers are unchanged.session.readTerminalScrollback) and its phone routing.session:has-terminal-scrollback-syncon the desktop, and a stub in the web preload.getExplicitRuntimeEnvironmentIdForWorktree(owner-only, never the focused host). That keeps the focus-read ratchet at baseline.ELI5
A terminal pane on a remote Orca host shows its earlier output by replaying a saved copy. Today the app reads that copy only from this computer's disk. After a WSL project moves to its WSL host, this computer's copy is eventually cleaned up, and so it is for a web client that never had one. Either way the pane comes back empty. This PR lets the app ask the host for the saved copy when the local one is missing. Panes on hosts that don't support the new request open exactly as before, with no added wait.
What Changed
This is step D1b-6d-1 of the lossless WSL project mover. It also helps converted SSH hosts and web clients.
On the host:
session.readTerminalScrollbacktakes{worktree, ref}and returns{buffer}, the same tail the desktop's own read returns.workspacepermission.refmust look likev1-<32 hex>.terminal_scrollback_not_found, so a caller can't probe for refs in another workspace.session.terminal-scrollback-read.v1and routed for phones; the params catalog is updated.On the client:
Why
The move hands a pane's tabs to its host, and cleanup then deletes this computer's copy of the scrollback. Without a host read, moved panes would lose their history. A capability-gated method is the only way that's safe with mixed versions. Older hosts never get the call, and older clients never make it.
The client waits only when the host is known to serve the read. Waiting on every remote pane while checking would have added up to 3 seconds to many pane mounts, especially for web clients.
Linked Issue
N/A (maintainer; tracked in the WSL-via-orcad implementation tracker, step D1b-6).
Visual Proof
N/A: no new UI. The existing "Restoring terminal…" placeholder may show briefly when a host serves a missing copy.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Host:
Registration: the method is registered once, the capability is advertised, and the params schema rejects malformed refs.
Client:
Cache: the capability peek, the cached old-host answer, and async callers still re-checking.
Checks:
pnpm tc:node,pnpm tc:web, both oxlint configs, and the changed-code quality gate pass. One test failed in a full run and passed when rerun alone:structured-agent-shell-environment.test.ts(14/14 alone).End-to-end: not added yet. The scenario only exists once the move's desktop rewrite (D1b-7) moves tabs off the local partition, so it will come with that step.
Adversarial review: found one HIGH issue (hold latency before the capability was known) and five MEDIUM/LOW issues, all fixed here:
AI Disclosure
Review
Agent skill upstream boundary
Notes
This touches every remote-runtime pane: SSH-converted hosts, paired runtimes and WSL hosts. Hosts without the capability behave exactly as before, with no hold and no extra request per tab.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)