-
Notifications
You must be signed in to change notification settings - Fork 865
[WRONG BRANCH] feat(cursor): live GetUsableModels.maxMode decode + OAuth poll fail-fast #2323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -126,6 +126,13 @@ export async function pollCursorAuth( | |
| delay = Math.min(delay * POLL_BACKOFF, POLL_MAX_DELAY_MS); | ||
| continue; | ||
| } | ||
| // T07 (senpi #905): definitive rejections fail fast. 404 is "not approved yet"; | ||
| // 400/401/403/410 are terminal and must not burn the transient-error budget. | ||
| if (response.status === 400 || response.status === 401 || response.status === 403 || response.status === 410) { | ||
| throw new Error(`Cursor auth login rejected (HTTP ${response.status})`); | ||
|
Comment on lines
+131
to
+132
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For a 400, 401, 403, or 410 response, this new error is thrown inside the surrounding AGENTS.md reference: src/AGENTS.md:L24-L26 Useful? React with 👍 / 👎. |
||
| } | ||
| // 429 keeps polling; the backoff already slows down. | ||
| if (response.status === 429) continue; | ||
|
Comment on lines
+134
to
+135
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When the poll endpoint returns 429, this direct AGENTS.md reference: src/AGENTS.md:L24-L26 Useful? React with 👍 / 👎. |
||
|
|
||
| if (response.ok) { | ||
| const data = (await response.json()) as { accessToken?: string; refreshToken?: string }; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
GetUsableModelsmarks a model withmaxMode=true, this new set exists only in the fetch result:src/codex/catalog/provider-fetch.ts:1226-1236reads onlymodelsand caches catalog rows without the capability, whilesrc/adapters/cursor/protobuf-request.ts:964-969still always writesmaxMode: false. Consequently T06 never changes an outbound request, including requests for max-mode/1M-window models; carry this metadata through the canonical catalog and request derivation and verify that a decodedtruereachesRequestedModel.AGENTS.md reference: src/AGENTS.md:L18-L18
Useful? React with 👍 / 👎.