Repository navigation
perf: avoid unused terminal reads in client snapshots - #4847
Conversation
|
@coderabbitai review |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (8)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughPane metadata lookup now omits scroll metrics, while pane information continues to include them. Session snapshots gather panes from tab layouts, and client-shell snapshots use session metadata. The snapshot encoding benchmark reports construction and total timing statistics and can write output to hidden workspaces. Suggested reviewers: Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The snapshot change preserves pane contents while avoiding unused scroll-metric reads in client-shell snapshots. No identified issue prevents merging after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The inspected changes preserve public response behavior and existing access scope while avoiding unnecessary reads. No new security issue was established, but review coverage is limited. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
✅ Action performedReview finished.
|
|
|
CodeRabbit's docstring-coverage warning was reviewed. The touched methods are internal Rust metadata collectors, existing benchmark/test helpers, and test-only counters. The change does not add a public API or alter the wire contract; the existing owning regression test proves scroll preservation and projection parity. Expanding comments to satisfy a percentage threshold would add unrelated boilerplate, so the warning is left as a documented non-blocking disposition. Both bots completed on f36063c with no actionable code findings. |
|
@coderabbitai review |
|
|
full review after rebase |
|
✅ Action performedFull review finished. |
|
Note on the Greptile find: Confirmed this and sending a follow up. |
(cherry picked from commit 5d78d05)
Client shell snapshots built full public pane responses for every pane and again for agents, reading terminal scrollbars these projections discard. Share pane metadata extraction and add scroll enrichment for public pane/session responses. Retain rendered pane-surface scroll data and existing snapshot contents, focus, IDs, and completion sequences.
Performance
Construction-only microbenchmark, in microseconds: fixed 120x40 terminal geometry, 1/15/118 populated agent panes, 1/2 client encoding fanout, 5 warmups and 40 measured samples per case. Each value below is the median of two run medians from saved parent/candidate executables run in baseline/candidate/candidate/baseline order. The existing
just bench-render-scalerecipe reaches the actualsnapshot_with_completionspath; both versions passed it.Negative time changes mean less construction time. One-pane values are near the timer's microsecond rounding; 15-pane results are neutral/mixed, including no measured hidden-output gain. The background cases have one active workspace plus N-1 hidden workspaces; N=1 is a no-hidden-pane control. Hidden bytes are injected sequentially into those hidden workspaces before the timer starts. Client counts cover encoding fanout after the construction timer stops. These controlled in-process results do not establish sustained-writer contention, live-client behavior, an incident fix, or a production CPU reduction.
For N agent panes, the previous shell path performed 2N discarded scrollbar reads: 2/30/236 reads at 1/15/118 panes. The new path performs zero. The regression test counts actual terminal scroll reads, checks public session scroll values, and checks metadata/shell/completion output parity.
Validation
just bench-render-scalepassed (6 matching manual profiles each); paired saved-executable measurements also passed.just checkpassed (formatting, all-target clippy, 3336 Rust tests with 11 configured skips, maintenance tests, and build). The first full run timed out on a 100 ms oversized-paste notification expectation; focused retry and the full retry passed. The cause remains unproven.--mode fast: clean dual signoff,rvw_bc760932complete. GitHub CI passed on f36063c (Linux/macOS/Windows, ConPTY package, contribution and conventional-commit checks). Greptile approved that head (5/5); CodeRabbit completed that head with no actionable comments. Its non-blocking docstring-coverage warning was reviewed and declined in a documented PR disposition.