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:
Walkthrough
🚥 Pre-merge checks | ✅ 3 | ❌ 2
|
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 27a2016e-34ee-42b8-b434-be95e0818c39
📥 Commits
Reviewing files that changed from the base of the PR and between c445f26 and 96c836dfb31e4ca5b9d5a97eda42f10accd41b16.
📒 Files selected for processing (7)
src/renderer/src/components/native-chat/native-chat-exit-suppress.test.tssrc/renderer/src/components/native-chat/native-chat-exit-suppress.tssrc/renderer/src/components/native-chat/native-chat-leaf-routing.test.tssrc/renderer/src/components/native-chat/native-chat-leaf-routing.tssrc/renderer/src/components/native-chat/native-chat-pending.test.tssrc/renderer/src/components/native-chat/native-chat-pending.tssrc/renderer/src/components/terminal-pane/TerminalPane.tsx
Sync update (
|
a9f6b5b to
2cc109c
Compare
Sync update (
|
2cc109c to
a287b49
Compare
a287b49 to
c9424ba
Compare
[Medium impact] The change affects Native Chat exit routing in terminal panes. Fix the delayed exit callback before merging; it can still close Chat after the agent recovers. FindingsSummaryAdds a pane-specific guard against title-based Chat exits after a send.
Acknowledgment:
|
| pendingConfirmedExitTimerRef.current = setTimeout(() => { | ||
| pendingConfirmedExitTimerRef.current = null | ||
| onAgentExitedRef.current(leafId) | ||
| }, remainingMs) |
There was a problem hiding this comment.
If a shell-like title briefly appears after a send, this timer replays that exit even after the agent title recovers. Once pending sends clear and the grace ends, handleConfirmedAgentExit still passes chatLeafHasConfirmedAgentExit: true. With the same active leaf, that forces Chat back to Terminal despite the agent still running.
Recheck current exit evidence before applying the delayed route, or cancel the timer when the agent recovers.
| const lastOptimisticSendAtByPaneKey = new Map<string, number>() | ||
|
|
||
| export function recordNativeChatOptimisticSendForExitGuard(paneKey: string, sentAt: number): void { | ||
| lastOptimisticSendAtByPaneKey.set(paneKey, sentAt) |
There was a problem hiding this comment.
lastOptimisticSendAtByPaneKey keeps every pane that has ever sent a message. Expired entries and closed panes are never removed; only the test helper clears the map. Long-running sessions that open and close chat panes therefore keep growing this map.
Bound it like pendingSendCache, or remove expired entries during normal use.
c9424ba to
f83adf9
Compare
Ordinary Codex Chat UI sends can race a brief shell-like OSC title and trip handleConfirmedAgentExit → exitChat, switching to Terminal mid-turn. Suppress that handoff while optimistic sends are pending or within a short post-send grace window, and record breadcrumbs when exit is suppressed vs applied for post-hoc triage. Fixes stablyai#10098
- Apply send-grace suppression before eligible-sibling retarget - Breadcrumb the pre-route chat leaf on terminal handoff - Re-evaluate confirmed agent exit after the grace window ends
f83adf9 to
758cce0
Compare
Sync update (
|
Description
An ordinary natural-language send from Codex Chat UI could flip the pane back to Terminal, showing the hosted
codex …command line. Composer ordinary sends never callonSwitchToTerminal; the more likely path is a false agent-exit from a brief shell-like OSC title while the first PTY write is accepted, which routes throughhandleConfirmedAgentExit→exitChat.This PR suppresses that programmatic Chat→Terminal handoff for a short window after an optimistic chat send (and while pending sends remain), and records renderer breadcrumbs when exit is suppressed vs applied so post-hoc triage can see the branch (#10098 requested).
Evidence
TerminalPaneexitChat does).pnpm exec vitest run --config config/vitest.config.ts \ src/renderer/src/components/native-chat/native-chat-pending.test.ts \ src/renderer/src/components/native-chat/native-chat-leaf-routing.test.ts \ src/renderer/src/components/native-chat/native-chat-exit-suppress.test.tsELI5
After you hit send in Chat UI, Orca briefly listens for “did the agent quit?”. Sometimes the terminal title flickers and Orca thought it quit, so it yanked you into the raw terminal. Now it waits a few seconds after a chat send before trusting that signal.
User-regression-tradeoffs
/modelhandoffs still useonSwitchToTerminaland are unchanged.Checklist notes
Fixes #10098