Repository navigation
Conversation
…iew is on Cursor's Auto-review Run Mode relies on a backend classifier that the gateway replaces, so every non-allowlisted call fell back to the approval card. When the client selects Auto-review, the gateway now holds Shell, WebFetch and MCP requests, asks the Run's own model for a verdict, and sends them with skip_approval (allow) or smart_mode_approval (block, failure or timeout) so Cursor shows its native approval card with the reason. - Shell calls the Cursor sandbox can contain and calls the model already escalated are sent unchanged. - Held requests are sent only while their exec or interaction is pending. - Models advertise supports_smart_mode_classifier so the client offers the mode. - Runs without a request context reuse the conversation's latest state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses #389: when Cursor's Run Mode is Auto-review, BYOK runs now review Shell, WebFetch and MCP calls instead of asking for approval on every call that is not in the allowlist.
Cursor's official backend runs a classifier on these calls and sends
skip_approvalfor the ones it judges safe. The gateway replaces that backend but had no classifier, soskip_approvalwas alwaysfalseand Auto-review behaved like Allowlist with an empty allowlist. This PR uses the Run's own model as the classifier.How it works
RequestContextEnv.smart_mode_classifier_auto_mode_enabled = true, i.e. the user selected Auto-review. Other Run Modes are unchanged.*_permissions_auto_run), the workspace paths, the last three user messages, the agent's latest reply, and the action. The action is passed as JSON inside one<review_input>tag, with<escaped so reviewed text cannot close the tag.supports_smart_mode_classifier(field 45), so the client offers Auto-review for BYOK models.Structure
Testing
cargo fmt --check,cargo clippy --workspace --all-targets -D warnings,cargo test --workspace --all-targetsandnpm --prefix apps/desktop run checkpass.auto_review.rscover: verdict parsing, which calls are reviewed (sandbox, escalation, tool kind), the Auto-review flag and user instructions, prompt-input escaping, conversation excerpt selection, verdicts onShellArgs,WebFetchRequestQueryandMcpArgs, a held Shell call and a held WebFetch sent after an allow/block/unparseable review, an interrupted call that is not sent, and the per-conversation state for Runs without a request context.Notes and follow-ups
skip_approvalbypasses the client's local permission checks for that call, the same as Cursor's own Auto-review.mcp_auth) are still missing from that Run's MCP routes. This is existing behavior and not changed here.🤖 Generated with Claude Code