Add ACP support with Cursor provider #1355
Mergedjuliusmarmingemerged 101 commits into
main fromrefs/pull/1355/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
- apps/server/src/orchestration/Layers/ProviderCommandReactor.ts line 68OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -48 +48,21 @@484849+function mergeThreadModelOptions(50+ cached: ProviderModelOptions | undefined,51+ incoming: ProviderModelOptions | undefined,52+): ProviderModelOptions | undefined {53+ if (!cached && !incoming) {54+ return undefined;55+ }56+ const next = {57+ ...(incoming?.codex !== undefined || cached?.codex !== undefined58+ ? { codex: incoming?.codex ?? cached?.codex }59+ : {}),60+ ...(incoming?.claudeAgent !== undefined || cached?.claudeAgent !== undefined61+ ? { claudeAgent: incoming?.claudeAgent ?? cached?.claudeAgent }62+ : {}),63+ ...(incoming?.cursor !== undefined || cached?.cursor !== undefined64+ ? { cursor: incoming?.cursor ?? cached?.cursor }65+ : {}),66+ } satisfies Partial<ProviderModelOptions>;67+ return Object.keys(next).length > 0 ? (next as ProviderModelOptions) : undefined;68+}@@ -0,0 +15,21 @@15+ it.effect("performs initialize → session/new → session/prompt against mock agent", () =>16+ Effect.gen(function* () {17+ const conn = yield* makeAcpJsonRpcConnection({18+ command: process.execPath,19+ args: [mockAgentPath],20+ });21+22+ const initResult = yield* conn.request("initialize", {23+ protocolVersion: 1,24+ clientCapabilities: { fs: { readTextFile: false, writeTextFile: false }, terminal: false },25+ clientInfo: { name: "t3-test", version: "0.0.0" },26+ });27+ expect(initResult).toMatchObject({ protocolVersion: 1 });28+29+ yield* conn.request("authenticate", { methodId: "cursor_login" });30+31+ const newResult = yield* conn.request("session/new", {32+ cwd: process.cwd(),33+ mcpServers: [],34+ });35+ expect(newResult).toEqual({ sessionId: "mock-session-1" });
- apps/server/src/provider/Layers/CursorAdapter.ts lines 1217 to 1219OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +1199,21 @@1199+ type: "content.delta",1200+ ...stamp,1201+ provider: PROVIDER,1202+ threadId: ctx.threadId,1203+ turnId: ctx.activeTurnId,1204+ payload: {1205+ streamKind: "assistant_text",1206+ delta: p.text,1207+ },1208+ raw: {1209+ source: "acp.jsonrpc",1210+ method: "session/update",1211+ payload: msg.params,1212+ },1213+ });1214+ }1215+ });1216+1217+ const nf = yield* Stream.runDrain(1218+ Stream.mapEffect(conn.notifications, handleNotification),1219+ ).pipe(Effect.forkChild);apps/server/src/provider/acp/AcpJsonRpcConnection.ts line 43OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +23,21 @@23+ const trimmed = line.trim();24+ if (!trimmed) {25+ return Effect.succeed(null);26+ }27+ const lineSnippet = trimmed.slice(0, 500);28+ return decodeAcpInboundFromJsonLine(trimmed).pipe(29+ Effect.mapError((cause) => new AcpParseError({ line: lineSnippet, cause })),30+ );31+}32+33+export interface AcpJsonRpcConnection {34+ readonly request: (method: string, params?: unknown) => Effect.Effect<unknown, AcpError>;35+ readonly notify: (method: string, params?: unknown) => Effect.Effect<void, AcpError>;36+ readonly registerHandler: (37+ method: string,38+ handler: AcpServerRequestHandler,39+ ) => Effect.Effect<void>;40+ readonly notifications: Stream.Stream<AcpInboundMessage, never>;41+}42+43+export function spawnAcpChildProcess(apps/server/src/provider/acp/AcpJsonRpcConnection.ts line 120OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +100,21 @@100+ }),101+ ),102+ Effect.tap(() => Ref.set(pending, new Map())),103+ );104+105+ const writeRawLine = (payload: Record<string, unknown>) =>106+ Effect.try({107+ try: () => {108+ child.stdin.write(`${JSON.stringify(payload)}\n`);109+ },110+ catch: (cause) =>111+ new AcpSpawnError({112+ message: cause instanceof Error ? cause.message : String(cause),113+ cause,114+ }),115+ });116+117+ const writeSerialized = (payload: Record<string, unknown>) =>118+ writeLock.withPermits(1)(writeRawLine(payload));119+120+ const sendRequest = (method: string, params?: unknown) =>
- apps/web/src/components/chat/CompactComposerControlsMenu.browser.tsx lines 242 to 242OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -216,3 +237,6 @@216237 });217238 });218239240+ it("shows Cursor reasoning controls for GPT-5.3 Codex family", async () => {241+ const mounted = await mountMenu({242+ modelSelection: { provider: "cursor", model: "gpt-5.3-codex-high" },apps/server/src/provider/Layers/CursorAdapter.ts lines 644 to 649OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +629,21 @@629+ }630+ const text = typeof content.text === "string" ? content.text : undefined;631+ if (su !== undefined && text !== undefined) {632+ return {633+ sessionUpdate: su,634+ text,635+ ...(modeId !== undefined ? { modeId } : {}),636+ };637+ }638+ if (su !== undefined) {639+ return {640+ sessionUpdate: su,641+ ...(modeId !== undefined ? { modeId } : {}),642+ };643+ }644+ if (text !== undefined) {645+ return {646+ text,647+ ...(modeId !== undefined ? { modeId } : {}),648+ };649+ }packages/shared/src/model.ts lines 351 to 353OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -9,0 +333,21 @@333+ model: string | null | undefined,334+ persisted: CursorModelOptions | null | undefined,335+): CursorModelOptions | undefined {336+ const sel = parseCursorModelSelection(model, persisted);337+ const cap = getCursorModelCapabilities(sel.family);338+ const defaultReasoning = DEFAULT_REASONING_EFFORT_BY_PROVIDER.cursor as CursorReasoningOption;339+ const next: {340+ reasoning?: CursorReasoningOption;341+ fastMode?: boolean;342+ thinking?: boolean;343+ claudeOpusTier?: CursorClaudeOpusTier;344+ } = {};345+ if (cap.supportsReasoning && sel.reasoning !== defaultReasoning) {346+ next.reasoning = sel.reasoning;347+ }348+ if (cap.supportsFast && sel.fast) {349+ next.fastMode = true;350+ }351+ if (cap.supportsThinking && sel.thinking === false) {352+ next.thinking = false;353+ }apps/web/src/composerDraftStore.ts line 644Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -484,4 +492,20 @@484492 }485493 : undefined;486494487- if (!codex && !claude) {495+ const cursorReasoningRaw = cursorCandidate?.reasoning;496+ const cursorReasoning: CursorReasoningOption | undefined =497+ typeof cursorReasoningRaw === "string" &&498+ (CURSOR_REASONING_OPTIONS as readonly string[]).includes(cursorReasoningRaw)499+ ? (cursorReasoningRaw as CursorReasoningOption)500+ : undefined;501+ const cursorFastMode = cursorCandidate?.fastMode === true;502+ const cursorThinkingFalse = cursorCandidate?.thinking === false;503+ const cursorClaudeOpusTierRaw = cursorCandidate?.claudeOpusTier;504+ const cursorClaudeOpusTier =505+ cursorClaudeOpusTierRaw === "max" || cursorClaudeOpusTierRaw === "high"506+ ? cursorClaudeOpusTierRaw507+ : undefined;508+ const defaultCursorReasoning =509+ DEFAULT_REASONING_EFFORT_BY_PROVIDER.cursor as CursorReasoningOption;510+511+ const cursor: CursorModelOptions | undefined =
- apps/web/src/components/chat/CompactComposerControlsMenu.browser.tsx lines 117 to 133OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -113 +114,20 @@113- ];114+ ]115+ : provider === "cursor"116+ ? [117+ {118+ slug: "gpt-5.3-codex",119+ name: "Codex 5.3",120+ isCustom: false,121+ capabilities: {122+ reasoningEffortLevels: [123+ { value: "low", label: "Low" },124+ { value: "normal", label: "Normal", isDefault: true },125+ { value: "high", label: "High" },126+ { value: "xhigh", label: "Extra high" },127+ ],128+ supportsFastMode: true,129+ supportsThinkingToggle: false,130+ contextWindowOptions: [],131+ promptInjectedEffortLevels: [],132+ },133+ },apps/web/src/composerDraftStore.ts lines 509 to 509OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -492,4 +500,10 @@492500 }493501 : undefined;494502495- if (!codex && !claude) {503+ const cursorReasoningRaw = cursorCandidate?.reasoning;504+ const cursorReasoning: CursorReasoningOption | undefined =505+ typeof cursorReasoningRaw === "string" &&506+ (CURSOR_REASONING_OPTIONS as readonly string[]).includes(cursorReasoningRaw)507+ ? (cursorReasoningRaw as CursorReasoningOption)508+ : undefined;509+ const cursorFastMode = cursorCandidate?.fastMode === true;
- apps/web/src/components/chat/CompactComposerControlsMenu.browser.tsx lines 256 to 256OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -220,3 +242,15 @@220242 });221243 });222244245+ it("shows Cursor reasoning controls for GPT-5.3 Codex family", async () => {246+ const mounted = await mountMenu({247+ modelSelection: { provider: "cursor", model: "gpt-5.3-codex" },248+ });249+250+ try {251+ await page.getByLabelText("More composer controls").click();252+253+ await vi.waitFor(() => {254+ const text = document.body.textContent ?? "";255+ expect(text).toContain("Reasoning");256+ expect(text).toContain("Fast mode");
- apps/server/src/provider/Layers/CursorProvider.ts lines 881 to 882Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +209,21 @@209+export function parseCursorAboutOutput(result: CommandResult): CursorAboutResult {210+ const combined = `${result.stdout}\n${result.stderr}`;211+ const lowerOutput = combined.toLowerCase();212+213+ // If the command itself isn't recognised, we're on an old CLI version.214+ if (215+ lowerOutput.includes("unknown command") ||216+ lowerOutput.includes("unrecognized command") ||217+ lowerOutput.includes("unexpected argument")218+ ) {219+ return {220+ version: null,221+ status: "warning",222+ authStatus: "unknown",223+ message: "The `agent about` command is unavailable in this version of the Cursor Agent CLI.",224+ };225+ }226+227+ const plain = stripAnsi(combined);228+ console.log("plain:", plain);229+ const version = extractAboutField(plain, "CLI Version") ?? null;
- apps/server/src/provider/Layers/CursorAdapter.ts lines 908 to 918OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +898,21 @@898+ }),899+ ),900+ );901+ const cursorModelSelection =902+ input.modelSelection?.provider === "cursor" ? input.modelSelection : undefined;903+ const existing = sessions.get(input.threadId);904+ if (existing && !existing.stopped) {905+ yield* stopSessionInternal(existing);906+ }907+908+ const child = yield* spawnAcpChildProcess(spawnOptions).pipe(909+ Effect.mapError(910+ (e) =>911+ new ProviderAdapterProcessError({912+ provider: PROVIDER,913+ threadId: input.threadId,914+ detail: e.message,915+ cause: e,916+ }),917+ ),918+ );
- apps/server/src/provider/Layers/CursorProvider.ts lines 265 to 269OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +249,21 @@249+ case "default":250+ return "auto";251+ case "composer-2":252+ return fastMode ? "composer-2-fast" : "composer-2";253+ case "composer-1.5":254+ return "composer-1.5";255+ case "gpt-5.3-codex": {256+ const suffix = reasoning && reasoning !== "medium" ? `-${reasoning}` : "";257+ return `gpt-5.3-codex${suffix}${fastMode ? "-fast" : ""}`;258+ }259+ case "gpt-5.3-codex-spark": {260+ const suffix = reasoning && reasoning !== "medium" ? `-${reasoning}` : "";261+ return `gpt-5.3-codex-spark-preview${suffix}`;262+ }263+ case "gpt-5.4":264+ return `gpt-5.4-${reasoning ?? "medium"}${fastMode ? "-fast" : ""}`;265+ case "claude-opus-4-6":266+ return thinking ? "claude-4.6-opus-high-thinking" : "claude-4.6-opus-high";267+ case "claude-sonnet-4-6":268+ return thinking ? "claude-4.6-sonnet-medium-thinking" : "claude-4.6-sonnet-medium";269+ case "gemini-3.1-pro":apps/server/src/provider/Layers/CursorAdapter.ts line 989Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +1433,21 @@1433+ const pending = ctx.pendingUserInputs.get(requestId);1434+ if (!pending) {1435+ return yield* new ProviderAdapterRequestError({1436+ provider: PROVIDER,1437+ method: "cursor/ask_question",1438+ detail: `Unknown pending user-input request: ${requestId}`,1439+ });1440+ }1441+ yield* Deferred.succeed(pending.answers, answers);1442+ });1443+1444+ const readThread: CursorAdapterShape["readThread"] = (threadId) =>1445+ Effect.gen(function* () {1446+ const ctx = yield* requireSession(threadId);1447+ return {1448+ threadId,1449+ turns: ctx.turns,1450+ };1451+ });1452+1453+ const rollbackThread: CursorAdapterShape["rollbackThread"] = (threadId, numTurns) =>
- apps/server/src/provider/acp/AcpTypes.ts lines 95 to 99OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +79,21 @@79+ id,80+ method,81+ ...(parsed.params !== undefined ? { params: parsed.params } : {}),82+ }),83+ );84+ }85+86+ if (hasMethod && !hasId) {87+ return Effect.succeed(88+ AcpInboundNotification.makeUnsafe({89+ method,90+ ...(parsed.params !== undefined ? { params: parsed.params } : {}),91+ }),92+ );93+ }94+95+ return Effect.fail(96+ new SchemaIssue.InvalidValue(Option.some(parsed), {97+ title: "Unrecognized JSON-RPC inbound message shape",98+ }),99+ );
- apps/server/src/provider/acp/AcpErrors.ts lines 28 to 28OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +8,21 @@8+}) {9+ override get message() {10+ return `Failed to spawn ACP process: ${this.cause instanceof Error ? this.cause.message : String(this.cause)}`;11+ }12+}13+14+export class AcpParseError extends Schema.TaggedErrorClass<AcpParseError>()("AcpParseError", {15+ line: Schema.String,16+ cause: Schema.optional(Schema.Defect),17+}) {18+ override get message() {19+ return `Failed to parse ACP message: ${this.line}`;20+ }21+}22+export class AcpRpcError extends Schema.TaggedErrorClass<AcpRpcError>()("AcpRpcError", {23+ code: Schema.Number,24+ errorMessage: Schema.optional(Schema.String),25+ data: Schema.optional(Schema.Unknown),26+}) {27+ override get message() {28+ return `Failed to send ACP RPC message (code: ${this.code}, message: ${this.errorMessage}, data: ${JSON.stringify(this.data)})`;apps/server/src/provider/acp/AcpJsonRpcConnection.ts lines 182 to 188OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +168,21 @@168+ }169+ if (parseExit.value === null) {170+ return;171+ }172+ const msg = parseExit.value;173+174+ if (msg._tag === "response") {175+ const map = yield* Ref.get(pending);176+ const def = map.get(msg.id);177+ if (!def) return;178+ const next = new Map(map);179+ next.delete(msg.id);180+ yield* Ref.set(pending, next);181+ if (msg.error) {182+ yield* Deferred.fail(183+ def,184+ new AcpRpcError({185+ code: msg.error.code,186+ ...(msg.error.data !== undefined ? { data: msg.error.data } : {}),187+ }),188+ );
- apps/server/src/provider/acp/CursorAcpExtension.ts lines 96 to 99OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +79,21 @@79+ }>;80+} {81+ if (typeof params !== "object" || params === null) {82+ return { plan: [] };83+ }84+ const record = params as {85+ readonly todos?: ReadonlyArray<{86+ readonly content?: string;87+ readonly title?: string;88+ readonly status?: string;89+ }>;90+ readonly items?: ReadonlyArray<{91+ readonly content?: string;92+ readonly title?: string;93+ readonly status?: string;94+ }>;95+ };96+ const todos = record.todos ?? record.items;97+ if (!todos) {98+ return { plan: [] };99+ }apps/server/src/provider/Layers/CursorAdapter.ts line 422Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +290,21 @@290+ };291+292+ const stopSessionInternal = (ctx: CursorSessionContext) =>293+ Effect.gen(function* () {294+ if (ctx.stopped) return;295+ ctx.stopped = true;296+ if (ctx.notificationFiber) {297+ yield* Fiber.interrupt(ctx.notificationFiber);298+ }299+ yield* Effect.ignore(ctx.acp.close);300+ sessions.delete(ctx.threadId);301+ yield* offerRuntimeEvent({302+ type: "session.exited",303+ ...(yield* makeEventStamp()),304+ provider: PROVIDER,305+ threadId: ctx.threadId,306+ payload: { exitKind: "graceful" },307+ });308+ });309+310+ const startSession: CursorAdapterShape["startSession"] = (input) =>patches/effect@4.0.0-beta.41.patch lines 21 to 33OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +13,21 @@13++ hasAnyOf || hasOneOf14++ ? ({ ...js, anyOf: undefined, oneOf: undefined } as JsonSchema.JsonSchema)15++ : js16++17++ let out = on(base)18+19+ const annotations = collectAnnotations(js)20+ if (annotations !== undefined) {21+22+ return js.allOf.reduce((acc, curr) => combine(acc, recur(curr)), out)23+ }24+25++ if (hasAnyOf) {26++ out = combine({ _tag: "Union", types: js.anyOf.map((type) => recur(type)), mode: "anyOf" }, out)27++ }28++29++ if (hasOneOf) {30++ out = combine({ _tag: "Union", types: js.oneOf.map((type) => recur(type)), mode: "oneOf" }, out)31++ }32++33+ return outpackages/effect-acp/scripts/generate.ts lines 257 to 269Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +229,21 @@229+ const metaOutput = [230+ `export const AGENT_METHODS = ${yield* Schema.encodeEffect(Schema.fromJsonString(MetaJsonSchema.fields.agentMethods))(upstreamMeta.agentMethods)} as const;`,231+ "",232+ `export const CLIENT_METHODS = ${yield* Schema.encodeEffect(Schema.fromJsonString(MetaJsonSchema.fields.clientMethods))(upstreamMeta.clientMethods)} as const;`,233+ "",234+ `export const PROTOCOL_VERSION = ${yield* Schema.encodeEffect(Schema.fromJsonString(MetaJsonSchema.fields.version))(upstreamMeta.version)} as const;`,235+ "",236+ ].join("\n");237+238+ yield* writeGeneratedFiles(schemaOutput, metaOutput);239+ yield* Effect.log(240+ `Generated ${generatedEntries.size} ACP schemas from ${CURRENT_SCHEMA_RELEASE}`,241+ );242+243+ const { generatedDir } = yield* getGeneratedPaths();244+ yield* Effect.service(ChildProcessSpawner.ChildProcessSpawner).pipe(245+ Effect.flatMap((spawner) => spawner.spawn(ChildProcess.make("bun", ["oxfmt", generatedDir]))),246+ Effect.flatMap((child) => child.exitCode),247+ Effect.tap(() => Effect.log("Formatted generated files")),248+ );249+});
- apps/server/src/provider/acp/AcpRuntimeModel.ts lines 416 to 426Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +394,21 @@394+ ...(toolCall ? { toolCall } : {}),395+ };396+}397+398+export function parseSessionUpdateEvent(params: EffectAcpSchema.SessionNotification): {399+ readonly modeId?: string;400+ readonly events: ReadonlyArray<AcpParsedSessionEvent>;401+} {402+ const upd = params.update;403+ const events: Array<AcpParsedSessionEvent> = [];404+ let modeId: string | undefined;405+406+ switch (upd.sessionUpdate) {407+ case "current_mode_update": {408+ modeId = upd.currentModeId;409+ events.push({410+ _tag: "ModeChanged",411+ modeId,412+ });413+ break;414+ }apps/server/src/provider/Layers/CursorProvider.ts lines 274 to 275OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +255,21 @@255+ case "gpt-5.3-codex": {256+ const suffix = reasoning && reasoning !== "medium" ? `-${reasoning}` : "";257+ return `gpt-5.3-codex${suffix}${fastMode ? "-fast" : ""}`;258+ }259+ case "gpt-5.3-codex-spark": {260+ const suffix = reasoning && reasoning !== "medium" ? `-${reasoning}` : "";261+ return `gpt-5.3-codex-spark-preview${suffix}`;262+ }263+ case "gpt-5.4":264+ return `gpt-5.4-${reasoning ?? "medium"}${fastMode ? "-fast" : ""}`;265+ case "claude-opus-4-6":266+ return thinking ? "claude-4.6-opus-high-thinking" : "claude-4.6-opus-high";267+ case "claude-sonnet-4-6":268+ return thinking ? "claude-4.6-sonnet-medium-thinking" : "claude-4.6-sonnet-medium";269+ case "gemini-3.1-pro":270+ return "gemini-3.1-pro";271+ case "grok-4-20":272+ return thinking ? "grok-4-20-thinking" : "grok-4-20";273+ default:274+ return slug === "default" ? "auto" : slug;275+ }
- apps/web/src/components/chat/MessagesTimeline.tsx lines 884 to 889OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -875,15 +882,8 @@875882 </span>876883 <div className="min-w-0 flex-1 overflow-hidden">877- <p878- className={cn(879- "truncate text-[11px] leading-5",880- workToneClass(workEntry.tone),881- preview ? "text-muted-foreground/70" : "",882- )}883- title={displayText}884- >885- <span className={cn("text-foreground/80", workToneClass(workEntry.tone))}>886- {heading}887- </span>888- {preview && <span className="text-muted-foreground/55"> - {preview}</span>}889- </p>884+ <Tooltip>885+ <TooltipTrigger886+ className="block min-w-0 w-full text-left"887+ title={displayText}888+ aria-label={displayText}889+ >
- @@ -0,0 +198,21 @@198+ {199+ _tag: "Fail",200+ error: error.toProtocolError(),201+ },202+ ],203+ },204+ });205+206+ const handleExtRequest = (message: RpcMessage.RequestEncoded) => {207+ if (!options.onExtRequest) {208+ return respondWithError(message.id, AcpError.AcpRequestError.methodNotFound(message.tag));209+ }210+ return options.onExtRequest(message.tag, message.payload).pipe(211+ Effect.matchEffect({212+ onFailure: (error) => respondWithError(message.id, normalizeToRequestError(error)),213+ onSuccess: (value) => respondWithSuccess(message.id, value),214+ }),215+ );216+ };217+218+ const handleRequestEncoded = (message: RpcMessage.RequestEncoded) => {apps/server/src/provider/Layers/CursorAdapter.test.ts lines 355 to 355OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +335,21 @@335+ assert.equal(String(contentDelta.turnId), String(turn.turnId));336+ assert.equal(contentDelta.payload.delta, "hello from mock");337+ }338+ });339+340+ yield* program.pipe(341+ Effect.ensuring(342+ Effect.sync(() => {343+ if (previousEmitToolCalls === undefined) {344+ delete process.env.T3_ACP_EMIT_TOOL_CALLS;345+ } else {346+ process.env.T3_ACP_EMIT_TOOL_CALLS = previousEmitToolCalls;347+ }348+ }),349+ ),350+ );351+ }).pipe(352+ Effect.provide(353+ makeCursorAdapterLive().pipe(354+ Layer.provideMerge(ServerSettingsService.layerTest()),355+ Layer.provideMerge(ServerConfig.layerTest(process.cwd(), process.cwd())),packages/effect-acp/src/protocol.ts line 448OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +428,21 @@428+ supportsAck: true,429+ supportsTransferables: false,430+ });431+432+ const serverProtocol = RpcServer.Protocol.of({433+ run: (f) =>434+ Stream.fromQueue(serverQueue).pipe(435+ Stream.runForEach((message) => f(0, message)),436+ Effect.forever,437+ ),438+ disconnects,439+ send: (_clientId, response) => offerOutgoing(response).pipe(Effect.orDie),440+ end: () => Queue.end(outgoing).pipe(Effect.orDie),441+ clientIds: Effect.succeed(new Set([0])),442+ initialMessage: Effect.succeedNone,443+ supportsAck: true,444+ supportsTransferables: false,445+ supportsSpanPropagation: true,446+ });447+448+ const sendNotification = (method: string, payload: unknown) =>apps/server/src/provider/Layers/CursorAdapter.ts lines 603 to 619OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +466,21 @@466+ "session/request_permission",467+ params,468+ "acp.jsonrpc",469+ );470+ const permissionRequest = parsePermissionRequest(params);471+ const requestId = ApprovalRequestId.makeUnsafe(crypto.randomUUID());472+ const runtimeRequestId = RuntimeRequestId.makeUnsafe(requestId);473+ const decision = yield* Deferred.make<ProviderApprovalDecision>();474+ pendingApprovals.set(requestId, {475+ decision,476+ kind: permissionRequest.kind,477+ });478+ yield* offerRuntimeEvent(479+ makeAcpRequestOpenedEvent({480+ stamp: yield* makeEventStamp(),481+ provider: PROVIDER,482+ threadId: input.threadId,483+ turnId: ctx?.activeTurnId,484+ requestId: runtimeRequestId,485+ permissionRequest,486+ detail: permissionRequest.detail ?? JSON.stringify(params).slice(0, 2000),
- packages/effect-acp/src/client.ts lines 287 to 295OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +275,21 @@275+export const fromChildProcess = Effect.fnUntraced(function* (276+ handle: ChildProcessSpawner.ChildProcessHandle,277+ options: {278+ readonly handlers?: AcpClientHandlers;279+ readonly logIncoming?: boolean;280+ readonly logOutgoing?: boolean;281+ readonly logger?: (event: AcpProtocol.AcpProtocolLogEvent) => Effect.Effect<void, never>;282+ } = {},283+): Effect.fn.Return<AcpClientConnection, never, Scope.Scope> {284+ const handlers = options.handlers ?? {};285+ const transport = yield* AcpProtocol.makeAcpPatchedProtocol({286+ stdio: makeStdioFromChildProcess(handle),287+ processExit: handle.exitCode.pipe(288+ Effect.map(Number),289+ Effect.mapError(290+ (cause) =>291+ new AcpError.AcpProcessExitedError({292+ cause,293+ }),294+ ),295+ ),
juliusmarminge changed the title
- packages/effect-acp/src/client.ts lines 541 to 542OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +522,21 @@522+ const rpc = yield* RpcClient.make(AcpRpcs.AgentRpcs).pipe(523+ Effect.provideService(RpcClient.Protocol, transport.clientProtocol),524+ );525+526+ const callRpc = <A>(effect: Effect.Effect<A, RpcClientError.RpcClientError | AcpSchema.Error>) =>527+ effect.pipe(528+ Effect.catchTag("RpcClientError", (error) =>529+ Effect.fail(530+ new AcpError.AcpTransportError({531+ detail: error.message,532+ cause: error,533+ }),534+ ),535+ ),536+ Effect.catchIf(Schema.is(AcpSchema.Error), (error) =>537+ Effect.fail(AcpError.AcpRequestError.fromProtocolError(error)),538+ ),539+ );540+541+ const request = <A>(method: string, payload: unknown) =>542+ transport.request(method, payload).pipe(Effect.map((value) => value as A));apps/server/src/provider/Layers/CursorAdapter.ts lines 933 to 945Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +781,21 @@781+ });782+783+ return {784+ threadId: input.threadId,785+ turnId,786+ resumeCursor: ctx.session.resumeCursor,787+ };788+ });789+790+ const interruptTurn: CursorAdapterShape["interruptTurn"] = (threadId) =>791+ Effect.gen(function* () {792+ const ctx = yield* requireSession(threadId);793+ yield* settlePendingApprovalsAsCancelled(ctx.pendingApprovals);794+ yield* Effect.ignore(795+ ctx.acp.cancel.pipe(796+ Effect.mapError((error) =>797+ mapAcpToAdapterError(PROVIDER, threadId, "session/cancel", error),798+ ),799+ ),800+ );801+ });packages/effect-acp/src/client.ts line 359Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +413,21 @@413+ const coreHandlers: AcpCoreRequestHandlers = {};414+ const notificationHandlers: AcpNotificationHandlers = {415+ sessionUpdate: [],416+ elicitationComplete: [],417+ };418+ const extRequestHandlers = new Map<419+ string,420+ (params: unknown) => Effect.Effect<unknown, AcpError.AcpError>421+ >();422+ const extNotificationHandlers = new Map<423+ string,424+ (params: unknown) => Effect.Effect<void, AcpError.AcpError>425+ >();426+ let unknownExtRequestHandler:427+ | ((method: string, params: unknown) => Effect.Effect<unknown, AcpError.AcpError>)428+ | undefined;429+ let unknownExtNotificationHandler:430+ | ((method: string, params: unknown) => Effect.Effect<void, AcpError.AcpError>)431+ | undefined;432+433+ const dispatchNotification = (notification: AcpProtocol.AcpIncomingNotification) => {apps/server/src/provider/Layers/CursorAdapter.ts line 382OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +362,21 @@362+ new ProviderAdapterProcessError({363+ provider: PROVIDER,364+ threadId: input.threadId,365+ detail: error.message,366+ cause: error,367+ }),368+ ),369+ );370+371+ const pendingApprovals = new Map<ApprovalRequestId, PendingApproval>();372+ const pendingUserInputs = new Map<ApprovalRequestId, PendingUserInput>();373+ let ctx!: CursorSessionContext;374+375+ const resumeSessionId = parseCursorResume(input.resumeCursor)?.sessionId;376+ const acpNativeLoggers = makeAcpNativeLoggers({377+ nativeEventLogger,378+ provider: PROVIDER,379+ threadId: input.threadId,380+ });381+382+ const acpContextScope = yield* Scope.make("sequential");
- packages/effect-acp/src/client.ts line 309Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +290,21 @@290+ ) => Effect.Effect<AcpSchema.WaitForTerminalExitResponse, AcpError.AcpError>;291+ terminalKill?: (292+ request: AcpSchema.KillTerminalRequest,293+ ) => Effect.Effect<AcpSchema.KillTerminalResponse | void, AcpError.AcpError>;294+ terminalRelease?: (295+ request: AcpSchema.ReleaseTerminalRequest,296+ ) => Effect.Effect<AcpSchema.ReleaseTerminalResponse | void, AcpError.AcpError>;297+}298+299+interface AcpNotificationHandlers {300+ readonly sessionUpdate: Array<301+ (notification: AcpSchema.SessionNotification) => Effect.Effect<void, AcpError.AcpError>302+ >;303+ readonly elicitationComplete: Array<304+ (305+ notification: AcpSchema.ElicitationCompleteNotification,306+ ) => Effect.Effect<void, AcpError.AcpError>307+ >;308+}309+310+export const make = Effect.fn("effect-acp/AcpClient.make")(function* (packages/effect-acp/src/protocol.ts lines 161 to 168Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +147,21 @@147+ }148+ const next = new Map(pending);149+ next.delete(requestId);150+ return next;151+ });152+153+ const completeExtPendingFailure = (requestId: string, error: AcpError.AcpError) =>154+ resolveExtPending(requestId, (deferred) => Deferred.fail(deferred, error));155+156+ const completeExtPendingSuccess = (requestId: string, value: unknown) =>157+ resolveExtPending(requestId, (deferred) => Deferred.succeed(deferred, value));158+159+ const failAllExtPending = (error: AcpError.AcpError) =>160+ Ref.get(extPending).pipe(161+ Effect.flatMap((pending) =>162+ Effect.forEach([...pending.values()], (deferred) => Deferred.fail(deferred, error), {163+ discard: true,164+ }),165+ ),166+ Effect.andThen(Ref.set(extPending, new Map())),167+ );packages/effect-acp/src/agent.ts lines 365 to 365OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +345,21 @@345+ runHandler(coreHandlers.closeSession, payload, AGENT_METHODS.session_close),346+ [AGENT_METHODS.session_set_model]: (payload) =>347+ runHandler(coreHandlers.setSessionModel, payload, AGENT_METHODS.session_set_model),348+ [AGENT_METHODS.session_set_config_option]: (payload) =>349+ runHandler(350+ coreHandlers.setSessionConfigOption,351+ payload,352+ AGENT_METHODS.session_set_config_option,353+ ),354+ [AGENT_METHODS.session_prompt]: (payload) =>355+ runHandler(coreHandlers.prompt, payload, AGENT_METHODS.session_prompt),356+ }),357+ );358+359+ yield* RpcServer.make(AcpRpcs.AgentRpcs).pipe(360+ Effect.provideService(RpcServer.Protocol, transport.serverProtocol),361+ Effect.provide(agentHandlerLayer),362+ Effect.forkScoped,363+ );364+365+ let nextRpcRequestId = 1n;
- apps/server/src/provider/Layers/CursorProvider.ts lines 447 to 447OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +427,21 @@427+ const contextOption = configOptions.find(428+ (option) => option.category === "model_config" && isCursorContextConfigOption(option),429+ );430+ if (contextOption && modelOptions?.contextWindow) {431+ const value = findCursorSelectOptionValue(432+ contextOption,433+ (option) =>434+ normalizeCursorConfigOptionToken(option.value) ===435+ normalizeCursorConfigOptionToken(modelOptions.contextWindow) ||436+ normalizeCursorConfigOptionToken(option.name) ===437+ normalizeCursorConfigOptionToken(modelOptions.contextWindow),438+ );439+ if (value) {440+ updates.push({ configId: contextOption.id, value });441+ }442+ }443+444+ const fastOption = configOptions.find(445+ (option) => option.category === "model_config" && isCursorFastConfigOption(option),446+ );447+ if (fastOption && modelOptions?.fastMode === true) {apps/server/src/provider/Layers/CursorAdapter.ts lines 1025 to 1030Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +895,21 @@895+ const ctx = yield* requireSession(threadId);896+ yield* stopSessionInternal(ctx);897+ });898+899+ const listSessions: CursorAdapterShape["listSessions"] = () =>900+ Effect.sync(() => Array.from(sessions.values(), (c) => ({ ...c.session })));901+902+ const hasSession: CursorAdapterShape["hasSession"] = (threadId) =>903+ Effect.sync(() => {904+ const c = sessions.get(threadId);905+ return c !== undefined && !c.stopped;906+ });907+908+ const stopAll: CursorAdapterShape["stopAll"] = () =>909+ Effect.forEach(sessions.values(), stopSessionInternal, { discard: true });910+911+ yield* Effect.addFinalizer(() =>912+ Effect.forEach(sessions.values(), stopSessionInternal, { discard: true }).pipe(913+ Effect.tap(() => Queue.shutdown(runtimeEventQueue)),914+ ),915+ );apps/server/scripts/acp-mock-agent.ts line 288Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +246,21 @@246+ currentModeId = request.value;247+ }248+ if (request.configId === "model" && typeof request.value === "string") {249+ currentModelId = request.value;250+ }251+ if (request.configId === "reasoning" && typeof request.value === "string") {252+ currentReasoning = request.value;253+ }254+ if (request.configId === "context" && typeof request.value === "string") {255+ currentContext = request.value;256+ }257+ if (request.configId === "fast") {258+ currentFast = request.value === true || request.value === "true";259+ }260+ return {261+ configOptions: configOptions(),262+ };263+ }),264+ );265+266+ yield* agent.handleCancel(({ sessionId }) =>
- apps/server/src/provider/Layers/CursorAdapter.ts lines 1044 to 1049Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +914,21 @@914+ ),915+ );916+917+ return {918+ provider: PROVIDER,919+ capabilities: { sessionModelSwitch: "in-session" },920+ startSession,921+ sendTurn,922+ interruptTurn,923+ readThread,924+ rollbackThread,925+ respondToRequest,926+ respondToUserInput,927+ stopSession,928+ listSessions,929+ hasSession,930+ stopAll,931+ get streamEvents() {932+ return Stream.fromQueue(runtimeEventQueue);933+ },934+ } satisfies CursorAdapterShape;apps/server/src/provider/Layers/CursorAdapter.ts lines 499 to 499OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +479,21 @@479+ yield* logNative(480+ input.threadId,481+ "cursor/update_todos",482+ params,483+ "acp.cursor.extension",484+ );485+ if (ctx) {486+ yield* emitPlanUpdate(487+ ctx,488+ extractTodosAsPlan(params),489+ params,490+ "acp.cursor.extension",491+ "cursor/update_todos",492+ );493+ }494+ }),495+ );496+ yield* acp.handleRequestPermission((params) =>497+ Effect.gen(function* () {498+ yield* logNative(input.threadId, "session/request_permission", params, "acp.jsonrpc");499+ if (ctx?.session.runtimeMode === "full-access") {
- apps/server/src/provider/Layers/CursorProvider.ts lines 231 to 245Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +313,21 @@313+ })314+ : [];315+316+ const contextOption = configOptions.find(317+ (option) => option.category === "model_config" && isCursorContextConfigOption(option),318+ );319+ const contextWindowOptions =320+ contextOption?.type === "select"321+ ? flattenSessionConfigSelectOptions(contextOption).map((entry) => {322+ if (contextOption.currentValue === entry.value) {323+ return {324+ value: entry.value,325+ label: entry.name,326+ isDefault: true,327+ };328+ }329+ return {330+ value: entry.value,331+ label: entry.name,332+ };333+ })
- apps/server/src/provider/Layers/ProviderRegistry.ts line 52OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -32,14 +42,11 @@3242 Effect.gen(function* () {3343 const codexProvider = yield* CodexProvider;3444 const claudeProvider = yield* ClaudeProvider;45+ const cursorProvider = yield* CursorProvider;3546 const changesPubSub = yield* Effect.acquireRelease(3647 PubSub.unbounded<ReadonlyArray<ServerProvider>>(),3748 PubSub.shutdown,3849 );39- const providersRef = yield* Ref.make<ReadonlyArray<ServerProvider>>(40- yield* loadProviders(codexProvider, claudeProvider),41- );50+ const providersRef = yield* Ref.make<ReadonlyArray<ServerProvider>>([]);425143- const syncProviders = Effect.fn("syncProviders")(function* (options?: {44- readonly publish?: boolean;45- }) {52+ const applyProviderSnapshot = Effect.fn("applyProviderSnapshot")(function* (apps/server/scripts/cursor-acp-model-mismatch-probe.ts lines 315 to 323Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +303,21 @@303+ }304+305+ const option = findConfigOption(configOptions, predicate);306+ const values = flattenSelectValues(option);307+ if (!option || !values.includes(value)) {308+ logSection(`SKIP_${label}`, {309+ requestedValue: value,310+ availableValues: values,311+ });312+ return configOptions;313+ }314+315+ const response = (await rpc.request("session/set_config_option", {316+ sessionId,317+ configId: option.id,318+ value,319+ })) as SetConfigResult;320+321+ logSection(`SET_${label}_RESPONSE`, response);322+ return response.configOptions ?? configOptions;323+}
- apps/server/src/provider/Layers/CursorProvider.ts lines 992 to 992Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +857,21 @@857+ auth: { status: "unknown" },858+ message: "Cursor is disabled in T3 Code settings.",859+ },860+ });861+ }862+863+ // Single `agent about` probe: returns version + auth status in one call.864+ const aboutProbe = yield* runCursorAboutCommand.pipe(865+ Effect.timeoutOption(ABOUT_TIMEOUT_MS),866+ Effect.result,867+ );868+869+ if (Result.isFailure(aboutProbe)) {870+ const error = aboutProbe.failure;871+ return buildServerProvider({872+ provider: PROVIDER,873+ enabled: cursorSettings.enabled,874+ checkedAt,875+ models: fallbackModels,876+ probe: {877+ installed: !isCommandMissingCause(error),
- apps/server/src/git/Layers/CursorTextGeneration.ts line 219Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -0,0 +199,21 @@199+200+ return yield* Schema.decodeEffect(Schema.fromJsonString(outputSchemaJson))(201+ extractJsonObject(rawResult),202+ ).pipe(203+ Effect.catchTag("SchemaError", (cause) =>204+ Effect.fail(205+ new TextGenerationError({206+ operation,207+ detail: "Cursor Agent returned invalid structured output.",208+ cause,209+ }),210+ ),211+ ),212+ );213+ }).pipe(214+ Effect.mapError((cause) =>215+ isTextGenerationError(cause)216+ ? cause217+ : mapCursorAcpError(operation, "Cursor ACP text generation failed.", cause),218+ ),219+ Effect.scoped,
- apps/server/src/provider/Layers/CursorProvider.ts line 311Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +291,21 @@291+ );292+}293+294+export function buildCursorDiscoveredModelsFromConfigOptions(295+ configOptions: ReadonlyArray<EffectAcpSchema.SessionConfigOption> | null | undefined,296+): ReadonlyArray<ServerProviderModel> {297+ if (!configOptions || configOptions.length === 0) {298+ return [];299+ }300+301+ const modelOption = findCursorModelConfigOption(configOptions);302+ const modelChoices = flattenSessionConfigSelectOptions(modelOption);303+ if (!modelOption || modelChoices.length === 0) {304+ return [];305+ }306+307+ const currentModelValue =308+ modelOption.type === "select" ? modelOption.currentValue?.trim() || undefined : undefined;309+ const currentModelCapabilities = buildCursorCapabilitiesFromConfigOptions(configOptions);310+311+ return buildCursorDiscoveredModels(
- @@ -375,3 +375,4 @@375375376376 try {377377 await waitForHttpReady(baseUrl, {378+ path: options?.path ?? "/.well-known/t3/environment",
- apps/server/scripts/cursor-acp-model-mismatch-probe.ts line 383OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +363,21 @@363+ const advertisedModels = flattenSelectValues(modelConfig);364+ logSection("ADVERTISED_MODEL_VALUES", advertisedModels);365+366+ if (!modelConfig || modelConfig.type !== "select") {367+ fail("Cursor ACP did not expose a select-type model config option.");368+ }369+370+ if (!advertisedModels.includes(targetModel)) {371+ fail(372+ `Cursor ACP did not advertise model ${JSON.stringify(targetModel)}. Advertised values: ${advertisedModels.join(", ")}`,373+ );374+ }375+376+ const setModelResponse = (await rpc.request("session/set_config_option", {377+ sessionId,378+ configId: modelConfig.id,379+ value: targetModel,380+ })) as SetConfigResult;381+ logSection("SET_MODEL_RESPONSE", setModelResponse);382+383+ configOptions = setModelResponse.configOptions ?? configOptions;packages/effect-acp/src/_internal/shared.ts lines 28 to 43Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +23,21 @@23+ Effect.catchIf(Schema.is(AcpSchema.Error), (error) =>24+ Effect.fail(AcpError.AcpRequestError.fromProtocolError(error)),25+ ),26+ );27+28+export const runHandler = Effect.fnUntraced(function* <A, B>(29+ handler: ((payload: A) => Effect.Effect<B, AcpError.AcpError>) | undefined,30+ payload: A,31+ method: string,32+) {33+ if (!handler) {34+ return yield* AcpError.AcpRequestError.methodNotFound(method);35+ }36+ return yield* handler(payload).pipe(37+ Effect.mapError((error) =>38+ Schema.is(AcpError.AcpRequestError)(error)39+ ? error.toProtocolError()40+ : AcpError.AcpRequestError.internalError(error.message).toProtocolError(),41+ ),42+ );43+});apps/server/src/provider/makeManagedServerProvider.ts line 44Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -24,3 +30,8 @@2430 const initialSnapshot = input.initialSnapshot(initialSettings);2531 const snapshotRef = yield* Ref.make(initialSnapshot);2632 const settingsRef = yield* Ref.make(initialSettings);33+ const enrichmentFiberRef = yield* Ref.make<Fiber.Fiber<void, unknown> | null>(null);34+ const enrichmentGenerationRef = yield* Ref.make(0);35+ const scope = yield* Effect.scope;36+37+ const publishEnrichedSnapshot = Effect.fn("publishEnrichedSnapshot")(function* (
- apps/server/src/provider/Layers/CursorAdapter.ts line 367OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +347,21 @@347+ const startSession: CursorAdapterShape["startSession"] = (input) =>348+ Effect.gen(function* () {349+ if (input.provider !== undefined && input.provider !== PROVIDER) {350+ return yield* new ProviderAdapterValidationError({351+ provider: PROVIDER,352+ operation: "startSession",353+ issue: `Expected provider '${PROVIDER}' but received '${input.provider}'.`,354+ });355+ }356+ if (!input.cwd?.trim()) {357+ return yield* new ProviderAdapterValidationError({358+ provider: PROVIDER,359+ operation: "startSession",360+ issue: "cwd is required and must be non-empty.",361+ });362+ }363+364+ const cwd = nodePath.resolve(input.cwd.trim());365+ const cursorModelSelection =366+ input.modelSelection?.provider === "cursor" ? input.modelSelection : undefined;367+ const existing = sessions.get(input.threadId);apps/server/src/provider/acp/AcpJsonRpcConnection.test.ts line 346Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +291,21 @@291+ command: bunExe,292+ args: [mockAgentPath],293+ },294+ cwd: process.cwd(),295+ clientInfo: { name: "t3-test", version: "0.0.0" },296+ protocolLogging: {297+ logIncoming: true,298+ logOutgoing: true,299+ logger: (event) =>300+ Effect.sync(() => {301+ protocolEvents.push(event);302+ }),303+ },304+ }),305+ ),306+ Effect.scoped,307+ Effect.provide(NodeServices.layer),308+ );309+ });310+311+ it.effect("rejects invalid config option values before sending session/set_config_option", () => {
Sign in to join this conversation.



Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
c2d0780d-752d-49d8-b364-1135b6096558You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment `@coderabbitai help` to get the list of available commands and usage tips.