Skip to content

fix(cursor): preserve Grok wire model prefix - #1159

Closed
jonathanli12 wants to merge 2 commits into
lidge-jun:devfrom
jonathanli12:codex/fix-cursor-grok-wire-prefix
Closed

fix(cursor): preserve Grok wire model prefix#1159
jonathanli12 wants to merge 2 commits into
lidge-jun:devfrom
jonathanli12:codex/fix-cursor-grok-wire-prefix

Conversation

@jonathanli12

@jonathanli12 jonathanli12 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve Cursor's required cursor- prefix for regular Grok 4.5 outbound wire IDs
  • keep discovery matching on canonical prefix-free IDs
  • add low, medium, and high coverage plus a discovery-to-request invariant

Validation

  • focused Cursor tests: 46 passed
  • typecheck: passed
  • privacy scan: passed
  • full suite: 9,457 passed, 8 skipped, one unrelated timeout; isolated rerun passed 20 tests
  • git diff check: passed

Summary by CodeRabbit

  • Bug Fixes

    • Corrected Cursor Grok 4.5 request identifiers for low, medium, and high effort levels.
    • Preserved the expected request format for Grok 4.5 Fast, including its separate effort and fast parameters.
    • Improved compatibility with live model discovery identifiers across supported effort levels.
  • Documentation

    • Clarified the different model ID and effort parameter formats used by regular and fast Grok 4.5 tiers.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • All CI tests are green on my local testing.

  • I pushed my PR to the latest dev commit.

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Cursor now sends cursor--prefixed effort IDs for regular Grok 4.5 requests. The request builder uses a dedicated mapping helper. Tests verify low, medium, and high IDs against recorded discovery data. Documentation distinguishes regular and fast Grok 4.5 behavior.

Changes

Cursor Grok 4.5 effort ID handling

Layer / File(s) Summary
Effort-qualified request ID mapping
src/adapters/cursor/effort-map.ts, src/adapters/cursor/request-builder.ts
cursorRequestWireModelIdWithEffort prefixes regular grok-4.5 effort IDs with cursor-. The request builder imports and calls the new helper.
Discovery ID validation and documentation
tests/cursor-effort-suffix.test.ts, docs-site/src/content/docs/reference/adapters.md
Tests cover low, medium, and high discovery IDs. Documentation describes prefixed regular IDs and separate fast-model parameters.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: bug

Suggested reviewers: lidge-jun, wibias, ingwannu

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preserving the Cursor wire model prefix for Grok requests.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@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.

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 `@tests/cursor-effort-suffix.test.ts`:
- Around line 122-136: The test named “regular grok-4.5 requests exactly match
live prefixed discovery ids” uses hard-coded values rather than discovery data
and cannot validate the exact wire ID. Rename it as a static mapping test, or
replace liveIds with a clearly sourced discovery/recorded fixture and assert the
discovery-to-request invariant separately from isCursorModelAvailableForAccount.
🪄 Autofix

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: adea0bce-25ed-44f9-8a8b-44d0ca59bcf7

📥 Commits

Reviewing files that changed from the base of the PR and between b39eecf and bb0aa9d.

📒 Files selected for processing (4)
  • docs-site/src/content/docs/reference/adapters.md
  • src/adapters/cursor/effort-map.ts
  • src/adapters/cursor/request-builder.ts
  • tests/cursor-effort-suffix.test.ts

Comment thread tests/cursor-effort-suffix.test.ts Outdated
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • review readiness checklist open (0/4 boxes ticked).

What to do

  • Tick all four boxes in the PR description once you're done (currently 0/4).

Review readiness checklist

  • ⬜ All CI tests are green on my local testing.
  • ⬜ I pushed my PR to the latest dev commit.
  • ⬜ I resolved all correct Codex and CodeRabbit findings.
  • ⬜ My PR is ready for review.

0/4 boxes ticked.

This PR stays in draft until every box above is ticked.

@github-actions
github-actions Bot marked this pull request as draft August 6, 2026 23:15
@github-actions github-actions Bot added the bug Something isn't working label Aug 6, 2026
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@lidge-jun

Copy link
Copy Markdown
Owner

Closing in favor of #1208, which adopts this change as-is.

To be clear about why: this PR needed no changes. It was independently re-audited against current dev and confirmed correct — the request-only helper is the right seam, discovery normalization is properly left alone, and Grok Fast keeps its parameterized form. We are rebuilding it on our stack per the sequential-PR convention, not because anything was wrong with it. You are credited in the commit.

Worth saying plainly: this sat unmergeable because 524 workflow runs were queued awaiting maintainer approval, 39 of them on open-PR branches including this one. The readiness gate verifies the ci check, and a run that was never allowed to start has no result to verify — so this could not leave draft regardless of what you did. That was our backlog, not your PR.

Two notes carried into #1208: the fixture pins against recorded discovery output rather than live Cursor state, so it catches mapper drift but not a future rename without a manual refresh; and the change prefixes only regular Grok 4.5, so it does not address #1162.

Thanks — this was a clean fix.

@lidge-jun lidge-jun closed this Aug 7, 2026
lidge-jun added a commit that referenced this pull request Aug 7, 2026
Adopted from PR #1159 by @jonathanli12, rebuilt on the current stack. Original
closed in favor of this commit.

Discovery normalizes Cursor's optional `cursor-` prefix so catalog matching can
compare canonical ids. Requests then inherited that prefix-free form, so regular
Grok 4.5 went out as `grok-4.5-{tier}` when Cursor's live discovery advertises
`cursor-grok-4.5-{tier}`.

The fix keeps the two paths separate rather than changing normalization:
`cursorRequestWireModelIdWithEffort` composes the request-side id and leaves
`cursorWireModelIdWithEffort` alone for discovery. Touching normalization would
have fixed the request and broken catalog matching in the same edit.

Grok Fast is untouched: it keeps the canonical `grok-4.5` model id with
`effort` and `fast=true` as separate parameters.

Scope note: only regular Grok 4.5 gets the prefix. This does not change
Claude-family ids, and it does not address #1162 (Cursor Claude-family
resource_exhausted), which has no code-level cause identified yet.

Both tests confirmed to fail with the request-builder change reverted.
iF2007 pushed a commit to iF2007/opencodex that referenced this pull request Aug 7, 2026
…un#1159)

Adopted from PR lidge-jun#1159 by @jonathanli12, rebuilt on the current stack. Original
closed in favor of this commit.

Discovery normalizes Cursor's optional `cursor-` prefix so catalog matching can
compare canonical ids. Requests then inherited that prefix-free form, so regular
Grok 4.5 went out as `grok-4.5-{tier}` when Cursor's live discovery advertises
`cursor-grok-4.5-{tier}`.

The fix keeps the two paths separate rather than changing normalization:
`cursorRequestWireModelIdWithEffort` composes the request-side id and leaves
`cursorWireModelIdWithEffort` alone for discovery. Touching normalization would
have fixed the request and broken catalog matching in the same edit.

Grok Fast is untouched: it keeps the canonical `grok-4.5` model id with
`effort` and `fast=true` as separate parameters.

Scope note: only regular Grok 4.5 gets the prefix. This does not change
Claude-family ids, and it does not address lidge-jun#1162 (Cursor Claude-family
resource_exhausted), which has no code-level cause identified yet.

Both tests confirmed to fail with the request-builder change reverted.
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