Repository navigation
fix(terminal): keep Pi input visible in open synchronized frames - #21708
Conversation
Place the existing SAFETY lint directive directly on the private xterm state assertion so the repository quality gate recognizes the reviewed test-only cast.
There was a problem hiding this comment.
Important
One clear regression: the new unconditional onParsed key silently drops the live-startup-batch parse callback. There is also a frame-close timing change worth confirming.
Reviewed changes
- Interactive present for open DEC 2026 frames —
direct-ssh-retry-status.ts,connect-pane-pty.ts,write-pty-output-to-xterm.ts: input sent while a synchronized foreground frame is open setssynchronizedForegroundInteractivePresentPending; the next foreground write carries anonParsedthat callsforceFullViewportPresent, drivingrenderer.renderRowsso the typed composer repaint is presented while DEC 2026 is still held. - Bounded hold extension —
pane-terminal-foreground-queue-state.ts,pane-terminal-output-queue-registry.ts:scheduleForegroundHoldSafetynow capturesforegroundHoldSafetyDelayMsbeforeclearForegroundHoldSafetyresets it (preserving the writer's latency-sensitive 32ms), andforegroundHoldSafetyExtendedallows only one deadline extension per episode. - Tests — a renderer regression that types after a synchronized frame is open and asserts the echo is presented, plus a scheduler test pinning the shortened hold. I confirmed both fail with the corresponding pre-PR logic restored.
ℹ️ Real Windows host verification is still outstanding
The behavior is gated to native Windows ConPTY (shouldProtectNativeWindowsSynchronizedOutput) and depends on real ConPTY chunk splitting plus xterm's renderer; the new renderer test fabricates xterm's private _core/_renderService/_renderer internals rather than exercising a real host. The PR body already flags this, so the win-lowspec check should land before merge rather than after.
ℹ️ Nitpicks
- The new scheduler test pins the one allowed extension but not the clamp that follows it. A third
holdForegroundwrite would exercise themayExtend === falsebranch this PR adds.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
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⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe PTY connection records input during an active synchronized foreground frame. Parsed output can trigger a full viewport presentation while preserving startup callbacks. The foreground queue records hold extensions, transfers recent safety-flush state to new entries, and limits repeated extensions. Tests cover synchronized-frame repainting, callback composition, early flushing, and bounded frame closing. Priority: ➖ Normal 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 1d0cfcd9-f4f1-417c-990d-d8d57984cad3
📒 Files selected for processing (8)
src/renderer/src/components/terminal-pane/pty-connection-pi-synchronized-input.test.tssrc/renderer/src/components/terminal-pane/pty-connection/connect-pane-pty.tssrc/renderer/src/components/terminal-pane/pty-connection/direct-ssh-retry-status.tssrc/renderer/src/components/terminal-pane/pty-connection/write-pty-output-to-xterm.tssrc/renderer/src/lib/pane-manager/pane-terminal-foreground-queue-state.tssrc/renderer/src/lib/pane-manager/pane-terminal-output-queue-chunks.test.tssrc/renderer/src/lib/pane-manager/pane-terminal-output-queue-registry.tssrc/renderer/src/lib/pane-manager/pane-terminal-output-scheduler-synchronized-frames.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.
|
CI verification update: all changed-area checks and 7/8 Node 24 shards passed. The remaining Node 24 shard failed in the unrelated pre-existing |
1669b51 to
bb44880
Compare
There was a problem hiding this comment.
Caution
The new write-pty-output-to-xterm-startup-callback.test.ts fails two required checks on bb44880: typecheck (TS2339) and static analysis (two typescript/consistent-type-assertions findings). The production changes look sound — the test fixture needs a typed method before this can land.
Reviewed changes
- Composed the startup-timing and interactive-present
onParsedcallbacks inwrite-pty-output-to-xterm.ts, fixing the earlier override that silently dropped the live-startup-batch parse callback, and added a test pinning both. - Added
inheritRecentForegroundSafetyFlushinpane-terminal-foreground-queue-state.ts: a latency-sensitive safety flush is recorded and a subsequently created coalesce entry inherits the flushed deadline, so a frame-close chunk drains immediately instead of taking the 1s fallback. Wired throughpane-terminal-output-writer.tsand pinned by a scheduler test. - Placed the existing
SAFETYlint directive directly on the private xterm state assertion in the Pi synchronized-input test.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| entry.foregroundHoldSafetyTimer = null | ||
| entry.foregroundHold = false | ||
| clearForegroundCoalesce(entry) | ||
| if (entry.foregroundHoldSafetyDelayMs <= LATENCY_SENSITIVE_FOREGROUND_HOLD_SAFETY_DELAY_MS) { |
There was a problem hiding this comment.
The flush is recorded only when foregroundHoldSafetyDelayMs <= LATENCY_SENSITIVE_FOREGROUND_HOLD_SAFETY_DELAY_MS, so a normal 250ms hold that flushes still hands a following close chunk the full 1s coalesce — the non-latency reproduction from the prior thread still waits ~1.35s (verified on this head). If bounding is intentionally scoped to interactive frames, the helper comment and the keeps a frame close bounded… test name should say so.
|
Verification update at |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the one commit since the prior pullfrog review (bb44880 → f60f4f4).
- Typed the startup-callback test fixture —
write-pty-output-to-xterm-startup-callback.test.tsnow declareswritePtyOutputToXtermon the session object returned bycreateSession, clearing theTS2339that failedtypecheckonbb44880. - Annotated the remaining assertions — the
as neveronbindWritePtyOutputToXtermand the scheduler mock-argument read now carry line-levelSAFETY:directives, clearing the twotypescript/consistent-type-assertionsfindings fromstatic analysis. Both gates pass locally (pnpm tc:web,pnpm run check:code-quality:changed— 0 findings across 10 files) and the test passes.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Windows runtime gate completed on
This proves the changed synchronized-frame path on the target Windows/ConPTY runtime. The Pi model-response portion is unavailable only because the host has no API credential. |

ELI5
Pi can accept input while it is painting a synchronized terminal frame, but Orca used to keep that frame closed until a long fallback timer. The text was accepted but stayed invisible, making the Windows Pi pane feel frozen. Orca now treats that input as urgent and presents the parsed composer repaint promptly.
What changed
Proof
ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-connection-pi-synchronized-input.test.ts src/renderer/src/components/terminal-pane/pty-connection/pty-connection-foreground-write-path.test.ts src/renderer/src/lib/pane-manager/pane-terminal-output-scheduler-synchronized-frames.test.ts src/renderer/src/components/terminal-pane/pty-connection/write-pty-output-to-xterm-startup-callback.test.ts— 30 passed.pnpm tc:web— passed.Readiness checklist
Runtime merge gate
Run this branch's built Orca/Pi on a real Windows ConPTY host (prefer
win-lowspec), type while DEC 2026 is open, and capture evidence that the composer becomes visible within the fast render window while synchronized output remains intact.Fixes #12283