fix(server): Cursor threads in Auto use Cursor's Auto-review#19712

merged2
main
GitHub fork: cursor-auto-mode-auto-review
opened26d agobyOowenferg
View on GitHubTwo-way sync enabledPR last imported 20d ago

Problem

Cursor threads in Auto run with Cursor's sandbox on but autoReview: false. Any command that has to leave the sandbox (a write outside the workspace, network access) is denied straight away with "Local SDK runs cannot request interactive approval for this shell command", without being reviewed. Permission modes says Auto uses the provider's automatic review on Cursor, so the only way to get those commands through today is Full access.

Closes #19711

Change

cursorRuntimeAgentPolicy now enables autoReview for auto as well as approval-required. Cursor doesn't declare supportedRuntimeModes, so auto reaches the adapter unchanged, and the old check only matched approval-required. With autoReview: true, @cursor/sdk 1.0.35 turns on its Auto-review classifier (getSmartModeClassifierAutoModeEnabled: () => autoReview === true), so escalations are reviewed before anything falls through to the SDK's deny-all decision provider.

Full access, Auto-accept edits, Supervised, and explicit approvalPolicy overrides behave as before.

Scope and approval

Bug report: #19711 (not triaged yet). This is meant as a small, focused fix for an obvious bug: one condition in the Cursor adapter plus the missing auto case in its policy test. It makes Cursor do what the permission-modes guide already documents for Auto, and doesn't touch other providers or modes.

The issue also mentions that Supervised gets autoReview: true, which is the same question #19293 raised for Muse. That's a separate behavior decision, so this PR leaves it alone.

Verification

  • Reproduced on t3 v0.0.46-nightly.20261014.3132 (macOS 27.0.1, Apple Silicon): in a Cursor thread in Auto, touch ~/.t3-sandbox-probe failed with Operation not permitted. The retry with required_permissions: ["all"] was rejected with the message above. After switching the thread to Full access, the same command succeeded.

  • Added an auto case to "maps runtime modes to the SDK sandbox and auto-review controls" in packages/provider-cursor/src/server/adapter.test.ts. Without the fix it fails (expected { autoReview: false, … } to deeply equal { autoReview: true, … }). With the fix, vp test run packages/provider-cursor/src/server/adapter.test.ts passes 13 of 13.

  • vpr typecheck in packages/provider-cursor, vp lint, and vp fmt --check on the changed files are clean.

  • Live check on this branch (vp run dev, macOS, Cursor thread in Auto):

    • curl -sI https://example.com failed inside the sandbox on DNS lookup. The retry with network access was approved by Cursor's Auto-review without a prompt and returned HTTP/2 200. Before the fix, Auto escalations got the fixed "cannot request interactive approval" denial instead (the touch reproduction above).
    • A request worded as a sandbox escape test was declined by the classifier itself ("Network breakout and escape testing outside sandbox controls require user confirmation") rather than by the SDK's fixed denial. That confirms escalations now reach the reviewer, which still declines what it judges risky.

    The Auto thread on the dev build, and the branch it ran from:

    Cursor thread in Auto: curl to example.com returns HTTP/2 200 after Auto-review allows the network retry

    Dev build's branch panel showing cursor-auto-mode-auto-review with +11 −1 changes

Claude Opus 5.5 via Cursor in T3 Code

Checks

24 successful · 7 skipped
All checks passed
7d90d26

Added 1 commit

  • fix(server): Cursor threads in Auto use Cursor's Auto-review5e97378
Synced from GitHub

Approvability

Verdict: Approved at 5e97378

Macroscope's review found this PR approvable — This is a one-line Cursor adapter bug fix that enables the provider's Auto-review only for explicitly selected Auto threads, with existing modes and overrides unchanged. The accompanying unit test covers the new mapping, and product defaults are not modified.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: accabd6c-c224-4858-8b36-7f55418c4998
📥 Commits

Reviewing files that changed from the base of the PR and between 5e97378b4666d9d8139da90d503394cc6e184439 and 7d90d2643df379d9925748cdea7c681338b58113.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c64750a3-6e2b-4997-acec-35fb5aca8a90
📥 Commits

Reviewing files that changed from the base of the PR and between ec1313c8f8333292506f05a355bb72d308a455d8 and 5e97378b4666d9d8139da90d503394cc6e184439.

📒 Files selected for processing: 2
  • packages/provider-cursor/src/server/adapter.test.ts
  • packages/provider-cursor/src/server/adapter.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

The Cursor runtime policy now enables auto-review in Auto mode when no explicit approval policy is supplied. A test checks that Auto mode enables both auto-review and sandboxing.

Changes: Cursor Auto-review Policy

Layer / File(s)Summary
Enable Auto-mode review
packages/provider-cursor/src/server/adapter.ts, packages/provider-cursor/src/server/adapter.test.ts
When no approval policy is supplied, Auto mode now enables auto-review. The test asserts that Auto mode enables auto-review and sandboxing.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to 5e973

Auto mode requests sandboxed execution with Auto-review, and available evidence supports the intended behavior. No actionable merge-blocking risk is established.

### Architecture Summary

Architecture risk: 🔵 Low · up to 5e973

The change affects 1 system.

Changed systems: packages/provider-cursor

Architecture concerns No architecture-level concerns identified.

Review details

Systems and components

  • observed — packages/provider-cursor (library) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in packages/provider-cursor/src/server/adapter.test.ts: Added an assertion for the "auto" runtime mode, expecting auto-review and sandboxing to both be enabled.
  • observed — Modified behavior in packages/provider-cursor/src/server/adapter.ts: When approvalPolicy is undefined, autoReview is now enabled for runtime modes "approval-required" or "auto"; previously, only "approval-required" enabled it.
Pre-merge checks: Passed 4
Passed Passed checks: 4 passed
Check nameStatusExplanation
Linked Issues checkPassedIssue #19711 requires Cursor Auto sandbox escalations to reach Cursor Auto-review. cursorRuntimeAgentPolicy now sets autoReview: true when runtimeMode is "auto" and no explicit `approvalPolicy…
Out of Scope Changes checkPassedThe changes stay within issue #19711. The pull request changes one Cursor policy condition and adds the matching Auto policy test. No other provider, runtime mode, or unrelated behavior changes are sh…
Description checkPassedThe description includes Problem, Change, Scope and approval, and Verification sections. It explains the bug, the focused fix, scope boundaries, test results, manual verification, and the unverified i…
Title checkPassedThe title is concise, uses conventional commit syntax, and clearly identifies the main change: enabling Cursor Auto-review for Cursor threads in Auto mode.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Added 1 commit

  • Merge branch 'main' into cursor-auto-mode-auto-review7d90d26