Open History to see the last commit
1# Cursor
2
3Cursor V2 runs through the official [`@cursor/sdk`](https://cursor.com/docs/api/sdk/typescript)
4TypeScript package. It does not use Cursor's ACP transport for V2 execution.
5
6## Prerequisites
7
8- Node.js 22.13 or newer. The repository's supported Node version satisfies this requirement.
9- A Cursor API key in `CURSOR_API_KEY`. Provider-instance environment variables override the host
10 environment in the same way as the other providers.
11- A model accepted by the Cursor SDK. `auto` is sent to the SDK as its `default` model selection.
12
13The adapter currently uses the SDK's local-agent runtime so runs operate in the selected T3 Code
14workspace. Cursor cloud agents need repository and cloud-environment configuration that T3 Code does
15not expose yet.
16
17## V2 Capability Mapping
18
19The adapter supports:
20
21- creating and resuming local Cursor agent threads;
22- changing the model and model parameters between turns;
23- assistant text, reasoning, tool output, plans, and todo streaming;
24- thread-scoped T3 Code MCP tools;
25- image attachments;
26- interruption, queued app messages, and orchestrator-owned interrupt/restart steering;
27- provider conversation snapshots through `Agent.messages.list()`;
28- Cursor `task` subagents, projected as read-only child app threads with their tool activity and
29 final result.
30
31The public SDK does not currently expose native agent fork, conversation rollback, active steering,
32or interactive approval callbacks. Direct active steering is advertised as unsupported, while V2
33steering uses the orchestrator's interrupt-and-restart path and preserves the app run identity across
34provider turns. Same-provider Cursor forks use the orchestrator's portable full-thread context
35handoff into a fresh Cursor agent. The SDK has in-process custom callback tools, but the V2 adapter
36intentionally uses the authenticated, thread-scoped MCP server instead.
37
38Cursor task events include an `agentId`, but the local SDK does not register that identifier as a
39resumable agent: `Agent.resume()` returns `AgentNotFoundError`. The adapter therefore does not attach
40a provider thread to native task projections or advertise subagent thread IDs. Sending a new message
41from a projected child starts a new Cursor agent rather than pretending to resume the task runtime.
42
43Runtime modes map to the controls the local SDK exposes: full access disables its sandbox, while
44restricted modes and explicit non-full-access sandbox policies enable it. Explicit approval policy
45overrides also control Cursor Auto-review. Auto-review is not represented as an interactive T3 Code
46approval flow.
47
48The existing Cursor binary path and API endpoint settings belong to the CLI/ACP integration. Cursor
49V2 execution does not launch that binary, and the SDK does not expose an API endpoint override.
50
51## Replay And Live Testing
52
53Cursor replay fixtures preserve the SDK boundary: agent open/resume, sends, ordered `onDelta`
54updates, terminal results, cancellation, message snapshots, and close. The real V2 adapter,
55orchestrator, event store, projections, and checkpoint logic still run in tests.
56
57Record a fixture against the real SDK with:
58
59```bash
60pnpm --filter t3 record:cursor-replay -- --scenario simple
61```
62
63Use `--out <path>` to record a temporary probe without replacing a checked-in fixture. Supported
64scenarios are listed by the recorder when an invalid scenario is supplied.