Repository navigation
fix(admin): let the Cursor worker API key be replaced or removed - #264
Merged
Merged
Conversation
Once a key was stored, the main "Réinstaller le worker Cursor" modal no longer showed a key field, and the only way to change it was a field in "Avancé" whose tile said everything was automatic. A wrong key (e.g. an xAI key) was accepted by the server and the refusal by Cursor was only visible in the logs, with the tile showing a plain "Arrêté". - Install modal always shows one masked "Clé API Cursor" field: the stored key is only shown as a masked placeholder, a typed value replaces it, empty keeps it. Required when no key is stored or when Cursor refused the current one. - When Cursor refused the key (worker logs), status returns key_invalid: the worker tile shows "Clé KO", the modal opens with the key field and a hint (cursor.com/dashboard → API Keys, not xAI); a failed install offers "Réessayer avec cette clé". - Advanced modal: replace the key, or delete it (with confirmation). - Server and UI reject obvious non-Cursor keys (xai-, sk-, sk-ant-, gsk_, AIza, ghp_, hf_…) with a clear message; install refuses to restart with a stored foreign key. - status/settings expose env_key_present (boolean only): the UI explains that a key saved in DevForge takes precedence over CURSOR_API_KEY. - Changing the key clears the stopped worker's old logs so the old "invalid key" error no longer shows. - Password manager autofill disabled on the key field (new-password).
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.
Bug (prod 2.0.260)
An xAI key was pasted by mistake. Cursor refused it (
worker.err: "The provided API key is invalid. The API key was loaded from the CURSOR_API_KEY environment variable.", which is the env var DevForge itself sets for the worker process). After that the tab gave no visible way to fix the key:xai-key, and the tile only showed "Arrêté", not "clé refusée";Fix
key_invalidis detected from the worker logs. The tile shows "Clé KO" and the Avancé tile says "Clé API refusée : la remplacer". The modal shows an alert plus the required key field with a hint (cursor.com/dashboard → API Keys, not xAI). A failed install with a refused key offers "Réessayer avec cette clé".xai-,sk-,sk-ant-,sk-or-,gsk_,AIza,ghp_,gho_,github_pat_,hf_) are rejected client-side and server-side. Install refuses to restart with a stored foreign key and asks for a Cursor key.CURSOR_API_KEY.env_key_present(boolean only) lets the UI explain this.autocomplete="new-password"so a password manager cannot fill the DevForge login password into it.Tests
cursorKeyProblem, andinstallNeeds/workerSummarywithkey_invalid.