Skip to content

[Bug]: Cursor 1M and 500K context tiers are ignored or rejected because the SDK request never sets Max Mode #15788

Description

@nkoynov

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

Cursor provider with an API key:

  1. Pick Cursor → Grok 4.7 and keep the default Context: 500K. Send Reply with exactly: pong.
  2. Pick Cursor → Claude Opus 5.5 and keep the default Context: 1M. Ask the agent to read about 450K tokens of files in full (for example six ~300 KB text files, one per read, no grep).

Expected behavior

Each thread gets the context window it shows, the same as Cursor's own CLI with the same selection (cursor-agent --model 'claude-opus-5-5[context=1m,effort=high,fast=true]', which reports "Claude Opus 5.5 1M High Fast" and a 1,000,000-token window).

Actual behavior

  • Grok 4.7 at 500K: every turn fails with "Provider turn failed.". The SDK run error is AI Model Not Found Invalid parameters for registry model: "grok-4.7". The same thread at 256K works.
  • Opus 5.5 (and GPT-5.6 Sol, and every other model whose default context is 1M) quietly runs on the standard window. Cursor's conversation checkpoint records a 300,000-token limit for Opus (272,000 for GPT-5.6 Sol), and the agent auto-compacts once the context passes it. With the same files, Cursor's CLI, Claude Code and OpenCode's Cursor plugin keep everything verbatim; the CLI reaches 852K of 1M.

Cause: Cursor serves the long-context tiers (1M, Grok's 500K) only in Max Mode, a flag on the request's RequestedModel. Cursor's CLI sets it when the chosen variant needs it, and so does the OpenCode Cursor plugin. @cursor/sdk never sets it: its local runtime builds the request as { modelId, parameters }, and its public ModelSelection ({ id, params }) has no field for it. Neither 1.0.31 (bundled) nor the latest 1.0.35 does, and adding maxMode, max_mode or max as a parameter changes nothing. Forcing maxMode on the SDK's request object in-process turns the same Opus run into a 1,000,000-token window, so the flag is all that's missing.

Cursor's own catalog makes the long tier the default variant for almost every model, so most Cursor threads in T3 are affected unless the user picks the short window.

Impact

Major degradation or frequent failure

Version or commit

nightly 0.0.46-nightly.20261004.2648; main @ efecd3c. @cursor/sdk 1.0.31 (also checked 1.0.35).

Environment

Linux (NixOS), T3 server headless; Cursor provider with CURSOR_API_KEY. Compared against Cursor CLI 2026.10.01-e373342.

Logs or stack traces

# SDK run, grok-4.7 with context=500k
{"status":"error","error":{"message":"AI Model Not Found Invalid parameters for registry model: \"grok-4.7\""},"model":{"id":"grok-4.7","params":[{"id":"context","value":"500k"},{"id":"reasoning_effort","value":"high"},{"id":"fast","value":"true"}]}}

# Cursor conversation checkpoint (tokens used, limit), claude-opus-5-5 with context=1m
@cursor/sdk run:  (391206, 300000) after compaction notices
Cursor CLI run:   (852564, 1000000)

Workaround

Use the short context tier (Opus 300K, Grok 256K), or run Cursor's CLI with the bracket model id for long-context work.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions