Repository navigation
feat(admin): connect the Cursor worker without an API key (cursor-agent login) - #265
Merged
Merged
Conversation
…nt login)
New Cursor user API keys (grok_…) are not yet accepted by the self-hosted
worker's key validation (known Cursor bug: liveness 404 valid:false), and
the CLI reports "The provided API key is invalid". Cursor's documented
workaround is the CLI's browser login, which the worker supports for My
Machines ("Sign in with agent login, a personal user API key, or a
user-scoped token").
- POST /api/v1/cursor-worker/login: installs the CLI if needed, runs
`cursor-agent login` with NO_OPEN_BROWSER in the managed HOME and
returns the cursor.com login URL; clears the stored (refused) key.
GET /api/v1/cursor-worker/login: pending / logged_in.
- Worker start: API key if one is stored, otherwise the login session
(CURSOR_API_KEY removed from the environment, managed HOME). Install no
longer requires a key when logged in (this server only).
- Status: logged_in, auth (key/login/none), key_unsupported (grok_ key).
- UI: « Se connecter avec Cursor » in the install modal: opens the
Cursor login link, polls until validated, then installs without a key.
grok_ keys get a non-blocking warning pointing to the login.
- Prefer the `cursor-agent` binary over `agent` (name collision).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On prod 2.0.261 the NAS worker (cursor-agent 2026.10.19-6bbf2c4) rejects Mathieu's new Cursor key: "The provided API key is invalid". Cursor's dashboard now issues permission-based user keys with the
grok_prefix. These keys authenticate for/v1/meand local CLI runs, but the self-hosted worker's key validation does not recognise them yet:liveness endpoint returned 404: {"valid":false}. This is a known Cursor bug, acknowledged by Cursor staff on the forum on Oct 16, 2026 and still open. Updating the CLI does not help: 2026.10.19 is the current version.Cursor's recommended workaround is the CLI browser login.
cursor-agent worker --helpconfirms My Machines workers can "Sign in withagent login, a personal user API key, or a user-scoped token".Change
POST /api/v1/cursor-worker/logininstalls the CLI if missing, then startscursor-agent loginwithNO_OPEN_BROWSER=1in DevForge's managed HOME and returns thehttps://cursor.com/loginDeepControl?...URL. It also clears the stored (refused) key.GET /api/v1/cursor-worker/loginreportspending/logged_in(fromcursor-agent status).CURSOR_API_KEYis removed from the environment and the session lives in the persistent managed HOME. Install no longer requires a key when logged in (leader only).logged_in,auth(key / login / none) andkey_unsupported(storedgrok_key).grok_keys get a non-blocking warning; they are not rejected, in case Cursor fixes the bug.cursor-agentbinary is preferred overagent(known name collision).Tests
grok_flag,is_logged_inwith a fake CLI.installNeeds/workerSummarywithlogged_in,cursorKeyWarning.