Skip to content

Commit a422b9d

Browse files
committed
feat: native ACP bridge, yolo, and breaking-change docs
1 parent 79b3a33 commit a422b9d

9 files changed

Lines changed: 577 additions & 85 deletions

README.md

Lines changed: 45 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,33 @@ This is an `ai-assisted` personal project aimed at bringing Cursor's agent into
3131
- **Model listing and best-effort model selection**: Keeps `/model` support while native ACP has no stable model API
3232
- **Authentication helpers**: `/login`, `/logout`, `/status`, plus terminal-auth metadata for ACP clients that support it
3333
- **Prompt flattening for ACP clients**: Keeps embedded context and image prompts working by converting them to text before forwarding to native ACP
34-
- **Optional Auto Run All Commands mode**: Auto-approves native ACP permission requests when explicitly selected
34+
- **Optional Yolo mode** (`yolo`): Auto-approves native ACP permission requests when explicitly selected
3535

3636
### Known limitations
3737

3838
- Native Cursor ACP on the currently validated CLI does **not** expose `session/list`, `session/resume`, or `session/set_model`
39-
- Resuming after restarting `cursor-acp` replays visible history, but may not preserve native Cursor backend state
39+
- Resuming after restarting `cursor-acp` uses native `session/load` when a stored `backendSessionId` is available; if that fails, the adapter starts a **new** native session and replays local JSONL so visible history is preserved
4040
- `debug` mode is intentionally not exposed in this phase
4141

42+
## Breaking changes (native ACP & Yolo)
43+
44+
If you used an older `cursor-acp` that drove Cursor through the legacy **`agent --print --output-format stream-json`** path, upgrading changes behavior in ways that are easy to mistake for “bugs” unless you know what moved:
45+
46+
### Native `agent acp` backend
47+
48+
- **Execution model**: The adapter now spawns **native `agent acp`** and speaks ACP to Cursor’s server. Session traffic, slash-command routing, and tool permission flows follow **native ACP**, not the previous wrapper-only protocol.
49+
- **Slash commands**: If Cursor advertises a command name that matches a built-in wrapper command (for example `/model`), the **native command wins** and is forwarded to the backend; the wrapper no longer always intercepts those names.
50+
- **Permissions**: Tool and action approval is mediated through **native `requestPermission`** notifications. The adapter translates them to the outer ACP client unless you opt into Yolo (below).
51+
- **Resume / listing**: Resume uses native **`session/load`** when a stored backend session id is available; native Cursor ACP still does not expose everything the outer protocol can represent (see **Known limitations**). Expect differences versus the old stream-json session lifecycle.
52+
53+
### Yolo mode (`yolo`)
54+
55+
- **What it does now**: **Yolo** only changes how the adapter answers **native ACP permission requests**—it auto-selects an allow-style option (preferring `allow_always`, then `allow_once`, then another allow). It does **not** introduce a separate native Cursor mode: both **Default** and **Yolo** map to native **`agent`**; the difference is whether permissions are surfaced to your client or approved inside the adapter.
56+
- **Why that can break expectations**: If you relied on the old wrapper’s auto-approval semantics (or on names like `bypassPermissions` / `autoRunAllCommands`) as identical to “unrestricted agent” in the legacy path, behavior may differ because approvals are now tied to **native permission options** and to the **ACP permission** channel.
57+
- **Configuration**: Aliases such as `bypassPermissions``yolo` remain supported; see **Migration Notes**. You must still set `default_mode` / `CURSOR_ACP_DEFAULT_MODE` to `yolo` (or pick **Yolo** in the client) to get automatic approval.
58+
59+
The same notice is linked from [`docs/breaking-changes.md`](docs/breaking-changes.md).
60+
4261
## Slash Commands
4362

4463
| Command | Description |
@@ -134,32 +153,32 @@ If `cursor-acp` is not on your PATH, use the full absolute path to the entry poi
134153
}
135154
```
136155

137-
#### Environment Variables
138-
139-
You can optionally set default mode and model via environment variables in the `"env"` object:
140-
141-
- `CURSOR_ACP_DEFAULT_MODE` — one of `default`, `autoRunAllCommands`, `plan`, or `ask`
142-
- Legacy aliases are still accepted: `acceptEdits` -> `default`, `bypassPermissions` -> `autoRunAllCommands`
143-
- `CURSOR_ACP_DEFAULT_MODEL` — a model ID string (e.g. the model ID shown by `/model`)
156+
#### Default mode and model
144157

145-
Example with defaults configured:
158+
**Config file (recommended):** create `~/.cursor-acp/config.json` (or `$CURSOR_ACP_CONFIG_DIR/config.json`):
146159

147160
```json
148161
{
149-
"agent_servers": {
150-
"Cursor": {
151-
"type": "custom",
152-
"command": "cursor-acp",
153-
"args": [],
154-
"env": {
155-
"CURSOR_ACP_DEFAULT_MODE": "autoRunAllCommands"
156-
}
157-
}
158-
}
162+
"default_mode": "yolo",
163+
"default_model": "your-model-id"
159164
}
160165
```
161166

162-
Recommended Zed setup if you want tools to run without repeated approval prompts:
167+
- `default_mode` — one of `default`, `yolo`, `plan`, or `ask` (legacy aliases: `acceptEdits``default`, `bypassPermissions` / `autoRunAllCommands``yolo`)
168+
- `default_model` — optional model ID (e.g. the model ID shown by `/model`)
169+
170+
Omit keys you do not need. Environment variables below override the file when set.
171+
172+
The mode picker in Zed (and other ACP clients) lists **Default**, **Yolo**, **Ask**, and **Plan** — including **Yolo**, which is implemented only in this adapter (Cursor’s native session still uses its usual Agent/Plan/Ask wiring under the hood).
173+
174+
#### Environment Variables
175+
176+
You can alternatively set defaults via environment variables in the `"env"` object (or your shell):
177+
178+
- `CURSOR_ACP_DEFAULT_MODE` — same values as `default_mode` in the config file
179+
- `CURSOR_ACP_DEFAULT_MODEL` — same as `default_model` in the config file
180+
181+
Example using env only:
163182

164183
```json
165184
{
@@ -169,7 +188,7 @@ Recommended Zed setup if you want tools to run without repeated approval prompts
169188
"command": "cursor-acp",
170189
"args": [],
171190
"env": {
172-
"CURSOR_ACP_DEFAULT_MODE": "autoRunAllCommands"
191+
"CURSOR_ACP_DEFAULT_MODE": "yolo"
173192
}
174193
}
175194
}
@@ -181,7 +200,7 @@ Recommended Zed setup if you want tools to run without repeated approval prompts
181200
1. Open the Agent Panel with `Cmd+?` (macOS) or `Ctrl+?` (Linux)
182201
2. Click the `+` button in the top right and select **Cursor**
183202
3. On first use, run the `/login` slash command to authenticate with Cursor
184-
4. The default mode is `default`; if you want tool execution without repeated prompts, set `CURSOR_ACP_DEFAULT_MODE=autoRunAllCommands`
203+
4. The default mode is `default`; if you want tool execution without repeated prompts, set `"default_mode": "yolo"` in `~/.cursor-acp/config.json` or `CURSOR_ACP_DEFAULT_MODE=yolo`
185204

186205
You can also bind a keyboard shortcut to quickly open a new Cursor thread by adding the following to your `keymap.json` (open via `zed: open keymap file`):
187206

@@ -223,8 +242,9 @@ bun run check # Run lint and format checks
223242

224243
## Migration Notes
225244

226-
- `default`, `autoRunAllCommands`, `ask`, and `plan` are the advertised modes
227-
- `acceptEdits` and `bypassPermissions` are deprecated aliases
245+
- See **Breaking changes (native ACP & Yolo)** for semantic and protocol differences when upgrading from the legacy stream-json wrapper.
246+
- `default`, `yolo`, `ask`, and `plan` are the advertised modes
247+
- `acceptEdits`, `bypassPermissions`, and `autoRunAllCommands` are deprecated aliases (still accepted; map to `default` / `yolo` as documented under **Default mode and model**)
228248
- `debug` is not exposed
229249
- Custom commands and skills are forwarded from native `agent acp`
230250

0 commit comments

Comments
 (0)