Skip to content

[WRONG BRANCH] fix(cursor): accept trailing -fast Grok wire ids - #730

Closed
chasehuh wants to merge 1 commit into
lidge-jun:mainfrom
chasehuh:fix/cursor-grok-fast-suffix
Closed

[WRONG BRANCH] fix(cursor): accept trailing -fast Grok wire ids#730
chasehuh wants to merge 1 commit into
lidge-jun:mainfrom
chasehuh:fix/cursor-grok-fast-suffix

Conversation

@chasehuh

@chasehuh chasehuh commented Jul 30, 2026

Copy link
Copy Markdown

Summary

  • Accept Cursor's current Grok Fast wire shape {stem}-{effort}-fast in live discovery (keep older {stem}-fast-{effort} too).
  • Emit trailing--fast wire ids when resolving cursor/grok-4.5-fast + reasoning effort.
  • Add regression coverage from a live GetUsableModels snapshot.

Closes #731

Why

Cursor accounts with Grok Fast unlocked were still filtered out of the Codex catalog because OpenCodex expected grok-4.5-fast-high while upstream returns grok-4.5-high-fast.

Test plan

  • bun test tests/cursor-discovery.test.ts tests/cursor-effort-suffix.test.ts
  • bun run typecheck
  • Live protobuf snapshot: grok-4.5-fast availability flips to true; wire grok-4.5-high-fast present
  • Maintainer: smoke ocx sync on a Cursor account with Grok Fast and pick cursor/grok-4.5-fast

Summary by CodeRabbit

  • Bug Fixes

    • Improved Cursor model discovery for fast variants using alternate effort-tier naming.
    • Corrected model identifiers for reasoning-effort configurations, including grok-4.5-fast.
    • Prevented valid fast models from being incorrectly omitted when returned by Cursor.
  • Tests

    • Added coverage for supported and mismatched Cursor model identifier formats.
    • Updated expectations for effort-tier model identifiers.

Cursor GetUsableModels now returns grok-4.5-{effort}-fast instead of
grok-4.5-fast-{effort}, so live discovery dropped Fast and requests used
not_found wire ids. Match both shapes and emit the trailing-fast form.

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

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

⚠️ Wrong target branch

This pull request currently targets main, but pull requests must target one of dev or dev2-go.

@chasehuh Please retarget this PR to dev. Most contributions go to dev first; use dev2-go only for scoped Go native-port work. main receives only release promotions. See our Contributing guide for details. Thanks! 🙏

Its title has been prefixed with [WRONG BRANCH].

This pull request is being kept as a draft automatically. Once every issue above is resolved, it will be marked ready for review again.

@github-actions github-actions Bot changed the title fix(cursor): accept trailing -fast Grok wire ids [WRONG BRANCH] fix(cursor): accept trailing -fast Grok wire ids Jul 30, 2026
@github-actions github-actions Bot added the bug Something isn't working label Jul 30, 2026
@github-actions
github-actions Bot marked this pull request as draft July 30, 2026 03:42
@coderabbitai

coderabbitai Bot commented Jul 30, 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: a56e4f28-f2f1-48f0-951a-7e23c8199370

📥 Commits

Reviewing files that changed from the base of the PR and between d1f544b and 9677a8b.

📒 Files selected for processing (5)
  • src/adapters/cursor/discovery.ts
  • src/adapters/cursor/effort-map.ts
  • src/adapters/cursor/request-builder.ts
  • tests/cursor-discovery.test.ts
  • tests/cursor-effort-suffix.test.ts

📝 Walkthrough

Walkthrough

Cursor effort-tier handling now constructs trailing-fast wire IDs, uses that construction during request normalization, and recognizes the same format during live model discovery. Tests cover valid and invalid effort-tier ordering.

Changes

Cursor effort-tier wire IDs

Layer / File(s) Summary
Wire ID construction
src/adapters/cursor/effort-map.ts
Adds cursorWireModelIdWithEffort() and documents the current trailing-fast naming pattern for grok-4.5 variants.
Request normalization integration
src/adapters/cursor/request-builder.ts
Routes effort-qualified model IDs through the shared wire-ID helper.
Discovery matching and validation
src/adapters/cursor/discovery.ts, tests/cursor-discovery.test.ts, tests/cursor-effort-suffix.test.ts
Recognizes trailing-fast live IDs and verifies valid and mismatched effort-tier ordering.
Estimated code review effort: 3 (Moderate) ~20 minutes

Possibly related PRs

Suggested reviewers: ingwannu, lidge-jun, wibias

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: accepting trailing -fast Grok wire IDs in Cursor.
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.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@chasehuh

Copy link
Copy Markdown
Author

Closing for now — will reopen against dev with a proper issue template when ready.

@chasehuh chasehuh closed this Jul 30, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9677a8bbab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// Live GetUsableModels returns grok-4.5-{low,medium,high}-fast, not grok-4.5-fast-{effort}.
expect(modelIdFor("cursor/grok-4.5-fast", "medium")).toBe("grok-4.5-medium-fast");
expect(modelIdFor("cursor/grok-4.5-fast", "high")).toBe("grok-4.5-high-fast");
expect(modelIdFor("cursor/grok-4.5-fast", "xhigh")).toBe("grok-4.5-xhigh-fast");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Align Grok tiers with the current wire lineup

When cursor/grok-4.5-fast is requested with xhigh—or with no explicit effort, because cursorEffortSuffix selects the last configured tier—this expectation produces grok-4.5-xhigh-fast. The live lineup documented in this change contains only low, medium, and high, so that request targets an unavailable model; the stale tier map also clamps an explicit low request to medium and advertises xhigh in the picker. Update both Grok tier arrays to low/medium/high and cover low and the default mapping instead of accepting this nonexistent wire ID.

Useful? React with 👍 / 👎.

export function cursorWireModelIdWithEffort(baseModelId: string, effortSuffix: string): string {
if (baseModelId.endsWith("-fast")) {
const stem = baseModelId.slice(0, -"-fast".length);
return `${stem}-${effortSuffix}-fast`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the wire form accepted during discovery

When an account's GetUsableModels response contains only the retained legacy form such as grok-4.5-fast-medium, discovery still exposes cursor/grok-4.5-fast (as explicitly covered in tests/cursor-discovery.test.ts), but every subsequent request is unconditionally rewritten here to grok-4.5-medium-fast, which is not among that account's advertised usable IDs. Either stop treating legacy-only discovery results as available or retain which form was discovered and emit that form for requests, otherwise the compatibility path produces an exposed model that cannot be called.

Useful? React with 👍 / 👎.

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.

[Bug][Cursor] grok-4.5-fast dropped: live wire ids use trailing -fast after effort

1 participant