Skip to content

feat: support Cursor SDK model params in proof#178

Open
tonyketcham wants to merge 3 commits intomainfrom
toeknee/proof-model-params-da19
Open

feat: support Cursor SDK model params in proof#178
tonyketcham wants to merge 3 commits intomainfrom
toeknee/proof-model-params-da19

Conversation

@tonyketcham
Copy link
Copy Markdown
Collaborator

@tonyketcham tonyketcham commented May 8, 2026

Summary of changes

Adds SDK-style model selections to Proof DAG/model-file config so complexity mappings can specify { id, params }, validates those selections against Cursor.models.list() at run time, and expands partial param selections to valid preset variants before creating Cursor SDK agents.

Closes #

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • I added doc comments to any new public exports, and inline comments to any hard-to-understand areas
  • My changes generate no new console errors locally
  • If applicable, try to include a test that fails without this PR but passes with it

Does this introduce any non-backwards compatible changes?

  • Yes
  • No

Does this include any user config changes?

  • Yes
    • If so, I have updated the relevant areas of documentation
  • No
Open in Web Open in Cursor 

cursoragent and others added 2 commits May 8, 2026 06:58
Co-authored-by: Tony <tonyketcham@users.noreply.github.com>
Co-authored-by: Tony <tonyketcham@users.noreply.github.com>
@tonyketcham tonyketcham marked this pull request as ready for review May 8, 2026 14:22
- Add @deprecated JSDoc to createModelResolver (silently discards params)
- Render modelSelection.params in canvas template (was serialized but unused)
- Fix variant tiebreaker: prefer catalog default on score ties
- De-duplicate defaultVariant() call in chooseMatchingVariant

Change-Id: Ic8dfe2ddc37948affb1b6849428f0a9439daa170
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Found 2 medium-risk issues in the new model-selection support:

  1. parseDAG() / validateModelMap() now canonicalize string model overrides into { id } objects, which changes the observable return shape of the exported parsing helpers for string-only inputs.
  2. Param validation assumes Cursor.models.list() always populates parameters, but the SDK marks that field optional, so models that expose only variants would reject otherwise valid param selections.
Open in Web View Automation 

Sent by Cursor Automation: Flatbread PR Review

Comment thread packages/proof/src/dag.ts
throw new Error(`${label}.${key} must be a non-empty string.`);
}
models[key as Complexity] = value.trim();
models[key as Complexity] = validateModelSelection(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

validateModelMap() is part of the public parsing surface, and this assignment changes its runtime output shape for every string-only override. Before this PR, parseDAG({ models: { LOW: "composer-2" } }) produced dag.models.LOW === "composer-2"; after this change the same input becomes { id: "composer-2" }. That is an observable API break for JS callers and any tooling that round-trips parsed DAGs. Since the new resolver path can normalize later, I think we should preserve raw strings here and defer canonicalization until resolution time.

Comment thread packages/proof/src/dag.ts
label: string
): void {
const definitions = new Map(
(catalogItem.parameters ?? []).map((param) => [param.id, param])
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This assumes Cursor.models.list() always includes parameters, but the SDK type marks parameters and variants as independently optional. If a model publishes only variants, every requested param will now fail with does not support param ... even though the variant list itself contains valid params. Can we infer the allowed ids/values from variants when parameters is absent, or only run this strict check when explicit parameter definitions are present?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants