Skip to content

fix(cursor): send Grok 4.5 Fast parameters - #881

Closed
jbaehova wants to merge 3 commits into
lidge-jun:devfrom
jbaehova:fix/cursor-grok-fast-parameters
Closed

fix(cursor): send Grok 4.5 Fast parameters#881
jbaehova wants to merge 3 commits into
lidge-jun:devfrom
jbaehova:fix/cursor-grok-fast-parameters

Conversation

@jbaehova

@jbaehova jbaehova commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • keep cursor/grok-4.5-fast as the Codex-facing selector, but send Cursor's canonical grok-4.5 model with separate effort and fast=true parameters
  • encode parameterized external-model selections through AgentRunRequest.requested_model without also sending the conflicting legacy model_details
  • retain current and legacy flattened Fast slugs strictly as live-discovery evidence, with focused request-builder/protobuf coverage and synchronized transport docs

Why

This is a corrective follow-up to my earlier PR #797, which added cursor/grok-4.5-fast support and was included in OpenCodex 2.9.1. After the release, I tested the model through OpenCodex and found that the Fast selector was visible but every request returned 502, while cursor/grok-4.5 continued to work. The earlier PR correctly fixed discovery, but it also assumed Cursor accepted the flattened grok-4.5-{effort}-fast id as the outgoing model selection. This PR corrects that request-side assumption.

Current Cursor clients represent this selection as base model grok-4.5 plus model parameters (effort=<tier>, fast=true). Cursor's generated protobuf already exposes the same string-valued RequestedModel.parameters channel, and the current official SDK leaves legacy model_details unset when it sends a requested model. Using that contract also resolves the ordering concern raised in the automated review on #797: discovered flattened ids now gate availability only and no longer determine the outgoing request shape.

The working non-Fast Grok path remains unchanged and continues to use its existing flat effort id. Cursor Router behavior is also unchanged: its already-live model_details + requested_model(optimization) shape remains intact.

Protocol evidence

  • Cursor's official @cursor/sdk 1.0.24 models selections as { id, params }; its local runtime serializes that shape into RequestedModel.model_id and string-valued parameters.
  • Cursor staff's SDK example likewise separates a base model id from { id: "fast", value: "false" } instead of treating the resolved Fast slug as the request model id.
  • Cursor's current CLI help documents bracketed parameter overrides, including effort and fast; the live probes below verify the exact Grok 4.5 combination used by this patch.

User impact

Selecting cursor/grok-4.5-fast now reaches Cursor Grok 4.5 Fast instead of failing before generation. Low, medium, high, clamped xhigh, and omitted-effort selections all preserve their existing picker behavior; only the Cursor wire representation changes.

Verification

  • bun test tests/cursor-discovery.test.ts tests/cursor-effort-suffix.test.ts tests/cursor-blob.test.ts tests/cursor-request-builder.test.ts tests/cursor-adapter.test.ts — 111 passed
  • bun test tests/cursor-effort-suffix.test.ts tests/cursor-blob.test.ts — 61 passed after the final regression assertion
  • bun run prepush
  • cd docs-site && bun run build
  • git diff --check
  • official cursor-agent 2026.07.23-e383d2b live probe: --model 'grok-4.5[effort=high,fast=true]' completed with OK
  • patched OpenCodex live-transport probe using the existing Cursor OAuth account encoded grok-4.5 with effort=high,fast=true and completed with done / OK

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs were updated for the parameterized Grok Fast transport contract.
  • No authentication, credential storage, dependency, workflow, or release behavior changed; model parameter values are internal constants or validated effort tiers, and no token/request content was added to diagnostics.

Summary by CodeRabbit

  • New Features

    • Added stable support for selecting cursor/grok-4.5-fast.
    • Requests now preserve separate effort and fast-mode settings for accurate model routing.
  • Bug Fixes

    • Corrected request formatting so parameterized Grok Fast requests use the intended base model and settings.
  • Documentation

    • Updated Cursor model documentation with availability, routing, and parameter details across supported languages.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2757a8ff-0bd1-49a1-bcd0-bbf033ee6ba2

📥 Commits

Reviewing files that changed from the base of the PR and between cd43838 and 9718f3c.

📒 Files selected for processing (4)
  • docs-site/src/content/docs/ja/reference/adapters.md
  • docs-site/src/content/docs/ko/reference/adapters.md
  • docs-site/src/content/docs/ru/reference/adapters.md
  • docs-site/src/content/docs/zh-cn/reference/adapters.md

📝 Walkthrough

Walkthrough

Cursor Grok Fast routing now sends grok-4.5 with separate effort and fast=true parameters. Protobuf encoding places combined parameters in requestedModel and omits legacy modelDetails when explicit parameters exist. Tests and documentation reflect this behavior.

Changes

Cursor Grok Fast routing

Layer / File(s) Summary
Model contract and normalization
src/adapters/cursor/types.ts, src/adapters/cursor/request-builder.ts, src/adapters/cursor/effort-map.ts
CursorRunRequest now accepts requested-model parameters. normalizeCursorModelId maps Grok Fast to grok-4.5 with separate effort and fast=true values.
Protobuf request encoding
src/adapters/cursor/protobuf-request.ts
The encoder combines explicit and routing-level parameters. It emits the combined values in requestedModel and includes modelDetails only when explicit parameters are absent.
Validation and documentation
tests/cursor-effort-suffix.test.ts, tests/cursor-blob.test.ts, docs-site/src/content/docs/reference/adapters.md, docs-site/src/content/docs/*/reference/adapters.md, structure/04-transports-and-sidecars.md
Tests verify base-model selection, effort clamping, fast=true, and omission of modelDetails. Documentation describes parameterized routing and discovery-only flattened IDs.

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

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant createCursorRequest
  participant protobuf-request
  participant Cursor
  Caller->>createCursorRequest: select cursor/grok-4.5-fast
  createCursorRequest->>protobuf-request: pass grok-4.5 and requested parameters
  protobuf-request->>Cursor: send requestedModel with effort and fast=true
  protobuf-request->>Cursor: omit modelDetails when explicit parameters exist
Loading

Possibly related PRs

Suggested reviewers: lidge-jun, wibias, ingwannu

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: sending Grok 4.5 Fast parameters through Cursor.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the bug Something isn't working label Aug 2, 2026
@jbaehova
jbaehova marked this pull request as ready for review August 2, 2026 09:54

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs-site/src/content/docs/reference/adapters.md`:
- Around line 171-172: Update the translated Cursor adapter sections in the ja,
ko, ru, and zh-cn adapter reference documents to state that cursor/grok-4.5-fast
remains selectable while the request sends canonical grok-4.5 with separate
effort and fast=true parameters.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 672d6a48-7c92-4494-8597-435bd8f459a8

📥 Commits

Reviewing files that changed from the base of the PR and between f9b9440 and 415fe37.

📒 Files selected for processing (8)
  • docs-site/src/content/docs/reference/adapters.md
  • src/adapters/cursor/effort-map.ts
  • src/adapters/cursor/protobuf-request.ts
  • src/adapters/cursor/request-builder.ts
  • src/adapters/cursor/types.ts
  • structure/04_transports-and-sidecars.md
  • tests/cursor-blob.test.ts
  • tests/cursor-effort-suffix.test.ts

Comment thread docs-site/src/content/docs/reference/adapters.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs-site/src/content/docs/ja/reference/adapters.md`:
- Around line 107-108: Align the translated Cursor adapter documentation with
the wire contract by identifying requested_model.parameters as the container for
effort and fast=true in docs-site/src/content/docs/ja/reference/adapters.md
lines 107-108, docs-site/src/content/docs/ko/reference/adapters.md lines
126-127, docs-site/src/content/docs/ru/reference/adapters.md lines 137-138, and
docs-site/src/content/docs/zh-cn/reference/adapters.md lines 120-121; preserve
the existing localized wording while adding the localized equivalent of the
field name at each site.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c3c7f1c9-362a-4741-af6f-1574e4affd5c

📥 Commits

Reviewing files that changed from the base of the PR and between 415fe37 and cd43838.

📒 Files selected for processing (4)
  • docs-site/src/content/docs/ja/reference/adapters.md
  • docs-site/src/content/docs/ko/reference/adapters.md
  • docs-site/src/content/docs/ru/reference/adapters.md
  • docs-site/src/content/docs/zh-cn/reference/adapters.md

Comment thread docs-site/src/content/docs/ja/reference/adapters.md Outdated
@lidge-jun

Copy link
Copy Markdown
Owner

Landed in #892 as 0793edc + 05bb74f + ab6a1ed (authorship preserved). Adversarial review of the stacked branch found no issues in the requested_model path — the model_details/requested_model exclusivity and the discovery-gating were verified against the wt2 cursor blob/frame work. Closing as superseded; thanks for the corrective follow-up to #797.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants