Repository navigation
perf(terminal): bound stalled setup-split grid polling - #17228
Conversation
Greptile SummaryThis PR bounds setup-split startup-grid polling at 120 rendered frames, retaining the latest usable measurement so a permanently closed readiness gate no longer schedules layout reads indefinitely.
Confidence Score: 5/5The PR appears safe to merge because the new polling bound preserves lifecycle guards and existing geometry reconciliation paths. No concrete blocking or independently actionable non-blocking defect remains after tracing the capped readiness path through connection-time fitting, cancellation, disposal checks, and post-spawn resizing.
|
| Filename | Overview |
|---|---|
| src/renderer/src/components/terminal-pane/terminal-startup-grid-settle.ts | Adds a bounded readiness-gate polling path while preserving cancellation, liveness, ordinary settling, and downstream resize reconciliation behavior. |
| src/renderer/src/components/terminal-pane/terminal-startup-grid-settle.test.ts | Verifies that a permanently closed gate settles exactly on frame 120 with no remaining scheduled work. |
Reviews (1): Last reviewed commit: "perf(terminal): bound stalled setup-spli..." | Re-trigger Greptile
|
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 (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe startup grid settling logic now accepts Merge Risk: ⚪ Minimal · up to The change prevents stalled setup-split terminal startup from polling indefinitely while preserving normal startup and resize behavior. No actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description is detailed and on-topic. It explains the problem, solution, scope, testing, validation, AI use, and regression risk. It references issue
✨ Finishing Touches 💡 1📝 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 |
ELI5
When Orca opens a terminal beside a setup-command split, it waits for the new split's geometry before starting the terminal. If that geometry gate never became ready, Orca kept asking Chromium to measure the pane every rendered frame forever. The terminal never connected, and the layout-reading loop could keep burning renderer CPU.
This gives that gate a generous but finite budget. If it is still closed after 120 rendered frames, Orca connects with the latest usable grid and lets the existing post-spawn size reconciliation handle any later resize.
What changed
Measurement proof
The regression uses a deterministic frame scheduler, so it counts layout work instead of relying on machine timing.
expected 5, received 100).This is intentionally a rendered-frame work bound, not a wall-clock promise. Chromium may throttle or pause
requestAnimationFramewhile the window is hidden; that hidden state also does not sustain the foreground layout-reading loop this fixes.Regression proof
pnpm testacross 7 related setup-split/startup files: 88/88 passed.pnpm tc:web: passed.pnpm run check:code-quality:changed: zero code-quality, type-aware, or React Doctor findings across both files.pnpm exec oxfmt --check ...: passed for both changed files.The pre-existing healthy-gate test still holds through eight pre-ready frames and then settles on the correct post-split
88x50grid. The new test locks the permanently closed gate's exact default boundary.Electron validation
Validated in this branch's own Electron dev instance over CDP:
MAIN_STARTUP_READYin the primary pane andSETUP_SPLIT_READYin the setup pane;No visual artifact is attached because this changes failure-path scheduling, not styling or layout.
No-user-regression signoff
safeFit, and existing post-spawn reconciliation remains authoritative for later geometry changes.Merge risk
Low. Two files, one internal optional limit, and one deterministic regression test. The residual risk is a genuinely healthy setup split needing more than 120 rendered frames; the 10x readiness window plus the existing post-spawn reconcile limit the consequence to connecting with the latest usable grid instead of waiting indefinitely.
Addresses root cause #2 in #15241 without closing the broader issue.
AI disclosure
Developed and reviewed with OpenAI Codex assistance.