Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/server/scripts/cursor-acp-model-mismatch-probe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const promptText = NodeProcess.argv[4] ?? "helo";
const targetReasoning = NodeProcess.env.CURSOR_REASONING ?? "";
const targetContext = NodeProcess.env.CURSOR_CONTEXT ?? "";
const targetFast = NodeProcess.env.CURSOR_FAST ?? "";
const agentBin = NodeProcess.env.CURSOR_AGENT_BIN ?? "agent";
const agentBin = NodeProcess.env.CURSOR_AGENT_BIN ?? "cursor-agent";
const promptWaitMs = Number(NodeProcess.env.CURSOR_PROMPT_WAIT_MS ?? "4000");
const requestTimeoutMs = Number(NodeProcess.env.CURSOR_REQUEST_TIMEOUT_MS ?? "20000");

Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/provider/Drivers/CursorDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const UPDATE = makeStaticProviderMaintenanceResolver(
makeProviderMaintenanceCapabilities({
provider: DRIVER_KIND,
packageName: null,
updateExecutable: "agent",
updateExecutable: "cursor-agent",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Align Cursor recovery command with cursor-agent

When Cursor reports an old CLI version or non-lab channel, getCursorParameterizedModelPickerUnsupportedMessage still tells users to run agent set-channel lab && agent update (apps/server/src/provider/Layers/CursorProvider.ts:784). In the Grok-alongside-Cursor setup this change is fixing, that command still resolves to Grok, so affected users remain stuck in the unsupported state even though the maintenance command now uses cursor-agent; please update the hard-coded recovery command to match this executable.

Useful? React with 👍 / 👎.

updateArgs: ["update"],
updateLockKey: "cursor-agent",
}),
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/provider/Layers/CursorProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ const parameterizedClaudeModelOptionConfigOptions = [

const baseCursorSettings: CursorSettings = {
enabled: true,
binaryPath: "agent",
binaryPath: "cursor-agent",
apiEndpoint: "",
customModels: [],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const makeClaudeConfig = (overrides: Partial<ClaudeSettings>): ClaudeSettings =>

const makeCursorConfig = (overrides: Partial<CursorSettings>): CursorSettings => ({
enabled: false,
binaryPath: "agent",
binaryPath: "cursor-agent",
apiEndpoint: "",
customModels: [],
...overrides,
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/provider/Layers/ProviderRegistry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, ServerSettingsModule.layerTest(), Te
Layer.provideMerge(OpenCodeRuntime.OpenCodeRuntimeLive),
Layer.provideMerge(
mockCommandSpawnerLayer((command, args) => {
if (command === "agent") {
if (command === "cursor-agent") {
cursorSpawned = true;
}
const joined = args.join(" ");
Expand Down
6 changes: 3 additions & 3 deletions apps/server/src/provider/acp/CursorAcpCliProbe.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe.runIf(process.env.T3_CURSOR_ACP_PROBE === "1")("Cursor ACP CLI probe",
Effect.provide(
AcpSessionRuntime.layer({
spawn: {
command: "agent",
command: "cursor-agent",
args: ["acp"],
cwd: process.cwd(),
},
Expand Down Expand Up @@ -77,7 +77,7 @@ describe.runIf(process.env.T3_CURSOR_ACP_PROBE === "1")("Cursor ACP CLI probe",
AcpSessionRuntime.layer({
authMethodId: "cursor_login",
spawn: {
command: "agent",
command: "cursor-agent",
args: ["acp"],
cwd: process.cwd(),
},
Expand Down Expand Up @@ -133,7 +133,7 @@ describe.runIf(process.env.T3_CURSOR_ACP_PROBE === "1")("Cursor ACP CLI probe",
AcpSessionRuntime.layer({
authMethodId: "cursor_login",
spawn: {
command: "agent",
command: "cursor-agent",
args: ["acp"],
cwd: process.cwd(),
},
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/provider/acp/CursorAcpSupport.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const parameterizedGpt54ConfigOptions: ReadonlyArray<EffectAcpSchema.SessionConf
describe("buildCursorAcpSpawnInput", () => {
it("builds the default Cursor ACP command", () => {
expect(buildCursorAcpSpawnInput(undefined, "/tmp/project")).toEqual({
command: "agent",
command: "cursor-agent",
args: ["acp"],
cwd: "/tmp/project",
});
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/provider/acp/CursorAcpSupport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function buildCursorAcpSpawnInput(
environment?: NodeJS.ProcessEnv,
): AcpSessionRuntime.AcpSpawnInput {
return {
command: cursorSettings?.binaryPath || "agent",
command: cursorSettings?.binaryPath || "cursor-agent",
args: [
...(cursorSettings?.apiEndpoint ? (["-e", cursorSettings.apiEndpoint] as const) : []),
"acp",
Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/provider/providerMaintenanceRunner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function lifecycleFor(provider: ProviderDriverKind): ProviderMaintenanceCapabili
return makeProviderMaintenanceCapabilities({
provider,
packageName: null,
updateExecutable: "agent",
updateExecutable: "cursor-agent",
updateArgs: ["update"],
updateLockKey: "cursor-agent",
});
Expand Down Expand Up @@ -218,7 +218,7 @@ describe("providerMaintenanceRunner", () => {
const result = yield* updater.updateProvider(CURSOR_DRIVER);
assert.deepStrictEqual(calls, [
{
command: "agent",
command: "cursor-agent",
args: ["update"],
},
]);
Expand Down
25 changes: 24 additions & 1 deletion packages/contracts/src/settings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import { describe, expect, it } from "vite-plus/test";
import * as Schema from "effect/Schema";

import { ProviderInstanceId } from "./providerInstance.ts";
import { DEFAULT_SERVER_SETTINGS, ServerSettings, ServerSettingsPatch } from "./settings.ts";
import {
CursorSettings,
DEFAULT_SERVER_SETTINGS,
ServerSettings,
ServerSettingsPatch,
} from "./settings.ts";

const decodeServerSettings = Schema.decodeUnknownSync(ServerSettings);
const decodeServerSettingsPatch = Schema.decodeUnknownSync(ServerSettingsPatch);
Expand Down Expand Up @@ -106,6 +111,24 @@ describe("ServerSettingsPatch.providerInstances", () => {
});
});

describe("CursorSettings binary path", () => {
const decodeCursorSettings = Schema.decodeUnknownSync(CursorSettings);

it("defaults to cursor-agent", () => {
expect(decodeCursorSettings({}).binaryPath).toBe("cursor-agent");
});

it("maps the legacy agent binary name to cursor-agent", () => {
expect(decodeCursorSettings({ binaryPath: "agent" }).binaryPath).toBe("cursor-agent");
});

it("preserves explicit binary paths", () => {
expect(decodeCursorSettings({ binaryPath: "/usr/local/bin/agent" }).binaryPath).toBe(
"/usr/local/bin/agent",
);
});
});

describe("ServerSettingsPatch string normalization", () => {
it("trims string settings while decoding patches", () => {
const patch = decodeServerSettingsPatch({
Expand Down
23 changes: 21 additions & 2 deletions packages/contracts/src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,25 @@ const makeBinaryPathSetting = (fallback: string) =>
Schema.withDecodingDefault(Effect.succeed(fallback)),
);

export const LEGACY_CURSOR_BINARY_PATH = "agent";
export const DEFAULT_CURSOR_BINARY_PATH = "cursor-agent";

export const normalizeCursorBinaryPath = (value: string): string =>
value === LEGACY_CURSOR_BINARY_PATH ? DEFAULT_CURSOR_BINARY_PATH : value;

const makeCursorBinaryPathSetting = () =>
TrimmedString.pipe(
Schema.decodeTo(
Schema.String,
SchemaTransformation.transformOrFail({
decode: (value) =>
Effect.succeed(normalizeCursorBinaryPath(value || DEFAULT_CURSOR_BINARY_PATH)),
encode: (value) => Effect.succeed(value),
}),
),
Schema.withDecodingDefault(Effect.succeed(DEFAULT_CURSOR_BINARY_PATH)),
);

export type ProviderSettingsFormControl = "text" | "password" | "textarea" | "switch";

export interface ProviderSettingsFormAnnotation {
Expand Down Expand Up @@ -252,11 +271,11 @@ export const CursorSettings = makeProviderSettingsSchema(
Schema.withDecodingDefault(Effect.succeed(false)),
Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
),
binaryPath: makeBinaryPathSetting("agent").pipe(
binaryPath: makeCursorBinaryPathSetting().pipe(
Schema.annotateKey({
title: "Binary path",
description: "Path to the Cursor agent binary.",
providerSettingsForm: { placeholder: "agent", clearWhenEmpty: "omit" },
providerSettingsForm: { placeholder: "cursor-agent", clearWhenEmpty: "omit" },
}),
),
apiEndpoint: TrimmedString.pipe(
Expand Down
Loading