[WRONG BRANCH] fix(cursor): gate synthetic Ultra (1m) catalog rows on discovered Max Mode capability - #357
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 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. Comment |
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Its title has been prefixed with |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b6fbf39911
ℹ️ 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".
| const available = filterCursorConfiguredModelsByLiveDiscovery( | ||
| configured, | ||
| liveResult.models, | ||
| liveResult.maxModeModels ?? [], | ||
| ); |
There was a problem hiding this comment.
Preserve capability filtering when every configured row is rejected
When a Cursor provider explicitly configures only kimi-k3-1m and successful discovery returns a Kimi base model without any maxModeModels, this filter correctly produces an empty list, but the immediately following available.length > 0 ? available : configured restores and caches the unsupported synthetic row. The catalog therefore still advertises the 1M selector to accounts lacking the discovered capability; a successful nonempty discovery should remain authoritative even when no configured rows survive, rather than falling back to configured.
Useful? React with 👍 / 👎.
Motivation
maxModeModelscapability but the catalog filter admitted synthetic Ultra rows (e.g.kimi-k3-1m) whenever the base model was present, falsely advertising 1M/Max Mode when the account lacked Max Mode.Description
filterCursorConfiguredModelsByLiveDiscoverywith amaxModeLiveIdsparameter and checking it for Ultra entries insrc/adapters/cursor/discovery.ts.liveResult.maxModeModelsfrom discovery into the catalog filter call insrc/codex/catalog/provider-fetch.tsso the capability signal is consulted when discovery succeeds.tests/cursor-ultra-mode.test.tsthat assert the synthetickimi-k3-1mrow is included only when Max Mode is discovered and hidden when Max Mode is absent.Testing
bun test tests/cursor-ultra-mode.test.ts tests/cursor-discovery.test.ts tests/cursor-uncallable-quarantine.test.tsand observed all tests in those files passed (26 passed, 0 failed).bun run typecheckand the repository typecheck completed successfully.bun run testand validated the change; the overall run encountered two unrelated failures intests/lab-evidence-sanitization.test.tsthat are not caused by this patch and were observed during the full-suite run.git diff --checkand focused repository checks before committing the three modified files:src/adapters/cursor/discovery.ts,src/codex/catalog/provider-fetch.ts, andtests/cursor-ultra-mode.test.ts.Codex Task