Repository navigation
Conversation
|
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: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthrough
Merge Risk: ⚪ Minimal · up to This change retires resume state only after confirmed agent exit while preserving recovery for unexpected PTY loss; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f30fdb2a-0b49-4a7a-81ee-882ada97b90b
📥 Commits
Reviewing files that changed from the base of the PR and between cb42b60 and 24e94f858a32ffb1f877d8daa24148d5b8f04865.
📒 Files selected for processing (3)
src/renderer/src/components/terminal-pane/pty-connection.test.tssrc/renderer/src/components/terminal-pane/pty-connection.tssrc/renderer/src/store/slices/terminal-tab-retirement-store.test.ts
|
@coderabbitai review Addressed both review findings in e6b3f13: confirmed exits now clear the resolved legacy key and same-session aliases, and the regression test pins cleanup before the exit callback. |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
git show --stat --oneline e6b3f13
git show --format=fuller --find-renames --find-copies -- src/renderer/src/components/terminal-pane/pty-connection.ts src/renderer/src/components/terminal-pane/pty-connection.test.ts e6b3f13
ast-grep outline src/renderer/src/components/terminal-pane/pty-connection.ts --items all --view expanded
ast-grep outline src/renderer/src/components/terminal-pane/pty-connection.test.ts --items all --view expandedLength of output: 26881 🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n -A45 -B15 '\b(getSleepingRecordForPane|clearSleepingRecordProviderDuplicates|clearSleepingAgentSession)\b' \
src/renderer/src/components/terminal-pane/pty-connection.ts \
src/renderer/src/components/terminal-pane/pty-connection.test.ts
sed -n '19910,20010p' src/renderer/src/components/terminal-pane/pty-connection.test.ts
sed -n '3325,3410p' src/renderer/src/components/terminal-pane/pty-connection.ts
rg -n -A20 -B10 'clearSleepingRecordProviderDuplicates\s*\(' src/renderer/src/components/terminal-pane/pty-connection.tsLength of output: 186930
The cleanup now removes the resolved legacy record and same-session aliases only. It preserves the sibling record with a different provider session. The regression test also verifies cleanup before If you found this review helpful, would you consider giving us a shout-out on X? Thank you for using CodeRabbit!
|
e6b3f13 to
7a60c20
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: ff494ee0-4150-49dc-9feb-00cd0a9a265b
📥 Commits
Reviewing files that changed from the base of the PR and between 8ca4ed9 and 7a60c20fb5802a6cbdfc680ffc2f9b7cf989e3c0.
📒 Files selected for processing (3)
src/renderer/src/components/terminal-pane/pty-connection-main-side-effect-authority.test.tssrc/renderer/src/components/terminal-pane/pty-connection.tssrc/renderer/src/store/slices/terminal-tab-retirement-store.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- src/renderer/src/store/slices/terminal-tab-retirement-store.test.ts
- src/renderer/src/components/terminal-pane/pty-connection.ts
Included review availability: Your plan includes up to 10 reviews per rolling hour; 8 remain after this review.
7a60c20 to
bec0b6b
Compare
|
Independent validation against the current
The cleanup boundary in this PR remains the right one: process-confirmed agent exit retires resume authority, while unexpected PTY loss keeps crash recovery. |
Rebased onto the pty-connection.ts module split (stablyai#15166), which merged after this fix and reintroduced the pre-fix onAgentExited body at its new home in agent-idle-working-handlers.ts. Ports the same retire-on-confirmed-exit logic onto the session.* API the split introduced.
bec0b6b to
c936b3c
Compare
|
Rebased onto |
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Thanks @erishforG for digging into this and for the careful write-up and recording. This path is now handled on main by #21714 (b6b974c): when the pane's foreground-process tracker confirms the agent has returned to a shell (after the command-finished mark, a visible-PTY read, or a confirmed process exit), |
ELI5
When a user exits Claude normally and later closes its shell, Orca should not bring that finished agent back after an app restart.
What Changed
Why
A bare PTY exit is ambiguous and may represent a recoverable crash, so Orca intentionally preserves resume authority in that path. The existing agent-exited fact is emitted only after foreground-process verification confirms that the agent has returned to the shell. That confirmed transition is the safe point to retire the pane resume authority.
Without this cleanup, the persisted sleeping-session record can survive shell exit and cause a deliberately finished Claude session to be resumed after restarting Orca.
Prior work: #14376 explored Claude SessionEnd hooks but was closed after verification showed that /exit does not emit SessionEnd. Its conclusion was that process-exit or liveness evidence must be the real backstop; this PR uses the existing process-confirmed agent-exited fact.
Linked Issue
Fixes #14228
Visual Proof
After fix on macOS: exit Claude, exit the shell, restart Orca, and verify that the completed Claude session is not resumed.
fixed_record_public.mp4
The recording uses an isolated local project. Account email and provider session identifiers were redacted before upload.
Testing
Manual verification on macOS:
Automated verification:
The full local suite reaches pre-existing machine-specific Codex HOME/auth and updater failures; the affected suites are green and CI will run in a clean repository environment.
AI Disclosure
OpenAI Codex was used to assist with investigation, implementation, test drafting, and review. I reviewed the focused diff and manually verified the end-to-end behavior.
Review
Checklist
The affected test suites, lint, typecheck, and build pass locally. Repository CI will cover the clean full-suite environment because the local full suite encounters unrelated machine-specific Codex authentication and updater fixtures.
Author