Skip to content

Commit 84baae0

Browse files
committed
fix(cursor): map auto mode to smart review
1 parent ba16788 commit 84baae0

3 files changed

Lines changed: 24 additions & 5 deletions

File tree

‎apps/server/src/provider/acp/CursorAcpSupport.test.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,16 @@ describe("buildCursorAcpSpawnInput", () => {
8383
});
8484
});
8585

86-
it.each(["approval-required", "auto-accept-edits", "auto"] as const)(
87-
"does not force approval in %s mode",
86+
it("uses Cursor auto-review in auto mode", () => {
87+
expect(buildCursorAcpSpawnInput(undefined, "/tmp/project", undefined, "auto")).toEqual({
88+
command: "cursor-agent",
89+
args: ["--auto-review", "acp"],
90+
cwd: "/tmp/project",
91+
});
92+
});
93+
94+
it.each(["approval-required", "auto-accept-edits"] as const)(
95+
"does not relax approval in %s mode",
8896
(runtimeMode) => {
8997
expect(buildCursorAcpSpawnInput(undefined, "/tmp/project", undefined, runtimeMode)).toEqual({
9098
command: "cursor-agent",

‎apps/server/src/provider/acp/CursorAcpSupport.ts‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ import * as AcpSessionRuntime from "./AcpSessionRuntime.ts";
1919

2020
type CursorAcpRuntimeCursorSettings = Pick<CursorSettings, "apiEndpoint" | "binaryPath">;
2121

22+
function cursorAcpPermissionArgs(runtimeMode?: RuntimeMode): ReadonlyArray<string> {
23+
switch (runtimeMode) {
24+
case "auto":
25+
return ["--auto-review"];
26+
case "full-access":
27+
return ["--force"];
28+
default:
29+
return [];
30+
}
31+
}
32+
2233
export interface CursorAcpRuntimeInput extends Omit<
2334
AcpSessionRuntime.AcpSessionRuntimeOptions,
2435
"authMethodId" | "clientCapabilities" | "spawn"
@@ -45,7 +56,7 @@ export function buildCursorAcpSpawnInput(
4556
command: cursorSettings?.binaryPath || "cursor-agent",
4657
args: [
4758
...(cursorSettings?.apiEndpoint ? (["-e", cursorSettings.apiEndpoint] as const) : []),
48-
...(runtimeMode === "full-access" ? (["--force"] as const) : []),
59+
...cursorAcpPermissionArgs(runtimeMode),
4960
"acp",
5061
],
5162
cwd,

‎docs/user/permission-modes.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ without prompting; commands and anything else still stop for approval.
1717

1818
**Auto**: routine actions proceed without you; risky ones still ask. How this is enforced depends
1919
on the provider: Codex delegates routine approvals to an AI reviewer, Claude uses its own auto
20-
permission mode, and providers without an equivalent (such as OpenCode) fall back to asking, like
21-
Supervised.
20+
permission mode, Cursor uses Smart Auto review, and providers without an equivalent (such as
21+
OpenCode) fall back to asking, like Supervised.
2222

2323
**Full access**: allow commands and edits without prompts. The default. The agent runs
2424
unattended until it finishes or asks a question of its own.

0 commit comments

Comments
 (0)