Repository navigation
Conversation
|
Ready to review this PR? Stage has broken it down into 2 individual chapters for you:
Chapters generated by Stage for commit 5b9c9a2 on Jun 30, 2026 10:36pm UTC. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (2)
📝 WalkthroughWalkthroughThe change updates Pi-compatible terminal title normalization in the main runtime to use launch or foreground ownership, adds delayed snapshot publishing while foreground ownership probes resolve, and expands runtime tests for probe ordering and emitted tab state. In the renderer, it adds manual command inference from accepted shell input, uses that inferred agent in authoritative pane-agent selection, clears it on lifecycle boundaries, and updates tests and mocks for Pi-compatible omp and pi cases. 🚥 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/renderer/src/components/terminal-pane/pty-connection.test.ts (1)
811-813: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the Pi title never leaks in the OMP regression test.
The issue is title thrashing, so this test should fail if the pane briefly receives
Pi readybeforeOMP ready.🧪 Proposed test hardening
expect(transport.sendInput).toHaveBeenCalledWith('omp\r') + expect(deps.setRuntimePaneTitle).not.toHaveBeenCalledWith('tab-1', 1, 'Pi ready') + expect(deps.updateTabTitle).not.toHaveBeenCalledWith('tab-1', 'Pi ready') expect(deps.setRuntimePaneTitle).toHaveBeenCalledWith('tab-1', 1, 'OMP ready') expect(deps.updateTabTitle).toHaveBeenCalledWith('tab-1', 'OMP ready')
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 4eef412d-121c-4470-a853-860cbd221f83
📒 Files selected for processing (4)
src/main/runtime/orca-runtime.test.tssrc/main/runtime/orca-runtime.tssrc/renderer/src/components/terminal-pane/pty-connection.test.tssrc/renderer/src/components/terminal-pane/pty-connection.ts
| const onAgentExited = (): void => { | ||
| clearCommandInferredPaneAgent() |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Clear manual ownership on PTY exit too.
onAgentExited is title-driven; PTY exits can also leave this binding mounted for suppressed restarts, so the next PTY can inherit a stale typed omp/pi owner. Call clearCommandInferredPaneAgent() from onExit before any early returns.
🐛 Proposed fix
const onExit = (ptyId: string): void => {
+ clearCommandInferredPaneAgent()
if (handledExitPtyId === ptyId) {
return
}Co-authored-by: Orca <[email protected]>
…tle-flicker-only-when-agent-started # Conflicts: # src/renderer/src/components/terminal-pane/pty-connection.ts
Co-authored-by: Orca <[email protected]>
Jinwoo-H
left a comment
There was a problem hiding this comment.
Thanks for the fix. I added follow-up hardening before landing:
- kept ambiguous Pi-compatible mobile session titles queued until foreground ownership is known
- handled same-status title races and stale foreground probes without per-frame foreground polling
- tightened renderer typed-command inference around live title-only agents, stale retained done statuses, Ctrl+W/Delete/cursor edits, large paste input, and same-chunk command-finished ordering
- added regression coverage for the OMP/Pi ownership edge cases
Validated with affected Vitest files, typecheck, lint, and Electron smoke/regression screenshots.
…rmance The fix patched main's direct title-update block in onPtyData — an architecture the term-speed-2 chain replaced with the per-PTY title tracker. Resolution keeps the tracker and ports the fix's semantics into applyTrackedPtyTitle: foreground-owner probe with title-observation sequencing on status transitions, same-status compatible-title changes reuse the pending probe, and mobile snapshot fan-out is deferred until the probe settles (delayPtyBackedMobileSnapshotForForegroundAgent). Renderer side keeps the chain's shared handleCommandFinished (side- effect authority routing) and grafts the fix's clearCommandInferredPaneAgentAfterPtySideEffects() call. Validation: #6954's own 760+ lines of merged tests pass against the tracker port (574 runtime + 344 pty-connection/lifecycle); full battery 5,661 green (1 documented pre-existing WSL failure); typecheck clean. Co-authored-by: Orca <[email protected]>
… shadow-cursor tracking Quality pass on terminal PRs merged 2026-07-03: - pane-split-close: extract a shared `teardownManagedPane` so `closeManagedPane` and `detachManagedPaneForExternalMove` can't drift apart on future edits (#7215). - terminal-link-activation: reuse the existing `isMacPlatform()` instead of a second inline `navigator.userAgent` copy, keeping one source of truth for Mac detection. - pty-connection: gate the shadow-cursor moves on empty CSI params so parameterized/ modified cursor keys (e.g. Ctrl+Left word-jump, `ESC[1;5D`) reset command tracking instead of silently desyncing the buffer used to infer a typed agent name; relocate the `getAuthoritativePaneAgent` JSDoc to the function it documents (#6954). No behavior change except the cursor-tracking hardening; all touched unit suites pass.
… shadow-cursor tracking (#7320) Quality pass on terminal PRs merged 2026-07-03: - pane-split-close: extract a shared `teardownManagedPane` so `closeManagedPane` and `detachManagedPaneForExternalMove` can't drift apart on future edits (#7215). - terminal-link-activation: reuse the existing `isMacPlatform()` instead of a second inline `navigator.userAgent` copy, keeping one source of truth for Mac detection. - pty-connection: gate the shadow-cursor moves on empty CSI params so parameterized/ modified cursor keys (e.g. Ctrl+Left word-jump, `ESC[1;5D`) reset command tracking instead of silently desyncing the buffer used to infer a typed agent name; relocate the `getAuthoritativePaneAgent` JSDoc to the function it documents (#6954). No behavior change except the cursor-tracking hardening; all touched unit suites pass.
… shadow-cursor tracking (stablyai#7320) Quality pass on terminal PRs merged 2026-07-03: - pane-split-close: extract a shared `teardownManagedPane` so `closeManagedPane` and `detachManagedPaneForExternalMove` can't drift apart on future edits (stablyai#7215). - terminal-link-activation: reuse the existing `isMacPlatform()` instead of a second inline `navigator.userAgent` copy, keeping one source of truth for Mac detection. - pty-connection: gate the shadow-cursor moves on empty CSI params so parameterized/ modified cursor keys (e.g. Ctrl+Left word-jump, `ESC[1;5D`) reset command tracking instead of silently desyncing the buffer used to infer a typed agent name; relocate the `getAuthoritativePaneAgent` JSDoc to the function it documents (stablyai#6954). No behavior change except the cursor-tracking hardening; all touched unit suites pass.
Summary
Closes #6943.
Screenshots
No new UI surfaces. The regression covers remote runtime panes started by typing
ompin a normal terminal.Testing
pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-connection.test.ts src/main/runtime/orca-runtime.test.ts -t "typed omp|typed pi|unknown-launch foreground"./node_modules/.bin/tsgo --noEmit -p config/tsconfig.node.json./node_modules/.bin/tsgo --noEmit -p config/tsconfig.tc.web.json./node_modules/.bin/oxlint src/renderer/src/components/terminal-pane/pty-connection.ts src/renderer/src/components/terminal-pane/pty-connection.test.ts src/main/runtime/orca-runtime.ts src/main/runtime/orca-runtime.test.tsompin a normal terminal stayed labeled OMP on the remote host