Skip to content

feat(cursor): map optional Max Mode from the SDK catalog - #27908

Open
Huijiro wants to merge 4 commits into
pingdotgg:mainfrom
Huijiro:t3/cursor-optional-max-mode
Open

Huijiro wants to merge 4 commits into
pingdotgg:mainfrom
Huijiro:t3/cursor-optional-max-mode

Conversation

@Huijiro

@Huijiro Huijiro commented Oct 31, 2026 •

Copy link
Copy Markdown

Problem

Cursor catalog variants can require or optionally offer max mode, but T3 model selection did not set SDK maxMode from the catalog and had no composer control when the same params matched both max and non-max variants.

Change

Return catalog sdkModels from the timed status probe, cache them on the driver, derive forced maxMode from matching variants, expose an optional Max Mode boolean when the catalog offers both, and ignore the option when the selected params have no matching max variant.

Scope and approval

Depends on #27906 (SDK 1.2.0). Catalog/maxMode mapping only; no summarize/compaction changes. Closed precursor: #26262 (split for one-problem).

Verification

  • vp test run packages/provider-cursor/src/server/sdkModel.test.ts packages/provider-cursor/src/server/status.test.ts packages/provider-cursor/src/server/driver.test.ts packages/provider-cursor/src/server/adapter.test.ts

Composer (Cursor harness) via T3 Code.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Oct 31, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — Cursor now derives Max Mode from catalog variants and supports ambient MCP/plugins alongside T3 tools. Human review is needed to confirm the changed default model and tool behavior is intended.

Needs human approval because:

  • 1 blocking correctness issue found at or above your repo's Minimum Blocking Severity

Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The Cursor provider now returns SDK model metadata with successful status checks. It uses model variants to determine Max Mode behavior, exposes optional Max Mode as a capability, and passes SDK models into agent and turn model selection.

Changes: Cursor SDK model selection

Layer / File(s) Summary
Max Mode variant matching
packages/provider-cursor/src/server/sdkModel.ts, packages/provider-cursor/src/server/sdkModel.test.ts
Variant matching determines when Max Mode is required or optional. Model selection sets maxMode separately from SDK parameters. Tests cover variant matching and Max Mode selection.
Status results and model capabilities
packages/provider-cursor/src/server/status.ts, packages/provider-cursor/src/server/status.test.ts
Status checks return SDK models when catalog loading succeeds, or undefined on failure paths. Models with optional Max Mode receive a default-false capability. Tests cover returned models and capabilities.
Catalog propagation to model selection
packages/provider-cursor/src/server/driver.ts, packages/provider-cursor/src/server/adapter.ts, packages/provider-cursor/src/server/driver.test.ts
The driver retains available SDK models and exposes them to the adapter. Agent creation and turn sending provide those models to model selection. The driver test expects Max Mode for a Max-only default variant.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant CursorDriver
  participant CursorProviderStatus
  participant CursorSdkCatalog
  participant CursorAdapter
  participant CursorSdkModelSelection
  CursorDriver->>CursorProviderStatus: check status
  CursorProviderStatus->>CursorSdkCatalog: read SDK models
  CursorSdkCatalog-->>CursorProviderStatus: return SDK models
  CursorProviderStatus-->>CursorDriver: return provider and SDK models
  CursorDriver->>CursorAdapter: expose SDK models
  CursorAdapter->>CursorSdkModelSelection: select using model variants
Loading

Possibly related issues

Possibly related PRs

  • pingdotgg/t3code#26262 — Introduces the Cursor SDK catalog variant behavior that this change uses to select Max Mode.
  • pingdotgg/t3code#28722 — Extends the catalog-to-model-selection flow by passing catalog models through the adapter.
  • pingdotgg/t3code#28718 — Changes the catalog implementation and model-discovery path consumed by the status and driver changes.

Suggested reviewers: noahcuadrado, bil0000

Merge Risk: Minimal · up to c2831

No actionable merge-blocking risk is identified in the reviewed change.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description covers the problem, the change, scope and approval, and verification. The Problem and Change sections clearly describe the behavior gap and the fix. The Scope section names a dependenc… Add a link to the triaged bug issue or the maintainer-approved discussion, with the approval comment. If no prior issue exists, explain why this qualifies as a small, focused fix or as focused configuration of an established capability. Und…
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title "feat(cursor): map optional Max Mode from the SDK catalog" follows conventional commit format and names the main change. The changeset maps SDK catalog variants to a maxMode parameter, force…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "feat(cursor): map optional Max Mode from the SDK catalog" follows conventional commit format and names the main change. The changeset maps SDK catalog variants to a maxMode parameter, forces maxMode when variants require it, and exposes an optional Max Mode boolean when the catalog offers both modes. The title is specific and concise, and a reviewer scanning history can identify the primary change.

Full details: Description check

Explanation

The description covers the problem, the change, scope and approval, and verification. The Problem and Change sections clearly describe the behavior gap and the fix. The Scope section names a dependency on #27906 and a closed precursor PR. The Verification section lists a focused test command. Gaps against the template: the Scope and approval section does not link a triaged bug issue or maintainer approval, and the template requires explaining why an optional Max Mode setting is a focused configuration of an established capability. The Verification section does not state observed results or note what was not checked, such as live Cursor catalog behavior. The description also omits the required agent model and harness line, although it includes a 'Composer (Cursor harness) via T3 Code' note that may serve that purpose.

Resolution

Add a link to the triaged bug issue or the maintainer-approved discussion, with the approval comment. If no prior issue exists, explain why this qualifies as a small, focused fix or as focused configuration of an established capability. Under Verification, state the observed results for the changed behavior, for example the number of passing tests and the Max Mode behavior checked. State what was not verified, such as live Cursor catalog and Max Mode interaction. Confirm that the agent model and harness line matches the template requirement.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 67d9fda and c28316e.

Files selected for processing: 1
  • packages/provider-cursor/src/server/driver.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@Huijiro
Huijiro force-pushed the t3/cursor-optional-max-mode branch from b634f7c to c95c1a6 Compare October 31, 2026 18:15
@maria-rcks

maria-rcks commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

Merged current main into the existing head without conflicts and pushed the merge commit. No additional feature changes.

Verified the contributor's default-parameter Max Mode fix with its existing regression assertion and resolved that review thread. All 44 focused Cursor tests pass. Blacksmith vp run check:changed github/main passes formatting, lint, knip, GraphQL generation checks, typechecks for 39 packages, and 46 tests. Two independent code reviews found no blocking issues.

Live Cursor catalog and Max Mode interaction remain unverified because this VM has no Cursor login. No synthetic catalog or UI evidence was substituted.

Final head: 90d5b00bc432b3e529b31bac8e0fef7c4bb3d211. All 28 GitCafe check contexts are green; GitHub reports CLEAN and MERGEABLE. CodeRabbit completed successfully with no actionable merge-blocking risk.

Huijiro and others added 3 commits November 3, 2026 13:35
Cache catalog models from the timed status probe, expose a Max Mode composer boolean when matching variants allow it, and set send maxMode only when forced or admitted by the selected params.

Co-authored-by: Cursor <cursoragent@cursor.com>
When the composer only toggles Max Mode, resolve the default variant's params so matching max-mode variants are admitted instead of requiring isDefault on every candidate.

Co-authored-by: Cursor <cursoragent@cursor.com>
checkCursorProviderStatus now returns { provider, sdkModels }; assert on the provider snapshot after main's auth cases landed beside the Max Mode catalog change.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Huijiro

Huijiro commented Nov 3, 2026

Copy link
Copy Markdown
Author

Rebased onto current main (cherry-picked the three Max Mode commits; dropped the ambient commit now on main). Conflicts were only stale package.json / workspace catalog noise — feature code applied cleanly. sdkModel / status tests pass locally (21).

@Huijiro
Huijiro force-pushed the t3/cursor-optional-max-mode branch from 90d5b00 to 67d9fda Compare November 3, 2026 16:37

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Additional comments: 1
packages/provider-cursor/src/server/driver.ts-272-273: 1

272-273: Major · Functional Correctness · Quick win

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Test Max Mode propagation through the driver.

Extend the existing catalog-refresh case in driver.test.ts with a Max-only variant. Assert that the model passed to the runner includes maxMode: true after refresh. The current helper and status tests would not catch a broken driver-to-adapter catalog connection.

As per coding guidelines, “Backend behavior changes ship with focused tests.”

Source: Coding guidelines

Review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 90d5b00 and 67d9fda.

Files selected for processing: 3
  • packages/provider-cursor/src/server/adapter.ts
  • packages/provider-cursor/src/server/driver.ts
  • packages/provider-cursor/src/server/status.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Huijiro

Huijiro commented Nov 3, 2026

Copy link
Copy Markdown
Author

Addressed CodeRabbit’s driver coverage note: the existing catalog-refresh case now uses a Max-only default variant and asserts maxMode: true on the model sent after refresh (and retained after a failed status probe).

@Huijiro

Huijiro commented Nov 3, 2026

Copy link
Copy Markdown
Author

CI on c28316e is stuck at action_required (fork workflow approval), not a real failure — I don't have rights to approve runs on pingdotgg/t3code. A maintainer click on Approve and run workflows will unblock the same checks that were green on 67d9fda.

This branch has not been deployed

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

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants