Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

feat: let the cursor reviewer carry a reasoning-effort pin, folded into --model (#4555)

[._.]/ Adam Eivy75d755ec4fb1
diff --git a/client/src/components/cos/ReviewerPicker.jsx b/client/src/components/cos/ReviewerPicker.jsx
index 0bfe3a65aa..1be777e834 100644
--- a/client/src/components/cos/ReviewerPicker.jsx
+++ b/client/src/components/cos/ReviewerPicker.jsx
@@ -37,11 +37,14 @@ const normalizeReviewerValue = (value) => normalizeReviewerSlug(value);
* agent invokes directly, `<reviewer> --model <id>`). Only rendered for
* MODEL_SELECTABLE_REVIEWERS. The option lists are OWNED BY THE CALLER (see
* `modelOptions`) so this component does no fetching.
- * - **Effort** → the reviewer's reasoning-effort tier. Unlike the others this
- * maps to NO slashdo token (its entry grammar has no effort suffix) — it rides
- * the invocation instead: `claude --effort high` / `codex -c
- * model_reasoning_effort=high` for a CLI reviewer, `"effort"` in the
- * `/api/code-review/local` body for a local one. Only rendered for
+ * - **Effort** → the reviewer's reasoning-effort tier, emitted as slashdo's
+ * `~effort=<level>` entry suffix and, where PortOS spells the invocation out
+ * itself, as the flag that CLI actually takes: `claude --effort high` /
+ * `codex -c model_reasoning_effort=high`, `"effort"` in the
+ * `/api/code-review/local` body for a local reviewer, and — for `cursor`,
+ * whose CLI has no `--effort` flag at all — folded into the model id as
+ * Cursor's own variant syntax (`--model gpt-5[effort=max]`), which needs the
+ * row's Model cell filled in to have anything to attach to. Only rendered for
* EFFORT_SELECTABLE_REVIEWERS, and each row offers only the levels its own CLI
* accepts (`agy` rejects `--effort max`).
* - **Optional** → the `~opt` non-blocking marker.
diff --git a/client/src/lib/reviewerPins.js b/client/src/lib/reviewerPins.js
index 48da036496..33f012ddd3 100644
--- a/client/src/lib/reviewerPins.js
+++ b/client/src/lib/reviewerPins.js
@@ -1,7 +1,8 @@
import {
CLAUDE_EFFORT_LEVELS,
CODEX_EFFORT_LEVELS,
- ANTIGRAVITY_EFFORT_LEVELS
+ ANTIGRAVITY_EFFORT_LEVELS,
+ CURSOR_EFFORT_LEVELS
} from '../utils/providers';
/**
@@ -27,9 +28,10 @@ import {
// CLI reviewers whose binary takes a `--model <id>` tier. Mirror of
// MODEL_CAPABLE_CLI_REVIEWERS (`antigravity` runs `agy --model <id>`, `grok` runs
-// `grok --model <id>`, and Cursor runs `cursor-agent --model <id>` — the latter
-// two take a model but no separate effort flag, so this roster is
-// deliberately wider than EFFORT_SELECTABLE_REVIEWERS below).
+// `grok --model <id>`, and Cursor runs `cursor-agent --model <id>` — `grok` takes
+// a model but no effort at all, so this roster is deliberately wider than
+// EFFORT_SELECTABLE_REVIEWERS below; Cursor takes both, but carries its effort
+// INSIDE the model id rather than as a separate flag).
export const MODEL_CAPABLE_CLI_REVIEWERS = ['codex', 'claude', 'antigravity', 'grok', 'cursor'];
// The local-LLM backends, which take both a model and an effort.
@@ -51,8 +53,11 @@ export const MAX_REVIEWER_MODEL_LENGTH = 200;
export const LOCAL_LLM_EFFORT_LEVELS = Object.freeze(['low', 'medium', 'high']);
// The effort ladder each reviewer offers, or absent when it has no effort control
-// (`copilot` is a GitHub review, `grok`'s CLI takes no effort flag, and an
-// `@username` reviewer is a person). The CLI ladders come from the same
+// (`copilot` is a GitHub review, `grok`'s CLI has no effort control at all, and an
+// `@username` reviewer is a person). A ladder means the level is PICKABLE, not
+// that the CLI takes an `--effort` flag — `cursor` accepts one only as a
+// parameter of its model id, which the server folds in when it builds the
+// invocation. The CLI ladders come from the same
// providers.js constants the server derives its own from, so the picker can only
// offer a level the reviewer's binary actually accepts (`agy` really does reject
// `--effort max`).
@@ -60,6 +65,7 @@ export const REVIEWER_EFFORT_LEVELS = Object.freeze({
claude: CLAUDE_EFFORT_LEVELS,
codex: CODEX_EFFORT_LEVELS,
antigravity: ANTIGRAVITY_EFFORT_LEVELS,
+ cursor: CURSOR_EFFORT_LEVELS,
lmstudio: LOCAL_LLM_EFFORT_LEVELS,
ollama: LOCAL_LLM_EFFORT_LEVELS,
});
diff --git a/client/src/utils/providers.js b/client/src/utils/providers.js
index 51e2f23297..353ebe7471 100644
--- a/client/src/utils/providers.js
+++ b/client/src/utils/providers.js
@@ -114,6 +114,20 @@ export const isAntigravityProvider = (provider) => {
return base === 'agy' || base === 'antigravity';
};
+/**
+ * True when a provider is Cursor-Agent-flavored — the shipped
+ * `cursor-cli`/`cursor-tui` ids or any provider whose launch command basename is
+ * `cursor-agent` (never a bare `cursor`, which is the GUI editor). MIRROR of
+ * `isCursorProvider` in server/lib/providerModels.js — keep in lockstep.
+ * @param {{id?:string, command?:string}|null|undefined} provider
+ * @returns {boolean}
+ */
+export const isCursorProvider = (provider) => {
+ if (!provider) return false;
+ const id = String(provider.id || '').toLowerCase();
+ return id === 'cursor-cli' || id === 'cursor-tui' || commandBasename(provider.command) === 'cursor-agent';
+};
+
/**
* Whether the AI Providers page should offer a "Refresh Models" button for this
* provider — i.e. whether the server has a model fetcher that can answer for it.
@@ -188,6 +202,11 @@ export const ANTIGRAVITY_EFFORT_LEVELS = Object.freeze(['low', 'medium', 'high']
// provider. Ollama's OpenAI-compatible API accepts this narrow ladder for
// thinking models; the broader vendor-CLI ladders are not portable here.
export const OPENCODE_OLLAMA_EFFORT_LEVELS = Object.freeze(['low', 'medium', 'high']);
+// Cursor Agent. MIRROR of `CURSOR_EFFORT_LEVELS`. Cursor takes NO `--effort`
+// flag — the server folds the level into the model id as Cursor's own variant
+// syntax (`gpt-5[effort=max]`) — but the level is still user-pickable, so this
+// ladder drives the same selects as every other CLI's.
+export const CURSOR_EFFORT_LEVELS = Object.freeze(['low', 'medium', 'high', 'xhigh', 'max']);
/** True when an OpenCode process provider is backed by the local Ollama daemon. */
export const isOpencodeOllamaProvider = (provider) =>
@@ -375,6 +394,7 @@ export const effortLevelsForProvider = (provider, model = null) => {
if (perModel === null) return ANTIGRAVITY_EFFORT_LEVELS;
return perModel.length ? perModel : null;
}
+ if (isCursorProvider(provider)) return CURSOR_EFFORT_LEVELS;
const id = String(provider.id || '').toLowerCase();
if (id.startsWith('claude-code') || commandBasename(provider.command) === 'claude') return CLAUDE_EFFORT_LEVELS;
return null;
diff --git a/server/lib/README.md b/server/lib/README.md
index 3c4d2e61f9..4e9627bcd7 100644
--- a/server/lib/README.md
+++ b/server/lib/README.md
@@ -124,7 +124,7 @@ The barrel `server/lib/index.js` is a machine-checkable enumeration of every pub
| `videoFinishProfiles.js` | Draft → delivery ("Finish") relationships between video models (#3696). `VIDEO_FINISH_PROFILES` declares each fast draft entry id → `{ shippedRepo, finishModelId }`, only for pairs that share a runtime, base repo and supported modes (the same weights at a different step budget), so re-rendering the draft's seed reproduces its composition instead of re-rolling it. `applyVideoFinishProfiles(list)` is the load-time backfill (twin of migration 238) with the usual preservation guards (existing key wins, custom id skipped, forked `repo` skipped); `validateFinishProfileGraph(list)` returns the graph problems (missing / self-referencing / chained target, runtime / repo / supportedModes mismatch) and `sanitizeFinishProfiles(list)` warns + strips them at load so a typo can never surface a Finish button targeting nothing. `finishTargetForModel(model, availableModels)` resolves the delivery entry scoped to what this install can run. |
| `videoModeProfiles.js` | The shipped `supportedModes` fact per video runtime (#3737), so "which modes does this model support?" has one answer on the registry entry instead of 25+ `runtime === '…'` comparisons. `VIDEO_RUNTIME_MODES` maps each runtime to the base semantic modes its helper's argv can actually render (`mlx_video`/`ltx2` text+image+fflf+extend, `wan22` text+image, `minimax_h3` / `minimax_h3_cuda` text+image+fflf off one shared array — also the mode ceiling in `videoGen/modeContract.js` — `hunyuan` text only, replacing the legacy unread `mode: 't2v'` field); `VIDEO_BASE_MODES` is the fallback for an unknown (user-added or peer-synced) runtime, deliberately the full base set so a custom model doesn't vanish from every picker. `resolveVideoSupportedModes(entry)` (declared non-empty list always wins) and `applyVideoSupportedModes(list)` — the read-time decoration `mediaModels.js#getVideoModels` applies, so the derived list never lands in `data/media-models.json` where it would read back as a *declared* list no later correction could reach. a2v and the IC-LoRA remix ids are NOT enumerated here: they're ltx2 pipeline capabilities, gated by runtime (`A2V_REQUIRES_LTX2` / `IC_LORA_REQUIRES_LTX2`). |
| `videoTextEncoders.js` | Swappable prompt conditioners for local video runtimes. MiniMax H3 reads the *unnormalized* hidden state after Qwen3-VL language layer 49 (layers 50-63, the final norm and `lm_head` are never evaluated), so any checkpoint carrying the same embedding + layers 0-49 + vision tower is a drop-in conditioner — swapping it changes how the model reads a prompt without touching the diffusion weights. `TEXT_ENCODERS_BY_RUNTIME` declares the shipped options per runtime (pinned repo/revision plus an explicit `files` LIST — one repackaged safetensors, or just the shards of an upstream checkpoint that carry parameters the loader actually builds; in code rather than the media-models registry so a stale `data/media-models.json` can't name a file the runner can't map); `videoTextEncoderOptions(model)` returns the TRUE list stock-first (it deliberately does NOT collapse a one-entry runtime to `[]` — that is a presentation rule, and folding it in here would change what the server believes a model supports and empty the "offers …" list in the error; `TextEncoderPicker` owns the hide-when-there-is-no-real-choice check), `isStockTextEncoder(id)` makes absence and the `stock` sentinel the same request, `resolveVideoTextEncoder(model, id)` returns `null` for the stock choice or throws `VIDEO_TEXT_ENCODER_UNSUPPORTED` (with the non-throwing `supportsVideoTextEncoder` + `videoTextEncoderUnsupportedError` split out so the request path can reject before staging uploads), and `downloadableVideoTextEncoders()` (deduped by id — the table is keyed by RUNTIME, so one conditioner can be offered by two) / `downloadableVideoTextEncoder(id)` feed the `/api/video-gen/text-encoders/:id/(download\|repair)` lane. Two loader-mechanics fields exist because a ComfyUI-packaged conditioner is namespaced differently from the HF checkpoint the MLX port matches: `keyPrefixMap` (`model.` → `model.language_model.`, `visual.` → `model.visual.`) is applied to every checkpoint key by `scripts/generate_minimax_h3.py` BEFORE the pinned loader sees it — no fork of the pinned runtime — and `finalNormKey` names where the runner synthesizes a ones-filled `norm.weight` for a checkpoint published without one (correct upstream, since H3 reads the state *before* the norm, but the pinned loader refuses to load with any parameter missing). Both are absent for an UPSTREAM Qwen3-VL-32B checkpoint, which already uses the loader namespace and ships its own norm. A candidate must BE Qwen3-VL-32B (the shim reuses upstream's config/tokenizer/processor) — a different Qwen generation is not a substitute however close its conditioning width looks; see docs/features/video-text-encoders.md. `publicTextEncoderOption(entry)` is the client projection and deliberately drops both, so the UI can't reimplement the remap. The `ltx25` table (#4320) uses a third mechanic, `configOverrides`, because an LTX-2.5 pack's OWN Gemma 4 tower wins over `--gemma` inside the pinned fork: the substitution is a standalone shim directory whose generated `config.json` is the substitute's own with these keys merged over it (only ever the `model_type` label a unified checkpoint gets wrong — never `text_config`/`quantization`), and a candidate must BE Gemma 4 12B at 48 layers / hidden 3840 / vocab 262144 / `k_eq_v`. `verified` gates a substitute out of BOTH lanes (picker AND download) until it has been A/B-rendered against its runtime's stock conditioner — required on every non-built-in entry and fail-closed on absence, so a new entry is unreachable until someone states a verdict; both ltx25 substitutes are `verified: false` today. `declaredVideoTextEncoders()` is the UNFILTERED table for shape/invariant checks only — never the render or download path, and `videoTextEncoderRuntimes()` enumerates the table's runtime keys so parity/shape tests cover every runtime rather than the one that happened to exist when they were written. |
-| `providerModels.js` | Provider model resolution sentinels + helpers (`CODEX_CONFIGURED_DEFAULT` / `ANTIGRAVITY_CONFIGURED_DEFAULT` / `GROK_CONFIGURED_DEFAULT` / `KIMI_CONFIGURED_DEFAULT`, `resolveCliModel`, `filterSelectableModels`, Bedrock/OpenCode model mappers, model-flag scan helpers incl. `stripBrokenModelFlags`, `isCodexProvider`, `isKimiProvider`, `isAntigravityProvider`) plus reasoning-effort helpers for the claude/codex/agy CLIs (`CLAUDE_EFFORT_LEVELS` / `CODEX_EFFORT_LEVELS` / `ANTIGRAVITY_EFFORT_LEVELS` / `EFFORT_LEVELS`, `effortLevelsForProvider`, `resolveCliEffort` — clamps an out-of-range effort to the nearest level the target CLI accepts rather than dropping it, so a value saved against a wider ladder survives a provider switch — `hasEffortFlag`, and `buildEffortArgs` — the one emitter of `--effort <level>` / `-c model_reasoning_effort=<level>`) plus codex startup-arg helpers (`CODEX_EFFORT_KEY`, `CODEX_UPDATE_CHECK_KEY`, `hasCodexUpdateCheckConfig`, `buildCodexStartupArgs` — the one emitter of `-c check_for_update_on_startup=false`, spread by every codex spawn builder to disable the blocking startup update modal) plus `PORTOS_CLI_CONFIG_KEYS` / `isPortosSuppliedConfigKey` — the exhaustive list of `-c <key>=<value>` config keys PortOS injects, read by the `cli-config-invalid` error analyzer to tell a rejected PortOS override apart from a bad line in the user's own CLI config file. |
+| `providerModels.js` | Provider model resolution sentinels + helpers (`CODEX_CONFIGURED_DEFAULT` / `ANTIGRAVITY_CONFIGURED_DEFAULT` / `GROK_CONFIGURED_DEFAULT` / `KIMI_CONFIGURED_DEFAULT`, `resolveCliModel`, `filterSelectableModels`, Bedrock/OpenCode model mappers, model-flag scan helpers incl. `stripBrokenModelFlags`, `isCodexProvider`, `isKimiProvider`, `isAntigravityProvider`, `isCursorProvider`) plus reasoning-effort helpers for the claude/codex/agy/cursor CLIs (`CLAUDE_EFFORT_LEVELS` / `CODEX_EFFORT_LEVELS` / `ANTIGRAVITY_EFFORT_LEVELS` / `CURSOR_EFFORT_LEVELS` / `EFFORT_LEVELS`, `effortLevelsForProvider`, `resolveCliEffort` — clamps an out-of-range effort to the nearest level the target CLI accepts rather than dropping it, so a value saved against a wider ladder survives a provider switch — `hasEffortFlag`, `buildEffortArgs` — the one emitter of `--effort <level>` / `-c model_reasoning_effort=<level>`, and deliberately silent for cursor — and `foldCursorEffortIntoModel`, which carries a cursor level inside `--model` as Cursor’s own variant syntax (`gpt-5[effort=max]`) because `cursor-agent` has no `--effort` flag) plus codex startup-arg helpers (`CODEX_EFFORT_KEY`, `CODEX_UPDATE_CHECK_KEY`, `hasCodexUpdateCheckConfig`, `buildCodexStartupArgs` — the one emitter of `-c check_for_update_on_startup=false`, spread by every codex spawn builder to disable the blocking startup update modal) plus `PORTOS_CLI_CONFIG_KEYS` / `isPortosSuppliedConfigKey` — the exhaustive list of `-c <key>=<value>` config keys PortOS injects, read by the `cli-config-invalid` error analyzer to tell a rejected PortOS override apart from a bad line in the user's own CLI config file. |
| `providerVendors.js` | `PROVIDER_VENDORS` — one row per coding-agent CLI/TUI vendor (claude/codex/antigravity/opencode/grok/kimi/cursor, plus a deliberately-incomplete legacy `gemini-cli` row), consumed by every dispatch site that used to hand-roll its own vendor if-chain across ~8 branches in 5 files (#3618): `applyCommandDefaults`/`prepareCliPrompt` (re-exported from `tuiHandshake.js`/`cliProviderArgs.js`), `buildVendorCliArgs`/`buildVendorSpawnConfig` (consumed by `cliProviderArgs.js#buildCliArgs` / `agentCliSpawning.js#buildCliSpawnConfig`), `inferTuiCommand` (re-exported from `tuiHandshake.js`), and `injectTuiModelAndEffort` — the shared antigravity-validates-the-pair-vs-everyone-else `--model`/`--effort` injection used by both `tuiHandshake.js#buildTuiInvocation` and `agentTuiSpawning.js#buildTuiSpawnConfig`, replacing a second copy of that split that had already drifted once before this file existed. Doesn't rewrite any vendor's argv-building logic — that stays in `antigravity.js`/`grok.js`/`kimi.js`/`cursor.js`/`codex.js`. Dependency-light on purpose, mirroring those files. |
| `modelPricing.js` | Per-model API billing rates for the /devtools/usage cost estimates — `resolveModelRates(providerId, model)` (exact → family regex → provider default → blended fallback, with a `matched` tier; also derives `cacheReadPer1M`/`cacheWritePer1M` from the input rate via per-family multipliers), `isFreeProvider` (ollama/lmstudio/`ollamaBacked`/localhost = free), `estimateCostUsd(tokensIn, tokensOut, rates, cache?)` — `tokensIn` is UNCACHED input; cache tiers are priced separately via the optional 4th arg — and `PRICING_AS_OF`. Informational only (PortOS runs on subscriptions); still excludes batch/long-context tiers. |
| `usageRange.js` | `resolveUsageRange({ period, from, to })` — pure period→inclusive-YYYY-MM-DD range resolution for the usage cost report (explicit dates win; `all` unbounded; default 7d). |
@@ -136,7 +136,7 @@ The barrel `server/lib/index.js` is a machine-checkable enumeration of every pub
| `cliProviderArgs.js` | Per-CLI argv conventions (`buildCliArgs`) for stdin prompt delivery — dependency-light extraction from runner.js so out-of-process callers (autofixer) can import it. |
| `cliProviderRun.js` | One-shot CLI provider invocation (`pickCliProvider` + `runCliProviderPrompt`) — lightweight path for the autofixer + calendar MCP sync to honor the configured provider/model. |
| `codex.js` | OpenAI Codex CLI (`codex`) provider helpers — the `CODEX_COMMAND`/`CODEX_CLI_ID` constants, the `isCodexCommand` predicate, and `ensureCodexTuiArgs` (injects `--dangerously-bypass-approvals-and-sandbox` + disables the startup update-check config, skipped when the argv already declares an approval/sandbox posture via `argvHasFlag`). Extracted from `tuiHandshake.js` (#3618) to match the one-file-per-vendor shape of `antigravity.js`/`grok.js`/`kimi.js`/`cursor.js`, which `providerVendors.js` consumes as registry rows. |
-| `cursor.js` | Cursor Agent (`cursor-agent`) provider helpers — the `CURSOR_COMMAND` binary constant, the `isCursorCommand` predicate, and the `ensureCursorHeadlessArgs` (`--print --force`) / `ensureCursorTuiArgs` (`--force`) argv builders. `--force` is load-bearing beyond approvals: it also clears cursor's workspace-trust gate, which otherwise EXITS a headless run before any work happens. The prompt rides raw stdin (like claude/codex, unlike grok/kimi), and cursor needs no configured-default sentinel — its `auto` router is a real model id passed straight to `--model`. |
+| `cursor.js` | Cursor Agent (`cursor-agent`) provider helpers — the `CURSOR_COMMAND` binary constant, the `isCursorCommand` predicate, and the `ensureCursorHeadlessArgs` (`--print --force`, folding any pinned reasoning effort into `--model`) / `ensureCursorTuiArgs` (`--force`) argv builders. `--force` is load-bearing beyond approvals: it also clears cursor's workspace-trust gate, which otherwise EXITS a headless run before any work happens. The prompt rides raw stdin (like claude/codex, unlike grok/kimi), and cursor needs no configured-default sentinel — its `auto` router is a real model id passed straight to `--model`. |
| `grok.js` | xAI Grok Build (`grok`) provider helpers — id/endpoint constants (`GROK_API_ID`/`GROK_CLI_ID`/`GROK_TUI_ID`/`GROK_API_ENDPOINT`), `isGrokCommand`/`isGrokCliProvider`/`isGrokTuiProvider` predicates, `ensureGrokHeadlessArgs`/`ensureGrokTuiArgs` argv builders (grok reads its prompt from `--prompt-file /dev/stdin`, not raw stdin; model selection uses the `GROK_CONFIGURED_DEFAULT` sentinel in `providerModels.js` so PortOS omits `--model` like Antigravity), and `prepareGrokPromptFile` (Windows temp-file delivery fallback). |
| `grokVideoClip.js` | Clip lengths grok's `image_to_video` actually delivers — `GROK_VIDEO_DURATIONS` (`[6, 10]`, measured in #3022: a 2s/3s request returns the same 6.04s clip), `GROK_VIDEO_DEFAULT_DURATION`, `resolveGrokDuration()` (validate an already-grok-shaped request, else default), and `nearestGrokDuration()` (round a length authored against another backend's continuous contract UP to the shortest clip that covers it — for translating a CD/commission `targetDurationSeconds`). Dependency-free so `validation.js` / `routes/videoGen.js` can derive their schemas from the same list the services gate on. |
| `kimi.js` | Moonshot AI Kimi Code (`kimi`) provider helpers — id constants (`KIMI_CLI_ID`/`KIMI_TUI_ID`), `isKimiCommand`/`isKimiCliProvider`/`isKimiTuiProvider` predicates, `ensureKimiHeadlessArgs` (model flag only — non-interactive mode is implicit in `--prompt`, and kimi has no `--print`/`--afk` and refuses approval flags alongside `--prompt`) / `ensureKimiTuiArgs` (`--yolo`) argv builders (model selection uses the `KIMI_CONFIGURED_DEFAULT` sentinel in `providerModels.js` so PortOS omits `--model` like Grok/Antigravity), and `prepareKimiPrompt` (delivers the prompt as the `--prompt <value>` argv, not stdin). |
diff --git a/server/lib/cliProviderArgs.test.js b/server/lib/cliProviderArgs.test.js
index c6b16e2f06..95cf8c3db1 100644
--- a/server/lib/cliProviderArgs.test.js
+++ b/server/lib/cliProviderArgs.test.js
@@ -224,6 +224,25 @@ describe('cliProviderArgs', () => {
expect(args).toEqual(['--print', '--auto-review', '--trust']);
});
+ it('carries a per-run effort inside --model, never as an --effort flag', () => {
+ // cursor-agent exposes no --effort and exits non-zero on one; its effort is
+ // a model-variant parameter (`gpt-5[effort=max]`).
+ const args = buildCliArgs({ id: 'cursor-cli', command: 'cursor-agent', args: [], defaultModel: 'gpt-5', effort: 'max' });
+ expect(args).toEqual(['--print', '--force', '--model', 'gpt-5[effort=max]']);
+ expect(args).not.toContain('--effort');
+ });
+
+ it('clamps an out-of-ladder effort rather than passing it through', () => {
+ // `minimal` sits below cursor's ladder, so it resolves to its weakest level.
+ const args = buildCliArgs({ id: 'cursor-cli', command: 'cursor-agent', args: [], defaultModel: 'gpt-5', effort: 'minimal' });
+ expect(args).toEqual(['--print', '--force', '--model', 'gpt-5[effort=low]']);
+ });
+
+ it('drops an effort with no model to fold it into', () => {
+ const args = buildCliArgs({ id: 'cursor-cli', command: 'cursor-agent', args: [], defaultModel: null, effort: 'max' });
+ expect(args).toEqual(['--print', '--force']);
+ });
+
it('delivers the prompt over stdin (useStdin true) — cursor reads raw stdin in print mode', () => {
const built = buildCliArgs({ id: 'cursor-cli', command: 'cursor-agent', args: ['--print', '--force'], defaultModel: 'auto' });
const { args, useStdin } = prepareCliPrompt('cursor-agent', built, 'write a haiku');
diff --git a/server/lib/cosValidation.js b/server/lib/cosValidation.js
index 25af2e6126..5cc9e31fb6 100644
--- a/server/lib/cosValidation.js
+++ b/server/lib/cosValidation.js
@@ -11,8 +11,9 @@
import { z } from 'zod';
import { emptyToUndefined, emptyToNull } from './zodCompat.js';
import { isPlainObject } from './objects.js';
-import { EFFORT_LEVELS, effortLevelsForProvider, buildEffortArgs, splitAntigravityModel } from './providerModels.js';
+import { EFFORT_LEVELS, effortLevelsForProvider, buildEffortArgs, foldCursorEffortIntoModel, splitAntigravityModel } from './providerModels.js';
import { ANTIGRAVITY_COMMAND } from './antigravity.js';
+import { CURSOR_COMMAND } from './cursor.js';
import { isValidSlashdoCommand } from './slashdoInvocation.js';
import { PR_COMPLETION_VALUES } from './prDisposition.js';
import { AGENT_RUN_EVENT_KINDS, RUN_EVENT_READ_LIMITS } from './agentRunEvents.js';
@@ -45,8 +46,11 @@ export const LOCAL_LLM_REVIEWERS = ['lmstudio', 'ollama'];
// local Ollama model. `antigravity` runs `agy --model <id>`; an effort-suffixed
// agy id is reconciled with the effort pin by `pairReviewerModelsAndEfforts`.
// `grok` runs `grok --model <id>` (slashdo's `grok[<model>]` bracket); it takes a
-// model but NO effort, which is why this roster and EFFORT_SELECTABLE_REVIEWERS
-// are genuinely different sets rather than two names for one list.
+// model but NO effort at all, which is why this roster and
+// EFFORT_SELECTABLE_REVIEWERS are genuinely different sets rather than two names
+// for one list. `cursor` runs `cursor-agent --model <id>` and DOES take an
+// effort — but as a parameter of the model id (`gpt-5[effort=max]`), not a flag,
+// so its pin rides this roster's `--model` rather than an `--effort` argv.
// Copilot/local-LLM reviewers are excluded — the former has no CLI, the latter
// get their model injected server-side by `POST /api/code-review/local`. Add a
// reviewer here when its CLI gains model selection; the `<reviewer>Model`
@@ -75,7 +79,7 @@ export const REVIEWER_CLI_BINARIES = {
antigravity: ANTIGRAVITY_COMMAND,
codex: 'codex',
grok: 'grok',
- cursor: 'cursor-agent',
+ cursor: CURSOR_COMMAND,
};
/**
@@ -460,7 +464,12 @@ export const LOCAL_LLM_EFFORT_LEVELS = Object.freeze(['low', 'medium', 'high']);
/**
* Reviewer slug → the reasoning-effort ladder that reviewer accepts. Only
* reviewers WITH an effort control appear: `copilot` is a GitHub review, `grok`'s
- * CLI takes no effort flag, and an `@username` reviewer is a person.
+ * CLI has no effort control of any kind, and an `@username` reviewer is a person.
+ *
+ * A ladder here means "the user can PICK a level", not "the CLI takes an
+ * `--effort` flag" — `cursor` accepts a level only as a variant baked into its
+ * model id, so it appears here while `reviewerEffortArgs` returns `[]` for it
+ * and `reviewerModelArg` folds the level into `--model` instead.
*
* Built once at module load and DERIVED from `effortLevelsForProvider` rather
* than restated, so a reviewer's ladder here is exactly the one
@@ -484,7 +493,7 @@ export const REVIEWER_EFFORT_LEVELS = Object.freeze(Object.fromEntries(
/**
* Every reviewer the user can pick an effort for — the effort-capable CLIs
- * (`claude`, `codex`, `antigravity`) plus the local-LLM backends.
+ * (`claude`, `codex`, `antigravity`, `cursor`) plus the local-LLM backends.
*/
export const EFFORT_SELECTABLE_REVIEWERS = Object.freeze(Object.keys(REVIEWER_EFFORT_LEVELS));
@@ -684,6 +693,12 @@ export function reviewerEffortsFromDefaults(defaults) {
* for codex, `[]` for everything else. Delegates to `buildEffortArgs` so the flag
* shape has exactly one home (the spawn builders use the same one).
*
+ * **`cursor` is deliberately `[]` despite having a ladder.** `cursor-agent` has
+ * no `--effort` flag and exits non-zero on one, so its level rides `--model`
+ * instead — build that with `reviewerModelArg`. Anything that renders a cursor
+ * invocation must call BOTH, or it will silently drop the pin (or, worse,
+ * hand-roll the `--effort` this returns nothing for).
+ *
* **Normalizes first, deliberately.** `buildEffortArgs` CLAMPS an out-of-ladder
* value (`agy` + `max` → `--effort high`), which is right for a provider pin the
* user set against a different provider, but wrong here: a reviewer effort is
@@ -707,6 +722,34 @@ export function reviewerEffortArgs(reviewer, effort) {
return buildEffortArgs(level, { id: reviewer, command: binary });
}
+/**
+ * The id a CLI reviewer's `--model` flag should carry, or `null` when there is
+ * no model to pin. The twin of `reviewerEffortArgs`: together they are the whole
+ * invocation a pinned reviewer needs, and the ONLY place that knows which of the
+ * two carries a cursor effort.
+ *
+ * For every reviewer but `cursor` this is just the pinned id, threaded verbatim
+ * (the id is environment-specific free text — see `normalizeReviewerModels`).
+ * For `cursor` the effort is folded in as Cursor's native model variant
+ * (`gpt-5` + `max` → `gpt-5[effort=max]`), matching slashdo's own fold, because
+ * `cursor-agent` has no `--effort` flag. A cursor effort with no model pinned
+ * returns `null` — there is nothing to attach the variant to, and emitting a
+ * flag cursor rejects is worse than letting it use its default tier.
+ *
+ * @param {string} reviewer - reviewer slug
+ * @param {string|null|undefined} model - the pinned model id
+ * @param {string|null|undefined} [effort] - the pinned effort (cursor only)
+ * @returns {string|null}
+ */
+export function reviewerModelArg(reviewer, model, effort) {
+ const id = typeof model === 'string' ? model.trim() : '';
+ if (!id) return null;
+ const slug = typeof reviewer === 'string' ? reviewer.trim().toLowerCase() : '';
+ if ((REVIEWER_ALIASES[slug] ?? slug) !== 'cursor') return id;
+ const level = normalizeReviewerEffort(effort, 'cursor');
+ return level ? foldCursorEffortIntoModel(id, level) : id;
+}
+
/**
* Prose instruction carrying the per-reviewer effort pins into a prompt whose
* agent spawns the reviewer CLI ITSELF — the claim flows (which run each
@@ -724,20 +767,38 @@ export function reviewerEffortArgs(reviewer, effort) {
* Scoped to CLI reviewers on purpose — `ollama`/`lmstudio` have no binary to
* name (their effort rides the `POST /api/code-review/local` body instead).
*
+ * `cursor` needs its MODEL to say anything at all: its level is a variant of the
+ * model id, never a flag, so pass `reviewerModels` — a cursor pin with no model
+ * emits nothing rather than an `--effort` its CLI rejects.
+ *
* @param {string[]} reviewers - the reviewer slugs the invocation emits
* @param {Object<string, string>} [reviewerEfforts] - token-keyed effort pins
* @param {Object} [options]
* @param {string} [options.reviewWith] - the `--review-with` text this prompt
* emits, if any. A `~effort=` in it means slashdo already carries the pin.
+ * @param {Object<string, string>} [options.reviewerModels] - token-keyed model
+ * pins, needed only to render a cursor invocation (see above)
* @returns {string} a single sentence, or '' when nothing is left to say
*/
-export function buildReviewerEffortNote(reviewers, reviewerEfforts = {}, { reviewWith = '' } = {}) {
+export function buildReviewerEffortNote(reviewers, reviewerEfforts = {}, { reviewWith = '', reviewerModels = {} } = {}) {
if (typeof reviewWith === 'string' && reviewWith.includes('~effort=')) return '';
const efforts = normalizeReviewerEfforts(reviewerEfforts) || {};
+ const models = normalizeReviewerModels(reviewerModels) || {};
const entries = (Array.isArray(reviewers) ? reviewers : [])
.map((r) => {
+ // No binary, nothing to name: `lmstudio`/`ollama` reach their backend over
+ // HTTP, and copilot/@username aren't commands at all. Checked FIRST so no
+ // branch below can render a `null` command into a prompt.
+ const binary = reviewerCliBinary(r);
+ if (!binary) return null;
const args = reviewerEffortArgs(r, efforts[r]);
- return args.length ? `\`${reviewerCliBinary(r)} ${args.join(' ')}\`` : null;
+ if (args.length) return `\`${binary} ${args.join(' ')}\``;
+ // No effort ARGV, but the reviewer may still carry the level inside
+ // --model (cursor). Gated on the effort pin so this stays an effort note:
+ // a model-only pin is not this sentence's business.
+ if (!normalizeReviewerEffort(efforts[r], r)) return null;
+ const model = reviewerModelArg(r, models[r], efforts[r]);
+ return model ? `\`${binary} --model ${model}\`` : null;
})
.filter(Boolean);
if (!entries.length) return '';
diff --git a/server/lib/cosValidation.test.js b/server/lib/cosValidation.test.js
index 13454fbe5d..e177fb31b2 100644
--- a/server/lib/cosValidation.test.js
+++ b/server/lib/cosValidation.test.js
@@ -24,13 +24,14 @@ import {
resolveReviewerEfforts,
reviewerEffortsFromDefaults,
reviewerEffortArgs,
+ reviewerModelArg,
buildReviewerEffortNote,
sanitizeTaskMetadata,
codeReviewSettingsSchema,
taskTemplateSettingsSchema,
} from './cosValidation.js';
import { LOCAL_AGENT_REVIEWERS } from './slashdoInvocation.js';
-import { EFFORT_LEVELS, CLAUDE_EFFORT_LEVELS, CODEX_EFFORT_LEVELS, ANTIGRAVITY_EFFORT_LEVELS } from './providerModels.js';
+import { EFFORT_LEVELS, CLAUDE_EFFORT_LEVELS, CODEX_EFFORT_LEVELS, ANTIGRAVITY_EFFORT_LEVELS, CURSOR_EFFORT_LEVELS } from './providerModels.js';
describe('cosValidation effort field', () => {
it('accepts every EFFORT_LEVELS value on create and rejects unknown values', () => {
@@ -226,6 +227,10 @@ describe('per-reviewer reasoning effort (reviewerEfforts)', () => {
expect(reviewerEffortLevels('gemini')).toEqual(ANTIGRAVITY_EFFORT_LEVELS);
expect(reviewerEffortLevels('ollama')).toEqual(LOCAL_LLM_EFFORT_LEVELS);
expect(reviewerEffortLevels('lmstudio')).toEqual(LOCAL_LLM_EFFORT_LEVELS);
+ // cursor has a ladder even though `cursor-agent` takes no `--effort` flag:
+ // the level is a variant of its model id, folded in by `reviewerModelArg`.
+ expect(reviewerEffortLevels('cursor')).toEqual(CURSOR_EFFORT_LEVELS);
+ expect(reviewerEffortLevels('cursor-agent')).toEqual(CURSOR_EFFORT_LEVELS);
// No effort control: copilot is a GitHub review, grok's CLI takes no flag,
// and a `@username` reviewer is a person.
expect(reviewerEffortLevels('copilot')).toBeNull();
@@ -235,7 +240,7 @@ describe('per-reviewer reasoning effort (reviewerEfforts)', () => {
it('EFFORT_SELECTABLE_REVIEWERS is exactly the reviewers with a non-empty ladder', () => {
expect([...EFFORT_SELECTABLE_REVIEWERS].sort())
- .toEqual(['antigravity', 'claude', 'codex', 'lmstudio', 'ollama']);
+ .toEqual(['antigravity', 'claude', 'codex', 'cursor', 'lmstudio', 'ollama']);
for (const reviewer of REVIEWER_VALUES) {
expect(EFFORT_SELECTABLE_REVIEWERS.includes(reviewer))
.toBe((reviewerEffortLevels(reviewer) || []).length > 0);
@@ -292,6 +297,39 @@ describe('per-reviewer reasoning effort (reviewerEfforts)', () => {
expect(reviewerEffortArgs('claude', null)).toEqual([]);
});
+ it('NEVER emits --effort for cursor, at any level — the CLI has no such flag', () => {
+ // `cursor-agent --effort high` exits non-zero. Cursor's ladder exists so the
+ // level can be PICKED; `reviewerModelArg` is what carries it. A regression
+ // here reaches an agent as a literal command line it runs verbatim.
+ for (const level of CURSOR_EFFORT_LEVELS) {
+ expect(reviewerEffortArgs('cursor', level), level).toEqual([]);
+ expect(reviewerEffortArgs('cursor-agent', level), level).toEqual([]);
+ }
+ expect(reviewerEffortArgs('cursor', 'minimal')).toEqual([]);
+ });
+
+ it('folds a cursor effort into --model, leaving every other reviewer id verbatim', () => {
+ // Cursor's native model-variant syntax, matching slashdo's own fold so the
+ // same pin means the same invocation on either side.
+ expect(reviewerModelArg('cursor', 'gpt-5', 'max')).toBe('gpt-5[effort=max]');
+ // An existing bracket gains an `,effort=` parameter, not a second bracket.
+ expect(reviewerModelArg('cursor', 'claude-opus-4-7[thinking=true]', 'high'))
+ .toBe('claude-opus-4-7[thinking=true,effort=high]');
+ // A model that already names its own effort wins over the ladder pin.
+ expect(reviewerModelArg('cursor', 'gpt-5[effort=low]', 'max')).toBe('gpt-5[effort=low]');
+ // No effort pinned, or one cursor's ladder rejects → the bare id.
+ expect(reviewerModelArg('cursor', 'gpt-5')).toBe('gpt-5');
+ expect(reviewerModelArg('cursor', 'gpt-5', 'minimal')).toBe('gpt-5');
+ // No model to attach the variant to → nothing at all.
+ expect(reviewerModelArg('cursor', '', 'max')).toBeNull();
+ expect(reviewerModelArg('cursor', null, 'max')).toBeNull();
+ // The alias resolves like every other lookup here.
+ expect(reviewerModelArg('cursor-agent', 'gpt-5', 'max')).toBe('gpt-5[effort=max]');
+ // Every other reviewer keeps its id verbatim — its effort rides its own flag.
+ expect(reviewerModelArg('codex', 'gpt-5.6-sol', 'high')).toBe('gpt-5.6-sol');
+ expect(reviewerModelArg('antigravity', 'Gemini 3.5 Flash (High)', 'high')).toBe('Gemini 3.5 Flash (High)');
+ });
+
it('DROPS an out-of-ladder effort instead of clamping it, even from unnormalized input', () => {
// The underlying `buildEffortArgs` clamps (agy `max` → `--effort high`), which
// is right for a provider pin carried across providers but wrong for a reviewer
@@ -317,6 +355,27 @@ describe('per-reviewer reasoning effort (reviewerEfforts)', () => {
// slashdo's local-model loop calls the backend itself, so there's no flag to
// name for lmstudio/ollama in this path.
expect(buildReviewerEffortNote(['ollama'], { ollama: 'high' })).toBe('');
+ // …including when it carries a MODEL pin too: a local reviewer names no
+ // binary, so there is no command line to print (a `null --model …` would be
+ // handed to an agent as something to run).
+ expect(buildReviewerEffortNote(['ollama'], { ollama: 'high' }, { reviewerModels: { ollama: 'qwen2.5:7b' } })).toBe('');
+ expect(buildReviewerEffortNote(['copilot'], { copilot: 'high' }, { reviewerModels: { copilot: 'x' } })).toBe('');
+ });
+
+ it('names cursor with its folded --model instead of an --effort it would reject', () => {
+ const note = buildReviewerEffortNote(['cursor'], { cursor: 'max' }, { reviewerModels: { cursor: 'gpt-5' } });
+ expect(note).toContain('`cursor-agent --model gpt-5[effort=max]`');
+ expect(note).not.toContain('--effort');
+ // No model to fold into: nothing is emitted rather than a bogus flag.
+ expect(buildReviewerEffortNote(['cursor'], { cursor: 'max' })).toBe('');
+ expect(buildReviewerEffortNote(['cursor'], { cursor: 'max' }, { reviewerModels: {} })).toBe('');
+ // A model with NO effort pin is not this sentence's business.
+ expect(buildReviewerEffortNote(['cursor'], {}, { reviewerModels: { cursor: 'gpt-5' } })).toBe('');
+ // The pin still round-trips through the emitted --review-with token, which
+ // suppresses the note exactly as it does for every other reviewer.
+ const reviewWith = buildReviewWithArgs(['cursor'], { reviewerModels: { cursor: 'gpt-5' }, reviewerEfforts: { cursor: 'max' } });
+ expect(reviewWith).toContain('cursor[gpt-5]~effort=max');
+ expect(buildReviewerEffortNote(['cursor'], { cursor: 'max' }, { reviewWith, reviewerModels: { cursor: 'gpt-5' } })).toBe('');
});
it('goes SILENT once the emitted --review-with carries the effort itself', () => {
diff --git a/server/lib/cursor.js b/server/lib/cursor.js
index d67522a868..b3cab39906 100644
--- a/server/lib/cursor.js
+++ b/server/lib/cursor.js
@@ -33,16 +33,21 @@
* default sentinel — it exposes a real `auto` model id (its own server-side
* router, and the binary's own default), so `auto` is stored as `defaultModel`
* and passed through as a normal `--model auto`. Effort is baked into the model
- * ids themselves (`…-low` / `…-high` / `…-xhigh` / `…-max`) rather than exposed
- * as a flag, so cursor has no `--effort` control and `effortLevelsForProvider`
- * correctly reports none for it.
+ * ids themselves rather than exposed as a flag: there is no `--effort` (cursor
+ * exits non-zero on one), and a level is instead a parameter of the model id in
+ * Cursor's own variant syntax — `gpt-5[effort=max]`,
+ * `claude-opus-4-7[thinking=true,effort=high]`. So cursor DOES advertise an
+ * effort ladder (`effortLevelsForProvider` → `CURSOR_EFFORT_LEVELS`) while
+ * `buildEffortArgs` emits nothing for it; every cursor argv builder folds the
+ * level into `--model` via `foldCursorEffortIntoModel` instead. An effort with
+ * no model to attach to is dropped — there is nothing to fold it into.
*
* Dependency-light on purpose: imports only `providerModels.js` helpers,
* mirroring `grok.js`/`kimi.js`/`antigravity.js` so it stays importable from the
* standalone autofixer.
*/
-import { argvHasFlag, commandBasename, hasModelFlag } from './providerModels.js';
+import { argvHasFlag, commandBasename, foldCursorEffortIntoModel, hasModelFlag } from './providerModels.js';
/** The binary basename. Deliberately NOT `cursor` — that is the GUI editor. */
export const CURSOR_COMMAND = 'cursor-agent';
@@ -106,20 +111,24 @@ function ensureCursorPosture(out) {
* neither exits on the trust block nor stalls on a prompt.
* See `ensureCursorPosture` for how a user-pinned posture
* narrows this to just the gate they left uncovered.
- * - `--model <id>` — gated on `model` being set AND no user-baked model flag.
+ * - `--model <id>` — gated on `model` being set AND no user-baked model flag,
+ * carrying `effort` as a folded model variant when pinned
+ * (cursor has no `--effort` flag — see the file header).
* The prompt itself is NOT added here — it rides on stdin at spawn time.
* @param {string[]} baseArgs - user/legacy args (already model-flag-sanitized)
* @param {string|null|undefined} model - defaultModel to pin, or null to omit
+ * @param {string|null|undefined} [effort] - reasoning level to fold into the model id
* @returns {string[]}
*/
-export function ensureCursorHeadlessArgs(baseArgs = [], model) {
+export function ensureCursorHeadlessArgs(baseArgs = [], model, effort) {
const out = [...baseArgs];
if (!argvHasFlag(out, PRINT_FLAGS)) {
out.push('--print');
}
ensureCursorPosture(out);
- if (model && !hasModelFlag(out)) {
- out.push('--model', model);
+ const pinnedModel = foldCursorEffortIntoModel(model, effort);
+ if (pinnedModel && !hasModelFlag(out)) {
+ out.push('--model', pinnedModel);
}
return out;
}
diff --git a/server/lib/cursor.test.js b/server/lib/cursor.test.js
index c0d41a311c..6c3148445c 100644
--- a/server/lib/cursor.test.js
+++ b/server/lib/cursor.test.js
@@ -37,6 +37,19 @@ describe('ensureCursorHeadlessArgs', () => {
expect(ensureCursorHeadlessArgs([], '')).toEqual(['--print', '--force']);
});
+ it('folds a pinned effort into --model instead of emitting an --effort flag', () => {
+ // cursor-agent has no --effort; passing one exits non-zero.
+ expect(ensureCursorHeadlessArgs([], 'gpt-5', 'max'))
+ .toEqual(['--print', '--force', '--model', 'gpt-5[effort=max]']);
+ expect(ensureCursorHeadlessArgs([], 'claude-opus-4-7[thinking=true]', 'high'))
+ .toEqual(['--print', '--force', '--model', 'claude-opus-4-7[thinking=true,effort=high]']);
+ expect(ensureCursorHeadlessArgs([], 'gpt-5', 'max')).not.toContain('--effort');
+ });
+
+ it('drops an effort with no model to attach it to', () => {
+ expect(ensureCursorHeadlessArgs([], null, 'max')).toEqual(['--print', '--force']);
+ });
+
it('does not duplicate print mode pinned in either form', () => {
expect(ensureCursorHeadlessArgs(['--print'], null)).toEqual(['--print', '--force']);
expect(ensureCursorHeadlessArgs(['-p'], null)).toEqual(['-p', '--force']);
diff --git a/server/lib/providerModels.js b/server/lib/providerModels.js
index 1530a2b127..a42f0c85ab 100644
--- a/server/lib/providerModels.js
+++ b/server/lib/providerModels.js
@@ -94,6 +94,15 @@ export const ANTIGRAVITY_EFFORT_LEVELS = Object.freeze(['low', 'medium', 'high']
// OpenCode forwards this narrow OpenAI-compatible ladder as `reasoningEffort`
// to a local Ollama model. Keep it separate from vendor-CLI-only levels.
export const OPENCODE_OLLAMA_EFFORT_LEVELS = Object.freeze(['low', 'medium', 'high']);
+// Cursor Agent's ladder. Cursor has NO `--effort` flag — the level is a
+// parameter of the model id itself (`gpt-5[effort=max]`), folded in by
+// `foldCursorEffortIntoModel` — so `buildEffortArgs` deliberately emits nothing
+// for cursor while this ladder still drives every picker. The tier NAMES are
+// slashdo's documented `~effort=<level>` set (`low|medium|high|xhigh|max`), which
+// is what `--review-with cursor[gpt-5]~effort=max` parses; keeping them
+// identical is the point, since the same pin has to survive a round trip
+// through slashdo.
+export const CURSOR_EFFORT_LEVELS = Object.freeze(['low', 'medium', 'high', 'xhigh', 'max']);
// Effort values no CLI ladder accepts any more, kept ACCEPTED as stored/API
// input so records saved under an older ladder still validate after an install
@@ -107,6 +116,7 @@ export const EFFORT_LEVELS = Object.freeze([...new Set([
...CODEX_EFFORT_LEVELS,
...CLAUDE_EFFORT_LEVELS,
...ANTIGRAVITY_EFFORT_LEVELS,
+ ...CURSOR_EFFORT_LEVELS,
...LEGACY_EFFORT_LEVELS,
])]);
@@ -271,6 +281,56 @@ export function isAntigravityProvider(provider) {
return base === 'agy' || base === 'antigravity';
}
+/**
+ * True when a provider is Cursor-Agent-flavored — the shipped `cursor-cli` /
+ * `cursor-tui` ids or any provider whose launch command basename is
+ * `cursor-agent` (path/exe tolerant). The provider-shaped companion to
+ * `isCursorCommand` in cursor.js; lives here (rather than there) for the same
+ * reason `isAntigravityProvider` does — so `effortLevelsForProvider` and
+ * `buildEffortArgs` can key on it without this dependency-light module importing
+ * a sibling vendor file that already imports IT.
+ *
+ * Deliberately never matches a bare `cursor` command: that is Cursor's GUI
+ * editor launcher, not the agent binary (see cursor.js).
+ * Mirrored in client/src/utils/providers.js — keep in lockstep.
+ * @param {{id?:string, command?:string}|null|undefined} provider
+ * @returns {boolean}
+ */
+export function isCursorProvider(provider) {
+ if (!provider) return false;
+ const id = String(provider.id || '').toLowerCase();
+ return id === 'cursor-cli' || id === 'cursor-tui' || commandBasename(provider.command) === 'cursor-agent';
+}
+
+/**
+ * Fold a reasoning-effort level into a Cursor model id using Cursor's own
+ * model-variant syntax, because `cursor-agent` has NO `--effort` flag and exits
+ * non-zero when passed one. Three cases, matching slashdo's fold in
+ * `lib/local-agent-review-loop.md` exactly (the same pin has to mean the same
+ * invocation whether PortOS or slashdo builds it):
+ *
+ * - `gpt-5` + `max` → `gpt-5[effort=max]`
+ * - `claude-opus-4-7[thinking=true]` + `high` → `claude-opus-4-7[thinking=true,effort=high]`
+ * - a model that ALREADY names `effort=` → returned unchanged (the explicit
+ * variant the user typed wins over the ladder pin)
+ *
+ * Returns the model unchanged when there is no effort, and `null` when there is
+ * no model — an effort with nothing to attach to is dropped rather than emitted
+ * as a flag Cursor would reject.
+ * @param {string|null|undefined} model
+ * @param {string|null|undefined} effort
+ * @returns {string|null}
+ */
+export function foldCursorEffortIntoModel(model, effort) {
+ const id = typeof model === 'string' ? model.trim() : '';
+ if (!id) return null;
+ const level = typeof effort === 'string' ? effort.trim() : '';
+ if (!level) return id;
+ if (id.includes('effort=')) return id;
+ if (id.endsWith(']')) return `${id.slice(0, -1)},effort=${level}]`;
+ return `${id}[effort=${level}]`;
+}
+
/**
* The effort levels a provider's CLI accepts, or null when the provider has no
* effort control (opencode, grok, kimi, HTTP API providers). Keyed on the
@@ -285,6 +345,11 @@ export function isAntigravityProvider(provider) {
* `provider.models`. Omit it — or leave the catalog empty — to get the full
* low/medium/high ladder. Returns null for an Antigravity model the catalog
* says has no tiers at all (`claude-sonnet-4-6`), so no `--effort` is emitted.
+ *
+ * A ladder here does NOT imply an `--effort` flag: cursor advertises levels but
+ * carries them inside `--model` (`foldCursorEffortIntoModel`), so
+ * `buildEffortArgs` returns `[]` for it. Ask this function "can the user pick a
+ * level?", and `buildEffortArgs` "what argv does that level become?".
* @param {{id?:string, command?:string, models?:unknown[]}|null|undefined} provider
* @param {string|null} [model]
* @returns {readonly string[]|null}
@@ -298,6 +363,7 @@ export function effortLevelsForProvider(provider, model = null) {
if (perModel === null) return ANTIGRAVITY_EFFORT_LEVELS;
return perModel.length ? perModel : null;
}
+ if (isCursorProvider(provider)) return CURSOR_EFFORT_LEVELS;
if (isClaudeProvider(provider)) return CLAUDE_EFFORT_LEVELS;
return null;
}
@@ -369,6 +435,11 @@ export function hasEffortFlag(args) {
* effort control, or a user-baked pin already sits in `existingArgs`). The one
* home for both the detection AND the arg shape, so the two can't drift — spawn
* builders just spread the result.
+ *
+ * **Cursor always gets `[]`, even though it HAS a ladder.** `cursor-agent`
+ * exposes no `--effort` flag and exits non-zero when handed one; its effort is a
+ * model-variant parameter, so cursor spawn builders fold the level into
+ * `--model` with `foldCursorEffortIntoModel` instead of spreading this.
* @param {string|null|undefined} effort
* @param {{id?:string, command?:string, models?:unknown[]}|null|undefined} provider
* @param {unknown[]} [existingArgs]
@@ -378,6 +449,7 @@ export function hasEffortFlag(args) {
export function buildEffortArgs(effort, provider, existingArgs = [], model = null) {
const effectiveEffort = resolveCliEffort(effort, provider, model);
if (!effectiveEffort || hasEffortFlag(existingArgs)) return [];
+ if (isCursorProvider(provider)) return []; // rides `--model`, not a flag — see above
return isCodexProvider(provider)
? ['-c', `${CODEX_EFFORT_KEY}=${effectiveEffort}`]
: ['--effort', effectiveEffort];
diff --git a/server/lib/providerModels.test.js b/server/lib/providerModels.test.js
index 4c9210ba2e..7640c9386d 100644
--- a/server/lib/providerModels.test.js
+++ b/server/lib/providerModels.test.js
@@ -26,8 +26,11 @@ import {
CLAUDE_EFFORT_LEVELS,
CODEX_EFFORT_LEVELS,
ANTIGRAVITY_EFFORT_LEVELS,
+ CURSOR_EFFORT_LEVELS,
EFFORT_LEVELS,
isAntigravityProvider,
+ isCursorProvider,
+ foldCursorEffortIntoModel,
effortLevelsForProvider,
resolveCliEffort,
hasEffortFlag,
@@ -233,6 +236,14 @@ describe('providerModels', () => {
expect(effortLevelsForProvider({ id: 'opencode-ollama', command: 'opencode' })).toBeNull();
});
+ it('returns the cursor ladder for cursor ids and the cursor-agent command', () => {
+ expect(effortLevelsForProvider({ id: 'cursor-cli', command: 'cursor-agent' })).toBe(CURSOR_EFFORT_LEVELS);
+ expect(effortLevelsForProvider({ id: 'cursor-tui' })).toBe(CURSOR_EFFORT_LEVELS);
+ expect(effortLevelsForProvider({ id: 'custom', command: '/Users/x/.local/bin/cursor-agent' })).toBe(CURSOR_EFFORT_LEVELS);
+ // A bare `cursor` is the GUI editor, not the agent — no ladder.
+ expect(effortLevelsForProvider({ id: 'custom', command: 'cursor' })).toBeNull();
+ });
+
it('returns null for providers without an effort control (and does NOT default blank commands to claude)', () => {
expect(effortLevelsForProvider({ id: 'grok-cli', command: 'grok' })).toBeNull();
expect(effortLevelsForProvider({ id: 'ollama' })).toBeNull();
@@ -384,6 +395,17 @@ describe('providerModels', () => {
expect(buildEffortArgs('max', { id: 'claude-code', command: 'claude' }, ['--effort', 'low'])).toEqual([]);
});
+ it('NEVER emits --effort for cursor, at any level — the level rides --model', () => {
+ // `cursor-agent --effort <level>` exits non-zero. Cursor advertises a
+ // ladder so the level is pickable; `foldCursorEffortIntoModel` carries it.
+ const cursor = { id: 'cursor-cli', command: 'cursor-agent' };
+ for (const level of CURSOR_EFFORT_LEVELS) {
+ expect(buildEffortArgs(level, cursor), level).toEqual([]);
+ }
+ expect(buildEffortArgs('max', { id: 'cursor-tui' })).toEqual([]);
+ expect(buildEffortArgs('minimal', cursor)).toEqual([]);
+ });
+
it('honors the per-model agy ladder when a model is supplied', () => {
const agy = { id: 'antigravity-cli', command: 'agy', models: AGY_CATALOG };
expect(buildEffortArgs('medium', agy, [], 'gemini-3.6-flash')).toEqual(['--effort', 'medium']);
@@ -392,6 +414,46 @@ describe('providerModels', () => {
});
});
+ describe('isCursorProvider', () => {
+ it('matches the shipped ids and the cursor-agent command, never the GUI `cursor`', () => {
+ expect(isCursorProvider({ id: 'cursor-cli' })).toBe(true);
+ expect(isCursorProvider({ id: 'cursor-tui' })).toBe(true);
+ expect(isCursorProvider({ id: 'custom', command: '/Users/x/.local/bin/cursor-agent' })).toBe(true);
+ expect(isCursorProvider({ id: 'custom', command: 'cursor-agent.exe' })).toBe(true);
+ expect(isCursorProvider({ id: 'custom', command: 'cursor' })).toBe(false);
+ expect(isCursorProvider({ id: 'codex', command: 'codex' })).toBe(false);
+ expect(isCursorProvider(null)).toBe(false);
+ });
+ });
+
+ describe('foldCursorEffortIntoModel', () => {
+ it('appends the variant to a bare model id', () => {
+ expect(foldCursorEffortIntoModel('gpt-5', 'max')).toBe('gpt-5[effort=max]');
+ expect(foldCursorEffortIntoModel(' gpt-5 ', ' high ')).toBe('gpt-5[effort=high]');
+ });
+
+ it('extends an existing variant bracket rather than opening a second one', () => {
+ expect(foldCursorEffortIntoModel('claude-opus-4-7[thinking=true]', 'high'))
+ .toBe('claude-opus-4-7[thinking=true,effort=high]');
+ });
+
+ it('leaves a model that already names an effort alone', () => {
+ expect(foldCursorEffortIntoModel('gpt-5[effort=low]', 'max')).toBe('gpt-5[effort=low]');
+ expect(foldCursorEffortIntoModel('claude-opus-4-7[thinking=true,effort=high]', 'low'))
+ .toBe('claude-opus-4-7[thinking=true,effort=high]');
+ });
+
+ it('returns the model unchanged with no effort, and null with no model', () => {
+ expect(foldCursorEffortIntoModel('gpt-5', null)).toBe('gpt-5');
+ expect(foldCursorEffortIntoModel('gpt-5', '')).toBe('gpt-5');
+ // Nothing to attach the variant to — the pin is dropped, not emitted as a
+ // flag cursor would reject.
+ expect(foldCursorEffortIntoModel('', 'max')).toBeNull();
+ expect(foldCursorEffortIntoModel(null, 'max')).toBeNull();
+ expect(foldCursorEffortIntoModel(undefined, undefined)).toBeNull();
+ });
+ });
+
describe('EFFORT_LEVELS', () => {
// The union is the STORED/API vocabulary, not a CLI ladder. It stays a
// superset of every ladder so an effort persisted by an older install (or an
diff --git a/server/lib/providerVendors.js b/server/lib/providerVendors.js
index 0812d2d0c2..47f515b44a 100644
--- a/server/lib/providerVendors.js
+++ b/server/lib/providerVendors.js
@@ -56,6 +56,9 @@
import {
resolveCliModel,
+ resolveCliEffort,
+ foldCursorEffortIntoModel,
+ isCursorProvider,
hasModelFlag,
resolveInjectedTuiModel,
resolveBedrockCliModel,
@@ -215,8 +218,13 @@ const KIMI = {
// ─── cursor ─────────────────────────────────────────────────────────────────
-function cursorCliArgs(baseArgs, { model }) {
- return ensureCursorHeadlessArgs(baseArgs, model);
+function cursorCliArgs(baseArgs, { model, effort }) {
+ // cursor-agent has no `--effort` flag (it exits non-zero on one), so the level
+ // is folded into the model id instead — resolved through cursor's ladder first
+ // so an out-of-range value clamps the way every other CLI's does. Resolved
+ // against the CLI this row IS, not `provider`, so a provider that reaches this
+ // row by id alone still gets its level applied.
+ return ensureCursorHeadlessArgs(baseArgs, model, resolveCliEffort(effort, { command: CURSOR_COMMAND }));
}
const CURSOR = {
@@ -395,6 +403,16 @@ export function injectTuiModelAndEffort(command, baseArgs, provider, model, effo
const withModel = resolved.model ? [...baseArgs, '--model', resolved.model] : baseArgs;
return [...withModel, ...buildEffortArgs(resolved.effort, resolved.provider, withModel, resolved.base)];
}
+ if (isCursorProvider({ id: provider?.id, command })) {
+ // Cursor's effort is a model-variant parameter, not a flag — fold it in so
+ // the TUI honors a pinned level instead of dropping it (buildEffortArgs
+ // emits nothing for cursor by design).
+ const cursorModel = foldCursorEffortIntoModel(
+ resolveCliModel(model),
+ resolveCliEffort(effort, { id: provider?.id, command })
+ );
+ return (cursorModel && !hasModelFlag(baseArgs)) ? [...baseArgs, '--model', cursorModel] : baseArgs;
+ }
const effectiveModel = resolveCliModel(model);
const shouldInject = !!effectiveModel && !hasModelFlag(baseArgs);
// Per-command model rewriting (OpenCode namespacing, Bedrock mapping) lives
diff --git a/server/lib/tuiHandshake.test.js b/server/lib/tuiHandshake.test.js
index cc914e0444..548ef2a694 100644
--- a/server/lib/tuiHandshake.test.js
+++ b/server/lib/tuiHandshake.test.js
@@ -699,10 +699,24 @@ describe('tuiHandshake.buildTuiInvocation', () => {
expect(out.args).toEqual(['--force']);
});
- it('emits no --effort for cursor — its reasoning tier is baked into the model id', () => {
+ it('emits no --effort for cursor — the tier is a parameter of the model id', () => {
const provider = { id: 'cursor-tui', command: 'cursor-agent', args: ['--force'], effort: 'high' };
const out = buildTuiInvocation(provider, 'claude-opus-5-thinking-high');
expect(out.args).not.toContain('--effort');
+ // …and it is not dropped either: cursor's own variant syntax carries it.
+ expect(out.args).toEqual(['--force', '--model', 'claude-opus-5-thinking-high[effort=high]']);
+ });
+
+ it('extends an existing cursor model variant rather than opening a second bracket', () => {
+ const provider = { id: 'cursor-tui', command: 'cursor-agent', args: ['--force'], effort: 'max' };
+ const out = buildTuiInvocation(provider, 'claude-opus-4-7[thinking=true]');
+ expect(out.args).toEqual(['--force', '--model', 'claude-opus-4-7[thinking=true,effort=max]']);
+ });
+
+ it('leaves a cursor model that already names its own effort alone', () => {
+ const provider = { id: 'cursor-tui', command: 'cursor-agent', args: ['--force'], effort: 'low' };
+ const out = buildTuiInvocation(provider, 'gpt-5[effort=max]');
+ expect(out.args).toEqual(['--force', '--model', 'gpt-5[effort=max]']);
});
it('does not Bedrock-map a cursor model id that merely contains "claude"', () => {
diff --git a/server/services/agentPromptBuilder.js b/server/services/agentPromptBuilder.js
index ddfb2ef949..3e1f8c70a2 100644
--- a/server/services/agentPromptBuilder.js
+++ b/server/services/agentPromptBuilder.js
@@ -17,7 +17,7 @@ import { getActiveProvider } from './providers.js';
import { runPromptThroughProvider } from '../lib/promptRunner.js';
import { readJSONFile, PATHS, tryReadFile, expandHome } from '../lib/fileUtils.js';
import { loadSlashdoFile, loadSlashdoLib, writeResolvedSlashdoBody } from '../lib/slashdoLoader.js';
-import { DEFAULT_REVIEWER, DEFAULT_REVIEWERS, DEFAULT_REVIEW_STOP_MODE, LOCAL_LLM_REVIEWERS, MODEL_CAPABLE_CLI_REVIEWERS, describeReviewerCli, isCliReviewer, reviewerCliBinary, normalizeReviewUsernames, normalizeOptionalReviewers, normalizeReviewerMaxRounds, resolveReviewerConfig, reviewerEffortArgs, buildReviewerEffortNote, resolveKeyedReviewers, buildReviewWithArgs, buildReviewersCsv } from '../lib/validation.js';
+import { DEFAULT_REVIEWER, DEFAULT_REVIEWERS, DEFAULT_REVIEW_STOP_MODE, LOCAL_LLM_REVIEWERS, MODEL_CAPABLE_CLI_REVIEWERS, describeReviewerCli, isCliReviewer, reviewerCliBinary, normalizeReviewUsernames, normalizeOptionalReviewers, normalizeReviewerMaxRounds, resolveReviewerConfig, reviewerEffortArgs, reviewerModelArg, buildReviewerEffortNote, resolveKeyedReviewers, buildReviewWithArgs, buildReviewersCsv } from '../lib/validation.js';
import { PROVIDER_TYPES } from '../lib/aiToolkit/constants.js';
import { doneSentinelName } from '../lib/agentSentinel.js';
import { canTypeSlashCommands, agentOwnsPrWorkflow, resolveSlashdoInvocation, buildSlashdoSection, oversizedBodyPointer, unreachableReviewerIncludes, SLASHDO_INLINE_BUDGET_CHARS } from '../lib/slashdoInvocation.js';
@@ -663,7 +663,7 @@ async function applySlashdoInvocation(task, {
// resolves reviewers itself and the note is the pin's only route to the CLI it
// spawns (the `/do:pr` completion step further down is a different invocation
// entirely, and for a slashdo-backed task usually isn't reached).
- const reviewerEffortNote = buildReviewerEffortNote(resolvedReviewers, resolvedEfforts, { reviewWith });
+ const reviewerEffortNote = buildReviewerEffortNote(resolvedReviewers, resolvedEfforts, { reviewWith, reviewerModels: resolvedModels });
const section = buildSlashdoSection(resolved, body, { bodyPath, reviewWith, reviewerEffortNote });
return { ...task, description: `${task.description}\n\n${section}` };
}
@@ -778,7 +778,8 @@ export function buildReviewLoopFollowUpSection(metadata = {}, { verbose = false,
// Optional per-reviewer reasoning-effort pins, same two sources as the models.
// A CLI reviewer's effort becomes a flag on the command line the agent runs
// (`--effort high` for claude/agy, `-c model_reasoning_effort=high` for codex —
- // `reviewerEffortArgs` owns that shape); a local-LLM reviewer's becomes the
+ // `reviewerEffortArgs` owns that shape, and returns nothing for cursor, whose
+ // level is folded into `--model` by `reviewerModelArg`); a local-LLM reviewer's becomes the
// `reasoning_effort` field of its `/api/code-review/local` body (below). There is
// no slashdo `--review-with` suffix for effort, which is why it rides the
// invocation rather than `equivArgs`.
@@ -802,7 +803,11 @@ export function buildReviewLoopFollowUpSection(metadata = {}, { verbose = false,
// reason: the user configures the id their environment needs (a Bedrock-form id
// on a Bedrock box, an installed Ollama model for an Ollama-backed `claude`).
if (MODEL_CAPABLE_CLI_REVIEWERS.includes(r) && typeof reviewerModelMap[r] === 'string' && reviewerModelMap[r]) {
- flags.push(`--model ${reviewerModelMap[r]}`);
+ // `reviewerModelArg` (not the raw id) because cursor carries its
+ // reasoning effort INSIDE the model id — `gpt-5[effort=max]` — so the
+ // pinned pair must render as ONE `--model`, never a `--effort` cursor
+ // rejects. Every other reviewer gets the id back verbatim.
+ flags.push(`--model ${reviewerModelArg(r, reviewerModelMap[r], reviewerEffortMap[r])}`);
}
const effortArgs = reviewerEffortArgs(r, reviewerEffortMap[r]);
if (effortArgs.length) flags.push(effortArgs.join(' '));
@@ -2390,7 +2395,7 @@ function resolveReviewInvocation({ willOpenPR, runsReviewLoop, reviewers, userna
// the prose note is suppressed whenever that suffix is present — it only speaks
// for an invocation that pins no reviewer list (see buildReviewerEffortNote).
const effortNote = willOpenPR && runsReviewLoop
- ? buildReviewerEffortNote(reviewers, reviewerEfforts, { reviewWith: reviewArgs })
+ ? buildReviewerEffortNote(reviewers, reviewerEfforts, { reviewWith: reviewArgs, reviewerModels })
: '';
return { reviewUsernames, reviewArgs, effortNote };
}
diff --git a/server/services/agentPromptBuilder.test.js b/server/services/agentPromptBuilder.test.js
index 049460af6a..ec53b45f44 100644
--- a/server/services/agentPromptBuilder.test.js
+++ b/server/services/agentPromptBuilder.test.js
@@ -1376,6 +1376,27 @@ describe('buildLightContextPrompt', () => {
expect(prompt).not.toMatch(/antigravity --effort/);
});
+ it('folds a cursor effort into its --model — the follow-up must never print `cursor-agent --effort`', () => {
+ const prompt = buildLightContextPrompt(
+ makeTask({ metadata: {
+ reviewLoopFollowUp: true,
+ reviewLoopPRUrl: 'https://github.com/o/r/pull/9',
+ reviewLoopPRBranch: 'b',
+ reviewLoopPRNumber: 9,
+ reviewLoopReviewers: ['cursor'],
+ reviewLoopReviewerModels: { cursor: 'gpt-5' },
+ reviewLoopReviewerEfforts: { cursor: 'max' },
+ sourceTaskId: 'task-src-cursor-effort',
+ }}),
+ '/r',
+ { branchName: 'b', worktreePath: '/tmp/wt' },
+ isTruthyMeta);
+ // This is a literal command line the agent runs; `cursor-agent --effort max`
+ // exits non-zero, so the level has to ride the model variant instead.
+ expect(prompt).toMatch(/cursor-agent --model gpt-5\[effort=max\]/);
+ expect(prompt).not.toMatch(/cursor-agent[^\n]*--effort/);
+ });
+
it('names a pinned local-LLM effort as an /api/code-review/local body key', () => {
const prompt = buildLightContextPrompt(
makeTask({ metadata: {
diff --git a/server/services/agentWorktreeCleanup.js b/server/services/agentWorktreeCleanup.js
index 045ce2c6b1..edde6de036 100644
--- a/server/services/agentWorktreeCleanup.js
+++ b/server/services/agentWorktreeCleanup.js
@@ -821,7 +821,8 @@ export async function spawnReviewLoopFollowUp({ originalAgentId, originalTask, p
const narrowedReviewerModels = narrowPins(reviewerModels, MODEL_SELECTABLE_REVIEWERS);
// Reviewer-keyed reasoning-effort map, narrowed the same way. The prompt turns a
// CLI reviewer's effort into a flag on its command line (`--effort high` /
- // `-c model_reasoning_effort=high`) and a local-LLM reviewer's into the
+ // `-c model_reasoning_effort=high`, or a folded `--model gpt-5[effort=max]` for
+ // cursor, whose CLI has no effort flag) and a local-LLM reviewer's into the
// `reasoning_effort` field of its `/api/code-review/local` body.
const narrowedReviewerEfforts = narrowPins(reviewerEfforts, EFFORT_SELECTABLE_REVIEWERS);
diff --git a/server/services/codeReview.test.js b/server/services/codeReview.test.js
index 7d4fb5aa3c..46d234ac7b 100644
--- a/server/services/codeReview.test.js
+++ b/server/services/codeReview.test.js
@@ -31,7 +31,7 @@ import {
__resetCodeReviewDefaultsCache,
__resetReviewerCliInstalledCache,
} from './codeReview.js'
-import { MODEL_SELECTABLE_REVIEWERS } from '../lib/cosValidation.js'
+import { MODEL_SELECTABLE_REVIEWERS, EFFORT_SELECTABLE_REVIEWERS } from '../lib/cosValidation.js'
// Minimal stand-ins for the deps resolveReviewLoopOptions is handed by its
// callers (agentCliSpawning / agentCompletionCleanup) — kept trivial so the
@@ -62,15 +62,12 @@ describe('codeReview helpers', () => {
})
describe('pickCodeReviewDefaults', () => {
- // Every effort-capable reviewer reports `null` when nothing is configured;
- // spread rather than pasted so the roster only has to change in one place.
- const NO_EFFORTS = {
- claudeEffort: null,
- codexEffort: null,
- antigravityEffort: null,
- lmstudioEffort: null,
- ollamaEffort: null,
- }
+ // Every effort-capable reviewer reports `null` when nothing is configured.
+ // Derived from the roster for the same reason NO_MODELS below is: the keys
+ // `pickCodeReviewDefaults` emits come from that roster too, so a hand-listed
+ // copy would need editing in lockstep with every future addition (`cursor`
+ // joined when its ladder landed) and says nothing extra when it is.
+ const NO_EFFORTS = Object.fromEntries(EFFORT_SELECTABLE_REVIEWERS.map((r) => [`${r}Effort`, null]))
// Same for every model-selectable reviewer — `antigravity` joined the roster
// when agy's `--model` became pinnable (#3728), `grok` when `grok --model`
// did (#3729). Derived from the roster, because `pickCodeReviewDefaults`
diff --git a/server/services/cosTaskGenerator.js b/server/services/cosTaskGenerator.js
index a2e7de069b..6695a9da4a 100644
--- a/server/services/cosTaskGenerator.js
+++ b/server/services/cosTaskGenerator.js
@@ -516,7 +516,7 @@ export async function buildClaimWorkTask(app, {
+ appendTargetWorkItemBlock(promptTaskType, targetRef)
+ appendPrefetchedIssueContext(promptTaskType, targetRef, issueContext)
+ appendClaimOverrideContext(overrideContext)
- + appendReviewerEffortBlock(reviewersList, promptReviewerEfforts)
+ + appendReviewerEffortBlock(reviewersList, promptReviewerEfforts, promptReviewerModels)
+ buildLocalReviewerInstructions(reviewersList, promptReviewerModels, promptReviewerEfforts);
// Mirror the scheduler: inherit the delegated flow's isolation posture so the
@@ -553,7 +553,7 @@ async function resolveClaimReviewerPrompt() {
const { reviewerModels, reviewerEfforts } = resolveReviewerPins(null, codeReviewDefaults);
return {
csv: buildReviewersCsv(list, codeReviewDefaults?.usernames, codeReviewDefaults?.optionalReviewers, codeReviewDefaults?.reviewerMaxRounds, reviewerModels, reviewerEfforts),
- effortBlock: appendReviewerEffortBlock(list, reviewerEfforts),
+ effortBlock: appendReviewerEffortBlock(list, reviewerEfforts, reviewerModels),
localReviewerBlock: buildLocalReviewerInstructions(list, reviewerModels, reviewerEfforts),
};
}
@@ -703,9 +703,13 @@ const appendTargetWorkItemBlock = (promptTaskType, ref) => {
* `swarmBlock` is prepended) — and prose because the claim agent invokes each
* reviewer CLI directly: this flow emits no `--review-with`, so the CSV's
* `~effort=` suffix reaches no parser. Empty when no reviewer in the list pins one.
+ *
+ * The MODELS ride along because cursor's effort is a variant of its model id
+ * rather than a flag — without them a pinned `cursor[<id>]~effort=<level>` would
+ * have no invocation to name here at all.
*/
-const appendReviewerEffortBlock = (reviewers, reviewerEfforts) => {
- const note = buildReviewerEffortNote(reviewers, reviewerEfforts);
+const appendReviewerEffortBlock = (reviewers, reviewerEfforts, reviewerModels) => {
+ const note = buildReviewerEffortNote(reviewers, reviewerEfforts, { reviewerModels });
return note ? `\n\n${note}` : '';
};
@@ -2897,7 +2901,7 @@ async function buildImprovementTaskDescription({ promptTemplate, app, promptTask
// step — appending here too would print the same sentence twice and give one
// instruction two owners to drift apart.
+ (/\{reviewers\}/.test(promptTemplate)
- ? appendReviewerEffortBlock(promptReviewers, promptReviewerEfforts)
+ ? appendReviewerEffortBlock(promptReviewers, promptReviewerEfforts, promptReviewerModels)
: '')
+ (/\{reviewers\}/.test(promptTemplate)
? buildLocalReviewerInstructions(promptReviewers, promptReviewerModels, promptReviewerEfforts)
diff --git a/server/services/cosTaskGenerator.test.js b/server/services/cosTaskGenerator.test.js
index 16f9ce59b8..c1010ed0a7 100644
--- a/server/services/cosTaskGenerator.test.js
+++ b/server/services/cosTaskGenerator.test.js
@@ -367,9 +367,12 @@ describe('{reviewers} interpolation honors Code Review Defaults', () => {
// invocation: the agent spawns each reviewer itself, so the CSV's suffix
// reaches no parser and the sentence is the pin's only route. No claim path
// may start passing `reviewWith` and mute itself.
- expect(GEN_SRC).toContain('appendReviewerEffortBlock(reviewersList, promptReviewerEfforts)');
- expect(GEN_SRC).toContain('appendReviewerEffortBlock(list, reviewerEfforts)');
- expect(GEN_SRC).toContain('appendReviewerEffortBlock(promptReviewers, promptReviewerEfforts)');
+ // The models ride along because cursor's effort is a variant of its model id
+ // rather than a flag — without them a cursor pin would have no invocation to
+ // name (see `reviewerModelArg`).
+ expect(GEN_SRC).toContain('appendReviewerEffortBlock(reviewersList, promptReviewerEfforts, promptReviewerModels)');
+ expect(GEN_SRC).toContain('appendReviewerEffortBlock(list, reviewerEfforts, reviewerModels)');
+ expect(GEN_SRC).toContain('appendReviewerEffortBlock(promptReviewers, promptReviewerEfforts, promptReviewerModels)');
expect(GEN_SRC).not.toMatch(/buildReviewerEffortNote\([^)]*reviewWith/);
});