Probe Cursor models via list_available_models#2428
Conversation
- Add `cursor/list_available_models` support to the ACP mock agent - Use the new model list response for Cursor model discovery and capability enrichment - Update tests to cover the extension path and reduced probe teardown
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
- Add a schema for `cursor/list_available_models` responses - Use decoded model data when building Cursor provider capabilities - Cover per-model config options in Cursor ACP tests
ApprovabilityVerdict: Needs human review Significant change to Cursor model discovery mechanism with removal of fallback behavior. Open review comment identifies potential regression when the new You can customize Macroscope's approvability policy. Learn more. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Capability enrichment lacks fallback unlike model discovery
- Added Effect.catchCause fallback to discoverCursorModelCapabilitiesViaAcp that falls back to the config-options approach via session setup, matching the existing pattern in discoverCursorModelsViaAcp.
Or push these changes by commenting:
@cursor push 4751b3d485
Preview (4751b3d485)
diff --git a/apps/server/src/provider/Layers/CursorProvider.ts b/apps/server/src/provider/Layers/CursorProvider.ts
--- a/apps/server/src/provider/Layers/CursorProvider.ts
+++ b/apps/server/src/provider/Layers/CursorProvider.ts
@@ -576,6 +576,15 @@
_existingModels: ReadonlyArray<ServerProviderModel>,
) =>
discoverCursorModelsViaListAvailableModels(cursorSettings).pipe(
+ Effect.catchCause(() =>
+ withCursorAcpProbeRuntime(cursorSettings, (acp) =>
+ Effect.map(acp.start(), (started) =>
+ buildCursorDiscoveredModelsFromConfigOptions(
+ started.sessionSetupResult.configOptions ?? [],
+ ),
+ ),
+ ),
+ ),
Effect.withSpan("cursor-acp-model-capability-discovery", {}),
);You can send follow-ups to the cloud agent here.
Resolve Cursor provider conflicts by keeping main's environment-aware provider runtime plumbing while preserving list_available_models discovery. Co-authored-by: codex <codex@users.noreply.github.com>
…robe # Conflicts: # apps/server/src/provider/Layers/CursorProvider.ts # apps/server/src/provider/acp/CursorAcpExtension.ts
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Enrichment shrinks model catalog
- Merged base snapshot models with discovered models during enrichment so that models from the initial snapshot (e.g. from session config fallback) are preserved when list_available_models returns a shorter list.
Or push these changes by commenting:
@cursor push 9bd61ebce7
Preview (9bd61ebce7)
diff --git a/apps/server/src/provider/Layers/CursorProvider.ts b/apps/server/src/provider/Layers/CursorProvider.ts
--- a/apps/server/src/provider/Layers/CursorProvider.ts
+++ b/apps/server/src/provider/Layers/CursorProvider.ts
@@ -1216,11 +1216,16 @@
if (discoveredModels.length === 0) {
return Effect.void;
}
+ const discoveredSlugs = new Set(discoveredModels.map((m) => m.slug));
+ const mergedModels = [
+ ...discoveredModels,
+ ...baseSnapshot.models.filter((m) => !discoveredSlugs.has(m.slug)),
+ ];
return publishSnapshot(
stampIdentity({
...baseSnapshot,
models: providerModelsFromSettings(
- discoveredModels,
+ mergedModels,
PROVIDER,
settings.customModels,
EMPTY_CAPABILITIES,You can send follow-ups to the cloud agent here.
| export const discoverCursorModelsViaAcp = ( | ||
| cursorSettings: CursorSettings, | ||
| environment: NodeJS.ProcessEnv = process.env, | ||
| ) => discoverCursorModelsViaListAvailableModels(cursorSettings, environment); |
There was a problem hiding this comment.
Missing config options discovery fallback
Medium Severity
discoverCursorModelsViaAcp now only calls cursor/list_available_models and no longer falls back to building models from session/new config options when that extension fails or is unsupported. Authenticated status checks then surface a discovery warning and publish no built-in models, which regresses behavior that previously worked against standard ACP session setup.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit a6c9842. Configure here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Version advisory enrichment skipped
- Removed the early return that gated version advisory enrichment on settings.enabled and auth status, aligning Cursor with the Claude and Codex drivers which always run enrichProviderSnapshotWithVersionAdvisory unconditionally.
Or push these changes by commenting:
@cursor push 1a86cdd225
Preview (1a86cdd225)
diff --git a/apps/server/src/provider/Layers/CursorProvider.ts b/apps/server/src/provider/Layers/CursorProvider.ts
--- a/apps/server/src/provider/Layers/CursorProvider.ts
+++ b/apps/server/src/provider/Layers/CursorProvider.ts
@@ -1106,13 +1106,9 @@
readonly stampIdentity?: (snapshot: ServerProvider) => ServerProvider;
readonly httpClient: HttpClient.HttpClient;
}): Effect.Effect<void> => {
- const { settings, snapshot, publishSnapshot } = input;
+ const { snapshot, publishSnapshot } = input;
const stampIdentity = input.stampIdentity ?? ((value) => value);
- if (!settings.enabled || snapshot.auth.status === "unauthenticated") {
- return Effect.void;
- }
-
return enrichProviderSnapshotWithVersionAdvisory(snapshot, input.maintenanceCapabilities).pipe(
Effect.provideService(HttpClient.HttpClient, input.httpClient),
Effect.flatMap((enrichedSnapshot) =>You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 9438727. Configure here.
| ).pipe( | ||
| if (!settings.enabled || snapshot.auth.status === "unauthenticated") { | ||
| return Effect.void; | ||
| } |
There was a problem hiding this comment.
Version advisory enrichment skipped
Low Severity
enrichCursorSnapshot returns immediately when the provider is disabled or the snapshot is unauthenticated, so it never runs enrichProviderSnapshotWithVersionAdvisory or republishes advisory metadata in those states.
Reviewed by Cursor Bugbot for commit 9438727. Configure here.
There was a problem hiding this comment.
Intentional. enrichCursorSnapshot is a background follow-up path, and disabled Cursor providers should not perform any background work. We also skip unauthenticated snapshots to avoid republishing advisory metadata for an unusable provider state. The regular provider check remains responsible for auth/status and model discovery when enabled.



Summary
cursor/list_available_modelsACP extension to discover models and their config-driven capabilities.Testing
bun run test apps/server/src/provider/Layers/CursorProvider.test.tsbun fmtbun lintbun typecheckNote
Medium Risk
Changes how Cursor provider models and capabilities are populated (single extension call vs. background probes), which affects model picker behavior if the extension response differs from the old path.
Overview
Cursor model discovery now uses Cursor’s
cursor/list_available_modelsACP extension during provider status checks instead of deriving models fromsession/newconfig options and probing each model in the background.The server decodes responses with a new
CursorListAvailableModelsResponseschema and maps each entry’s per-modelconfigOptionsinto provider models and capabilities via existingbuildCursorCapabilitiesFromConfigOptions.discoverCursorModelCapabilitiesViaAcp, session-based model listing helpers, and the multi-runtime capability probe path are removed.enrichCursorSnapshotno longer runs ACP capability enrichment; it only applies version-advisory updates when the provider is enabled and authenticated.CursorDriverdrops the extra spawner/environment wiring that supported background probes.The mock ACP agent implements
cursor/list_available_modelswith a static catalog and model-specific config options. Tests are updated accordingly; capability-probe and session/new discovery tests are removed.Reviewed by Cursor Bugbot for commit efd96ae. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Probe Cursor models via
cursor/list_available_modelsACP extensioncursor/list_available_modelsACP request that returns all models and their config options at once.CursorListAvailableModelsResponseschema in CursorAcpExtension.ts to decode the response, andbuildCursorDiscoveredModelsFromAvailableModelsResponsein CursorProvider.ts to map it toServerProviderModelentries.enrichCursorSnapshotto only publish version advisory metadata; background capability re-probing during enrichment is removed.cursor/list_available_modelshandler support to the ACP mock agent for local testing.Macroscope summarized efd96ae.