Repository navigation
Conversation
📝 WalkthroughWalkthroughThis change adds a retrying agent-status probe for guarded terminal sends, repolling terminal status after an initial no-agent result before timing out. Cursor Agent pane-title detection now recognizes bare native OSC titles as active agents. The terminal.send RPC guard uses the new probe, and runtime and RPC tests cover detection, retry recovery, expiration, and guarded-send outcomes. 🚥 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 |
46b7042 to
054d723
Compare
|
Rebased onto latest |
cfd7758 to
694377a
Compare
Guarded note sends re-check isRunningAgent at write time, so a brief title or foreground miss refused live sessions with "not a recognized agent session". Re-poll status for ~1.2s before hard-refusing, and treat bare Cursor Agent native titles as agent identity for is-running checks. Fixes stablyai#7935
terminal.send now uses resolveLiveLeafForHandle for stale-handle safety. Update the no-agent guarded-send test stub so the probe path runs.
694377a to
c886b26
Compare
|
Rebased onto latest |
Adapt guarded-send tests to the current runtime probe contract.
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Taking a look! |
|
Reviewed and pushed a final cleanup. The scoped fix now treats the exact native |
|
@brennanb2025 Thanks for the final cleanup on the bare Still MERGEABLE on current |
|
Closing as superseded — the linked issue(s) for this PR were fixed by another change that has already been merged.
Superseding merge: #9166 Thank you for the contribution! If anything remains unaddressed, please open a new issue or PR against current |
|
The generic #7935 startup TOCTOU was indeed fixed by #9166. This PR was subsequently narrowed to a separate two-file Cursor classification gap and no longer claims to close #7935. On current main ( Would you prefer this scoped PR to be reopened, or a fresh PR against current main? |
|
Going ahead with a fresh PR against current Scope stays two lines. Fix: |
Summary
Cursor Agentnative OSC or pane title as agent identity even though its provider status is intentionallynullbecause hooks own working and idle state.isTerminalRunningAgentandgetTerminalAgentStatusaccurate so guarded note sends do not reject a live Cursor Agent session solely because the native title has no status suffix.Relation to #7935 and #9166
This PR originally included a generic guarded-send retry for the TOCTOU reported in #7935. That behavior landed through #9166 and closed #7935.
The branch is now synchronized with current
mainand narrowed to the remaining Cursor-specific classification gap. It no longer changes guarded-send retry logic and does not claim to close #7935.Screenshots
No visual change.
Testing
pnpm test src/main/runtime/orca-runtime.test.ts src/shared/agent-detection.test.ts— 2 files / 817 tests passedpnpm run typecheck:nodeoxlintoxfmt --checkgit diff --checkAI Review Report
The final diff was reconciled against current
mainand reduced from four files to two. Generic retry comments and tests already covered by #9166 were removed. The remaining classifier uses the existing sharedisCursorAgentTitlepredicate and preserves the established management and shell boundaries. No platform-specific shortcut, path, shell, Git, SSH, or provider-transport behavior changes.Security Audit
No new IPC, command execution, credential, filesystem, dependency, or persistence behavior. The change only classifies an existing trusted terminal title for the existing runtime agent-status guard.
Notes
Current scoped head:
96062d875b. The original #7935 implementation history remains in the branch history, while the merge result presented for review contains only the Cursor Agent title fix.ELI5
A bare "Cursor Agent" terminal title was not treated as a running agent because status is null when hooks own idle/working state. Guarded sends and status helpers now recognize that title so live Cursor Agent sessions are not rejected by mistake.