restore prime inference browser login and fix cancel shortcut labels - #142
Conversation
ENG-4057 No Prime Inference flow for login
Seems like with our earlier fix where api key providers are only API keys and not login flows, Prime Inference now only has an API key flow (where you enter an API key). The old flow where it opens your browser and automatically generates a key seems to be missing when I select Prime Inference in /login providers. That flow was much easier and far more convenient. Can you reintroduce that flow for Prime Inference, either by making an exception to the api key provider flow for Prime Inference, or considering Prime Inference a subscription rather than API key. Another small bug in the API key flow, "esc" no longer exits the API key entering popup, only Ctrl+C does, so update the label to match that. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a67a46f. Configure here.
| // so an aborted browser flow can never surface as an unhandled rejection. | ||
| browserLogin.catch(() => {}); | ||
|
|
||
| const result = await Promise.race([browserLogin, manualKeyEntry]); |
There was a problem hiding this comment.
Manual key UI after challenge
Medium Severity
Manual API key entry is wired only inside the onAuth callback, so if loginPrimeInference fails before the browser challenge is created (for example challenge HTTP errors or malformed responses), Promise.race rejects and the dialog closes without ever showing the paste-key fallback that the removed API-key-only login dialog always offered.
Reviewed by Cursor Bugbot for commit a67a46f. Configure here.
…rimeIntellect-ai#142) * restore prime inference browser login with manual key fallback * keep aborted browser login rejection explicitly handled


Note
Medium Risk
Touches credential storage and auth flow for Prime Inference with concurrent browser/manual paths; UI hint change is low risk but login regression could block provider setup.
Overview
Restores Prime Inference
/loginto a browser sign-in flow while keeping a manual API-key paste path in the same dialog. The interactive mode now racesloginPrimeInferenceagainst manual input (with a separate abort controller so pasting a key stops browser polling without closing the dialog), validates pasted keys viacheckPrimeInferenceAccess, and finishes through a sharedcompletePrimeInferenceLoginhelper—replacing the standaloneshowPrimeInferenceApiKeyLoginDialogpath.Login dialog refactors input waiting into
waitForInput(), reused byshowManualInputandshowPrompt, so empty submissions can re-arm input for the fallback flow.Keybinding hints on macOS now show
Ctrlfor control shortcuts (terminals send Control, not Cmd) whileAltstill displays as Option. Tests cover hint formatting, cancel keys, and re-arming manual input.Reviewed by Cursor Bugbot for commit a67a46f. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Restore Prime Inference browser login and fix
Ctrlkeybinding labels on macOSshowPrimeInferenceLoginDialoginstead of the removedshowPrimeInferenceApiKeyLoginDialog.completePrimeInferenceLoginhelper.keybinding-hints.tsto displayCtrlinstead ofCmdfor the Control modifier (terminals send a literal Control key, not Command).waitForInput()method onLoginDialogComponentso callers can await re-submission of the existing input field without re-rendering it.Macroscope summarized a67a46f.