Skip to content
Merged
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
14 changes: 14 additions & 0 deletions src/adapters/cursor/catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,20 @@ export const CURSOR_CAPABILITIES: Record<string, CursorCapability> = {
defaultVariant: "regular",
variants: { regular: { levels: ["low", "medium", "high"] } },
},
// #8918: Cursor's models pages list Gemini 4 Hydrogen (low..xhigh) and Gemini 4 Carbon
// (low..high), shaped like Argon. The issue reporter's account served both through Cursor.
"gemini-4-hydrogen": {
displayName: "Gemini 4 Hydrogen",
window: CONTEXT_GEMINI,
defaultVariant: "regular",
variants: { regular: { levels: ["low", "medium", "high", "xhigh"] } },
},
"gemini-4-carbon": {
displayName: "Gemini 4 Carbon",
window: CONTEXT_GEMINI,
defaultVariant: "regular",
variants: { regular: { levels: ["low", "medium", "high"] } },
},
// Seeded from the live GetUsableModels roster attached to #4820, which advertises six
// muse-spark-1.3 effort variants. The ladder stops at xhigh on purpose: see the matching
// effort-map entry for why Cursor advertising `-max` is not evidence that it runs.
Expand Down
3 changes: 3 additions & 0 deletions src/adapters/cursor/effort-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ const CURSOR_MODEL_EFFORT_TIERS: Record<string, readonly string[]> = {
// 261014 preemptive: Gemini 4 Argon, low/medium/high with no `minimal` (a documented 400).
// Inert until Cursor's live roster lists the id.
"gemini-4-argon": ["low", "medium", "high"],
// #8918: Gemini 4 Hydrogen (low..xhigh) and Carbon (low..high), per Cursor's models pages.
"gemini-4-hydrogen": ["low", "medium", "high", "xhigh"],
"gemini-4-carbon": ["low", "medium", "high"],
// Explicit-thinking variants (260825 live roster). Tiers are the rungs the wire actually
// lists for each family, which is not always the same set the non-thinking id carries:
// 4.6-opus thinks only at high/max, 4.5-opus only at high, 4.6-sonnet only at medium.
Expand Down
4 changes: 3 additions & 1 deletion src/providers/registry/entries-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ export const PROVIDER_REGISTRY_CORE: readonly ProviderRegistryEntry[] = [
// default on `high`, the picker would send `high` explicitly, and the request builder's
// no-effort fallback to `kimi-k3-max` would never be reached. Mirrors the other K3
// routes (kimi, kimi-code, opencode-go).
modelDefaultReasoningEfforts: { "kimi-k3": "max" },
// Gemini 4 Hydrogen defaults to `high` (Cursor's docs, and the google/google-vertex rows);
// without this the medium fallback would win. Carbon's documented default is medium.
modelDefaultReasoningEfforts: { "kimi-k3": "max", "gemini-4-hydrogen": "high" },
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
// Blind Cursor models (Auto routers, Composer, GLM-5.2, GLM-5.3) go through the vision sidecar;
// multimodal hosts (Claude/Gemini/GPT/Kimi/Grok) take native SelectedImage. The catalog
// still advertises image for noVision members so Codex can attach (sidecar option B).
Expand Down
31 changes: 31 additions & 0 deletions tests/providers/cursor/cursor-discovery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import {
recordObservedCursorContextWindow,
resetObservedCursorContextWindowsForTests,
} from "../../../src/adapters/cursor/discovery";
import { resolveCursorSelection } from "../../../src/adapters/cursor/catalog";
import { getProviderRegistryEntry } from "../../../src/providers/registry";

describe("Cursor discovery metadata", () => {
test("no-vision list is a curated explicit subset of the static seed", () => {
Expand Down Expand Up @@ -114,6 +116,35 @@ describe("Cursor discovery metadata", () => {
expect(ids.filter(id => id.startsWith("muse-spark"))).toEqual(["muse-spark-1.3"]);
});

test("Gemini 4 Hydrogen and Carbon are cataloged with Cursor's documented ladders (#8918)", () => {
const ids = cursorModelIds(CURSOR_STATIC_MODELS);
const efforts = cursorModelReasoningEfforts(CURSOR_STATIC_MODELS);
const windows = cursorModelContextWindows(CURSOR_STATIC_MODELS);
const cursor = getProviderRegistryEntry("cursor");
for (const [id, ladder, wireDefault] of [
["gemini-4-hydrogen", ["low", "medium", "high", "xhigh"], "high"],
["gemini-4-carbon", ["low", "medium", "high"], undefined],
] as const) {
expect(ids).toContain(id);
expect(cursor?.models).toContain(id);
expect(efforts[id]).toEqual([...ladder]);
expect(windows[id]).toBe(1_048_576);
expect(cursor?.modelDefaultReasoningEfforts?.[id]).toBe(wireDefault);
for (const level of ladder) {
expect(resolveCursorSelection(id, level).wireId).toBe(`${id}-${level}`);
// Live discovery keeps the seed row when the account's roster lists any of its tiers.
expect(filterCursorConfiguredModelsByLiveDiscovery(
CURSOR_STATIC_MODELS.filter(model => model.id === id),
[`${id}-${level}`],
).map(model => model.id)).toEqual([id]);
}
expect(isCursorModelAvailableForAccount(id, ["gemini-4-argon-high"])).toBe(false);
expect(ids.filter(row => row.startsWith(id))).toEqual([id]);
}
// Carbon has no xhigh rung: an xhigh request clamps to high rather than inventing a wire id.
expect(resolveCursorSelection("gemini-4-carbon", "xhigh").wireId).toBe("gemini-4-carbon-high");
});

test("auto is not activated by live GetUsableModels wire ids alone", () => {
expect(isCursorModelAvailableForAccount("gpt-5.4", ["gpt-5.4-high"])).toBe(true);
expect(isCursorModelAvailableForAccount("claude-fable-5", ["gpt-5.4-high"])).toBe(false);
Expand Down
Loading