@devries-cameron20 / t3code-1 / commits / c8a601c0df
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(cursor): /compact compacts with the SDK's summarize (#29398)

Co-authored-by: Gabriel Rodrigues <huijirohankei@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: maria-rcks <maria@kuuro.net>

Dara Adedeji committed Nov 2, 2026 at 11:41 UTC c8a601c0dfa5c7626e51e06d727076f6b840a005
9 files changed +90 -57
apps/server/package.json
+1 -1
@@ -34,7 +34,7 @@
34 },
35 "dependencies": {
36 "@anthropic-ai/claude-agent-sdk": "^0.3.276",
37 - "@cursor/sdk": "1.0.38",
37 + "@cursor/sdk": "1.2.0",
38 "@effect/platform-node": "catalog:",
39 "@effect/platform-node-shared": "catalog:",
40 "@ff-labs/fff-node": "0.11.0",
docs/orchestration-v2/orchestrator-mcp-server.md
+5 -2
@@ -99,8 +99,11 @@ server headers or token.
99 ### Cursor Agent SDK V2
100
101 Cursor receives the same authenticated HTTP MCP endpoint through the SDK's
102 -`mcpServers` agent and send options. The adapter passes the authorization header
103 -to the SDK but projects only redacted option metadata into protocol diagnostics.
102 +`mcpServers` on `Agent.create` / `Agent.resume` and each `send`. With
103 +`@cursor/sdk` 1.0.39+, send-level servers replace only the create-time inline
104 +set; ambient servers from `settingSources` (`project`, `user`, `team`, `mdm`,
105 +`plugins`) stay available. The adapter passes the authorization header to the
106 +SDK but projects only redacted option metadata into protocol diagnostics.
107
108 ### Grok ACP V2
109
docs/user/cursor.md
+12 -1
@@ -15,6 +15,17 @@ The adapter currently uses the SDK's local-agent runtime so runs operate in the
15 workspace. Cursor cloud agents need repository and cloud-environment configuration that T3 Code does
16 not expose yet.
17
18 +Custom Cursor MCP servers and plugins are not configured in T3 Code. They load from the environment
19 +machine's Cursor config when the agent opens: project `.cursor/mcp.json`, user `~/.cursor/mcp.json`,
20 +and installed plugins under `~/.cursor/plugins`. Plugin tools
21 +can appear without a login; OAuth MCP servers still need credentials. Run `agent mcp login <server>`
22 +with the cwd set to the T3 project root (tokens land in
23 +`~/.cursor/projects/<folder-slug>/mcp-auth.json`). Cursor desktop Connections auth does not write
24 +that file, and the local SDK cannot complete interactive MCP OAuth itself—auth attempts fail with
25 +messages such as "MCP authentication is not supported in local SDK runs" or that the auth server
26 +does not support dynamic client registration. After you add or change skills, plugins, or MCP
27 +servers, or after a successful CLI login, use **Restart agent session**.
28 +
29 ## Sign in
30
31 Choose **Sign in**, then open the sign-in page and complete it in your browser. T3 Code
@@ -36,7 +47,7 @@ The adapter supports:
47 - creating and resuming local Cursor agent threads;
48 - changing the model and model parameters between turns;
49 - assistant text, reasoning, tool activity, plans, and todo streaming;
39 -- thread-scoped T3 Code MCP tools;
50 +- thread-scoped T3 Code MCP tools alongside ambient Cursor MCP/plugins from disk;
51 - image attachments;
52 - interruption, queued app messages, and orchestrator-owned interrupt/restart steering;
53 - provider conversation snapshots through `Agent.messages.list()`;
packages/provider-cursor/package.json
+1 -1
@@ -49,7 +49,7 @@
49 "test": "vp test run --config ../../vite.config.ts --dir ."
50 },
51 "dependencies": {
52 - "@cursor/sdk": "1.0.38",
52 + "@cursor/sdk": "1.2.0",
53 "@napi-rs/keyring": "^1.3.0",
54 "@t3tools/contracts": "workspace:*",
55 "@t3tools/provider-core": "workspace:*",
packages/provider-cursor/src/server/CursorAgentSdk.ts
+19 -10
@@ -89,6 +89,8 @@ export interface CursorAgentSdkSendInput<Error> {
89 readonly message: string | SDKUserMessage;
90 readonly options?: Omit<SendOptions, "onDelta">;
91 readonly onDelta?: (update: InteractionUpdate) => Effect.Effect<void, Error>;
92 + /** Runs `agent.summarize()` instead, which takes no message or options. */
93 + readonly summarize?: boolean;
94 }
95
96 export interface CursorAgentSdkRun {
@@ -139,6 +141,8 @@ export interface CursorAgentSdkLoggedAgentOptions {
141 export interface CursorAgentSdkLoggedSendOptions {
142 readonly model?: SendOptions["model"];
143 readonly mode?: SendOptions["mode"];
144 + readonly hasMcpServers?: boolean;
145 + readonly mcpServerNames?: ReadonlyArray<string>;
146 readonly local?: {
147 readonly force?: boolean;
148 readonly hasCustomTools?: boolean;
@@ -298,9 +302,12 @@ export function loggedCursorSendOptions(
302 if (options === undefined) {
303 return {};
304 }
305 + const mcpServerNames =
306 + options.mcpServers === undefined ? undefined : Object.keys(options.mcpServers).toSorted();
307 return {
308 ...(options.model === undefined ? {} : { model: options.model }),
309 ...(options.mode === undefined ? {} : { mode: options.mode }),
310 + ...(mcpServerNames === undefined ? {} : { hasMcpServers: true, mcpServerNames }),
311 ...(options.local === undefined
312 ? {}
313 : {
@@ -466,16 +473,18 @@ export const makeCursorAgentSdkRunner = Effect.fn("makeCursorAgentSdkRunner")(fu
473 const startRun = () =>
474 Effect.tryPromise({
475 try: () =>
469 - agent.send(sendInput.message, {
470 - ...sendInput.options,
471 - onDelta: async ({ update }) => {
472 - if (!callbacksReady) {
473 - pendingUpdates.push(update);
474 - return;
475 - }
476 - await dispatchUpdate(update);
477 - },
478 - }),
476 + sendInput.summarize === true
477 + ? agent.summarize()
478 + : agent.send(sendInput.message, {
479 + ...sendInput.options,
480 + onDelta: async ({ update }) => {
481 + if (!callbacksReady) {
482 + pendingUpdates.push(update);
483 + return;
484 + }
485 + await dispatchUpdate(update);
486 + },
487 + }),
488 catch: (cause) => runnerError(cause, "run.start"),
489 });
490 const run = yield* startRun().pipe(
packages/provider-cursor/src/server/adapter.test.ts
+13 -13
@@ -219,7 +219,7 @@ describe("CursorAdapterV2", () => {
219 Stream.takeUntil((event) => event.type === "turn.terminal"),
220 Stream.runCollect,
221 );
222 - assert.isFalse(sentWithMcpOverride);
222 + assert.isTrue(sentWithMcpOverride);
223 const rows = events.filter((event) => event.type === "subagent.updated");
224 assert.equal(rows[0]?.subagent.status, "running");
225 assert.equal(rows[0]?.subagent.model, model ?? null);
@@ -510,11 +510,11 @@ describe("CursorAdapterV2", () => {
510 ),
511 );
512
513 - it.effect("fails standalone SDK transport diagnostics and sends compaction as /compress", () =>
513 + it.effect("fails standalone SDK transport diagnostics and compacts with SDK summarize", () =>
514 Effect.gen(function* () {
515 const fileSystem = yield* FileSystem.FileSystem;
516 const workspace = yield* fileSystem.makeTempDirectoryScoped({ prefix: "cursor-v2-errors-" });
517 - const sentMessages: Array<string> = [];
517 + const summarizeRequests: Array<boolean> = [];
518 let sendCalls = 0;
519 const instanceId = ProviderInstanceId.make("cursor");
520 const threadId = ThreadId.make("cursor-transport-error-thread");
@@ -538,9 +538,7 @@ describe("CursorAdapterV2", () => {
538 send: (input) =>
539 Effect.sync(() => {
540 sendCalls += 1;
541 - sentMessages.push(
542 - typeof input.message === "string" ? input.message : input.message.text,
543 - );
541 + summarizeRequests.push(input.summarize === true);
542 const runId = `native-cursor-run-${sendCalls}`;
543 return {
544 agentId: "native-cursor-error",
@@ -551,9 +549,10 @@ describe("CursorAdapterV2", () => {
549 status: "finished" as const,
550 model: { id: "composer-2.5" },
551 durationMs: 1,
554 - ...(sendCalls === 1
555 - ? { result: "Error: RetriableError: WritableIterable is closed" }
556 - : {}),
552 + result:
553 + sendCalls === 1
554 + ? "Error: RetriableError: WritableIterable is closed"
555 + : "Summary of the conversation so far",
556 }),
557 cancel: Effect.void,
558 };
@@ -646,11 +645,12 @@ describe("CursorAdapterV2", () => {
645 attachments: [],
646 },
647 });
649 - yield* runtime.events.pipe(
650 - Stream.filter((event) => event.type === "turn.terminal"),
651 - Stream.runHead,
648 + const compactionEvents = yield* runtime.events.pipe(
649 + Stream.takeUntil((event) => event.type === "turn.terminal"),
650 + Stream.runCollect,
651 );
653 - assert.equal(sentMessages[1], "/compress");
652 + assert.deepEqual(summarizeRequests, [false, true]);
653 + assert.notInclude(JSON.stringify(compactionEvents), "Summary of the conversation so far");
654 }).pipe(
655 Effect.scoped,
656 Effect.provide(
packages/provider-cursor/src/server/adapter.ts
+6 -2
@@ -2385,15 +2385,18 @@ export const makeCursorAdapterV2 = Effect.fn("makeCursorAdapterV2")(function* (
2385 hasDeviceTools,
2386 delivered,
2387 );
2388 + const compacted = message === "/compress";
2389 const pendingUpdates: Array<InteractionUpdate> = [];
2390 let context: ActiveCursorTurn | null = null;
2390 - // MCP send overrides replace the ambient servers loaded when the agent opens.
2391 + // Create-time and send-time mcpServers merge with settingSources (SDK >= 1.0.39).
2392 const sdkRun = yield* agent.session
2393 .send({
2394 message,
2395 + summarize: compacted,
2396 options: {
2397 model: cursorSdkModelSelection(turnInput.modelSelection),
2398 mode: turnInput.runtimePolicy.interactionMode === "plan" ? "plan" : "agent",
2399 + ...(mcpServers === undefined ? {} : { mcpServers }),
2400 },
2401 onDelta: (update) => {
2402 if (context === null) {
@@ -2405,7 +2408,6 @@ export const makeCursorAdapterV2 = Effect.fn("makeCursorAdapterV2")(function* (
2408 },
2409 })
2410 .pipe(Effect.mapError(classifyCursorModelRejection(turnInput.modelSelection)));
2408 - const compacted = message === "/compress";
2411 yield* Ref.set(told, {
2412 agent: agent.nativeThreadId,
2413 orchestration: !compacted && (delivered.orchestration || mcpServers !== undefined),
@@ -2469,6 +2471,8 @@ export const makeCursorAdapterV2 = Effect.fn("makeCursorAdapterV2")(function* (
2471 if (
2472 context !== null &&
2473 context.assistant.nextSegment === 0 &&
2474 + // A summarize run's result is the summary, not an answer.
2475 + !compacted &&
2476 // Text from a resume that made no progress is not the turn's answer.
2477 !isResumeFailureAfterTurnEnded(context, result) &&
2478 result.result !== undefined &&
pnpm-lock.yaml
+27 -27
@@ -833,8 +833,8 @@ importers:
833 specifier: ^0.3.276
834 version: 0.3.276(@anthropic-ai/sdk@0.93.0(zod@4.6.5))(@modelcontextprotocol/sdk@1.29.0(supports-color@8.1.1)(zod@4.6.5))(zod@4.6.5)
835 '@cursor/sdk':
836 - specifier: 1.0.38
837 - version: 1.0.38(zod@4.6.5)
836 + specifier: 1.2.0
837 + version: 1.2.0(zod@4.6.5)
838 '@effect/platform-node':
839 specifier: 4.0.5
840 version: 4.0.5(bufferutil@4.1.0)(effect@4.0.5)(redis@6.2.1)(utf-8-validate@6.0.6)
@@ -1701,8 +1701,8 @@ importers:
1701 packages/provider-cursor:
1702 dependencies:
1703 '@cursor/sdk':
1704 - specifier: 1.0.38
1705 - version: 1.0.38(zod@4.6.5)
1704 + specifier: 1.2.0
1705 + version: 1.2.0(zod@4.6.5)
1706 '@napi-rs/keyring':
1707 specifier: ^1.3.0
1708 version: 1.3.0
@@ -3511,38 +3511,38 @@ packages:
3511 resolution: {integrity: sha512-bPlN9S9O1A0euCpEWE4qnvB5YDuyYVsUTrxSgmAM1Is0j4tICHoVyOVAXfWMP/kS9ZrjvyIXWV2PmomiAXXqOw==}
3512 engines: {node: '>=20.19.0'}
3513
3514 - '@cursor/sdk-darwin-arm64@1.0.38':
3515 - resolution: {integrity: sha512-pXxj4pjbIoDo6ZjgksSf4VTD4EJz6BGDKvFjDVVUMg0PmLCVbceOnp0pqfRO8SVpdUSE45GFrXuLnSZgLag/xw==}
3514 + '@cursor/sdk-darwin-arm64@1.2.0':
3515 + resolution: {integrity: sha512-UkZ/RdxKCpOQ85nRgzSq+g0h+gIw36/lCEvQvomhs5EkSFZW3OwbeEzkAU3UYglZ7t3RNHj3mc5C5cdDtHguvw==}
3516 cpu: [arm64]
3517 os: [darwin]
3518 hasBin: true
3519
3520 - '@cursor/sdk-darwin-x64@1.0.38':
3521 - resolution: {integrity: sha512-rutfTMq1f9WZckPFH8R5bzNzHaZg7I/TijVUkfD3GbqIqqc5OKHzdTMqZf+AFAqRDQccGJn4GLWcnQ9wTwIVNA==}
3520 + '@cursor/sdk-darwin-x64@1.2.0':
3521 + resolution: {integrity: sha512-mJTFdX+qv9dHAm59tT7uq7ci7+BDvFoNk4gdF2zGp9SLULicY+FdFD64p1qLen1bX5Y2soZaX5mWBy7BfObjcg==}
3522 cpu: [x64]
3523 os: [darwin]
3524 hasBin: true
3525
3526 - '@cursor/sdk-linux-arm64@1.0.38':
3527 - resolution: {integrity: sha512-CqmUnM8W8W2mKucSrdHO0kn4ems82siWuo7kvVJvXCtPkaziVNC++dro5h9hSh2oVgRbB91sWQ4lzsHVIDpkvA==}
3526 + '@cursor/sdk-linux-arm64@1.2.0':
3527 + resolution: {integrity: sha512-Rs+cd5snuhxMAHkpqRfEGPB1qAsfqSOYJh5SOHZTOWy2LkRVO62WHwd4x80C2emj+dosTV5WAcuF2kMKKcrDJg==}
3528 cpu: [arm64]
3529 os: [linux]
3530 hasBin: true
3531
3532 - '@cursor/sdk-linux-x64@1.0.38':
3533 - resolution: {integrity: sha512-RL6OJTAF3oozMG+HNtykySQ5BOP94yJNWP65wZ2yzMLTAW9ao80++OnaWJya1lndLacHLYP+QZT4igm5TT+BWQ==}
3532 + '@cursor/sdk-linux-x64@1.2.0':
3533 + resolution: {integrity: sha512-ainsGAFtkWTBZrLABp82Hvfv7VB/FxmZHE42qMVotFTRDwOY2iduvhSig910bVxv+kw3S00Srmu/9CxklLwhbw==}
3534 cpu: [x64]
3535 os: [linux]
3536 hasBin: true
3537
3538 - '@cursor/sdk-win32-x64@1.0.38':
3539 - resolution: {integrity: sha512-IUfuCk/S/qzEB+tfT4yWH6iSMz56Lvakn1zNjdk+oAsZ7RJWtWkZcea6eqMSRB1WLmTeQG0uetXKX330w+xI0A==}
3538 + '@cursor/sdk-win32-x64@1.2.0':
3539 + resolution: {integrity: sha512-p3rkyta6R/nXIukd3/ifJq32otkkGoUi41T2jxnHbPHMhzE2F8OuJQGBVmORuQLMr+bIGGVZmCxertgs4WgzcQ==}
3540 cpu: [x64]
3541 os: [win32]
3542 hasBin: true
3543
3544 - '@cursor/sdk@1.0.38':
3545 - resolution: {integrity: sha512-8UwPKaprIXvlVR71yHyNNTyFwZCOzfHW7W+FKjPdDS9Ym9FDZc51Jwsu9lAhxHf7n0US3t0pybkDaNFdldrQ+A==}
3544 + '@cursor/sdk@1.2.0':
3545 + resolution: {integrity: sha512-Nqm2U0zTWrYEDCv3Rdwsfa1gYZWsg+JnY+I2F8BwWSAr3FNo0TZWwyHWoWngZgriF1w02fJ4gjJWaul9zysvgQ==}
3546 engines: {node: '>=22.13'}
3547 peerDependencies:
3548 zod: ^3.25.0 || ^4.0.0
@@ -13501,22 +13501,22 @@ snapshots:
13501
13502 '@csstools/css-tokenizer@4.0.1': {}
13503
13504 - '@cursor/sdk-darwin-arm64@1.0.38':
13504 + '@cursor/sdk-darwin-arm64@1.2.0':
13505 optional: true
13506
13507 - '@cursor/sdk-darwin-x64@1.0.38':
13507 + '@cursor/sdk-darwin-x64@1.2.0':
13508 optional: true
13509
13510 - '@cursor/sdk-linux-arm64@1.0.38':
13510 + '@cursor/sdk-linux-arm64@1.2.0':
13511 optional: true
13512
13513 - '@cursor/sdk-linux-x64@1.0.38':
13513 + '@cursor/sdk-linux-x64@1.2.0':
13514 optional: true
13515
13516 - '@cursor/sdk-win32-x64@1.0.38':
13516 + '@cursor/sdk-win32-x64@1.2.0':
13517 optional: true
13518
13519 - '@cursor/sdk@1.0.38(zod@4.6.5)':
13519 + '@cursor/sdk@1.2.0(zod@4.6.5)':
13520 dependencies:
13521 '@bufbuild/protobuf': 1.10.0
13522 '@connectrpc/connect': 1.7.0(@bufbuild/protobuf@1.10.0)
@@ -13524,11 +13524,11 @@ snapshots:
13524 '@statsig/js-client': 3.31.0
13525 zod: 4.6.5
13526 optionalDependencies:
13527 - '@cursor/sdk-darwin-arm64': 1.0.38
13528 - '@cursor/sdk-darwin-x64': 1.0.38
13529 - '@cursor/sdk-linux-arm64': 1.0.38
13530 - '@cursor/sdk-linux-x64': 1.0.38
13531 - '@cursor/sdk-win32-x64': 1.0.38
13527 + '@cursor/sdk-darwin-arm64': 1.2.0
13528 + '@cursor/sdk-darwin-x64': 1.2.0
13529 + '@cursor/sdk-linux-arm64': 1.2.0
13530 + '@cursor/sdk-linux-x64': 1.2.0
13531 + '@cursor/sdk-win32-x64': 1.2.0
13532
13533 '@date-fns/tz@1.5.0': {}
13534
pnpm-workspace.yaml
+6
@@ -227,6 +227,12 @@ minimumReleaseAgeExclude:
227 - "@pierre/highlights@0.2.0"
228 - "@pierre/theming@1.0.2"
229 - agent-device@0.21.32
230 + - "@cursor/sdk-darwin-arm64@1.2.0"
231 + - "@cursor/sdk-darwin-x64@1.2.0"
232 + - "@cursor/sdk-linux-arm64@1.2.0"
233 + - "@cursor/sdk-linux-x64@1.2.0"
234 + - "@cursor/sdk-win32-x64@1.2.0"
235 + - "@cursor/sdk@1.2.0"
236
237 overrides:
238 # Pin every patched package, including transitive dependencies, so lockfile-free