Repository navigation
Turn on only the providers a new install finds - #89
poweruserz wants to merge 3 commits into
Conversation
A new install had Claude and Codex on for everyone, so users without them saw two "Not logged in" cards. It now starts with every provider off, probes each once and turns on those whose own login lookup found something. Copilot needs a Copilot plan, since its login is the GitHub CLI's. Settings are saved once everything is decided, so a start cut short detects again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KHc1HaoK4c5kUmgtCmKuwT
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b831b1d0b2
ℹ️ 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".
[Medium impact] The PR appears safe to merge, with a non-blocking Antigravity error-message issue.
|
Claude reviewCommit |
Other settings saves during detection (a WSL card, a toggle) made the next start look finished, so a flag now marks detection as pending until every provider is decided. Devin, Cursor and Kimi said "not logged in" for a login the server rejected, which detection reads as nothing set up; they now say the session expired. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KHc1HaoK4c5kUmgtCmKuwT
Antigravity said "Start Antigravity or run agy" for a saved login that was refused or couldn't be checked, which a new install reads as nothing set up. That message now means no login was found; a refused login says the session expired, and one that couldn't be checked says the quota data is unavailable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KHc1HaoK4c5kUmgtCmKuwT
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb8b66470d
ℹ️ 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".
| throw LOGIN_MESSAGE | ||
| // LOGIN_MESSAGE says no login was found; a saved one that was refused or couldn't be checked is the | ||
| // user's, and a new install shows its card (use-provider-detection.ts). | ||
| if (tokens.length === 0 && refreshTokens.length === 0 && !agy) throw LOGIN_MESSAGE |
There was a problem hiding this comment.
Count expired saved tokens as an existing Antigravity login
On a fresh install with an expired Antigravity SQLite access token and no refresh token, this condition incorrectly reports that no login exists. The loop above excludes expired access tokens from tokens, even though dbTokenCandidates still contains the saved credential. Reproduced by probing with that credential: it throws LOGIN_MESSAGE, so the new detector leaves Antigravity disabled and saves that decision instead of showing the expired-login card. Check whether credentials were found before filtering for usable tokens, and return the session-expired error for this case.
Useful? React with 👍 / 👎.
| // LOGIN_MESSAGE says no login was found; a saved one that was refused or couldn't be checked is the | ||
| // user's, and a new install shows its card (use-provider-detection.ts). | ||
| if (tokens.length === 0 && refreshTokens.length === 0 && !agy) throw LOGIN_MESSAGE | ||
| if (sawAuthFailure || ccResult || tokens.length === 0) throw "Session expired. Run `agy` to log in again." |
There was a problem hiding this comment.
Working login reported expired
When a saved access token has expired, a refresh can succeed but the following quota requests can return 5xx. The outer tokens array stays empty, so this check reports “Session expired” even though Google just renewed the login. Users are told to sign in again when they only need to retry later.
Track whether a login was actually rejected, and show the temporary-unavailable message when quota requests fail after a successful refresh.
Prompt To Fix With AI
This is a comment left during a code review.
Path: plugins/antigravity/plugin.js
Line: 1151
Comment:
**Working login reported expired**
When a saved access token has expired, a refresh can succeed but the following quota requests can return 5xx. The outer `tokens` array stays empty, so this check reports “Session expired” even though Google just renewed the login. Users are told to sign in again when they only need to retry later.
Track whether a login was actually rejected, and show the temporary-unavailable message when quota requests fail after a successful refresh.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
What
Until now a new install turned on Claude and Codex for everyone, so someone without them opened the app to two "Not logged in" cards.
A new install now starts with every provider off and probes each one once. A provider is turned on when its probe finds something:
"Nothing set up" means no login, no API key or not installed (
isNotSetUpErrorinsrc/lib/plugin-errors.ts). The detector is each plugin's own login lookup, the same code that fills its card, so no second list of paths has to be kept in step with the plugins.Copilot is the exception. It signs in with the GitHub CLI's login, which any GitHub user has, and what
copilot_internal/useranswers for an account without Copilot isn't documented. So Copilot turns on only when the answer carries a Copilot plan.Changes:
normalizePluginSettingsno longer keepsclaudeandcodexon (DEFAULT_ENABLED_PLUGINSis gone).use-provider-detection.tsprobes the given ids and turns on what was found. It decides each provider once, so a card the user turns off later stays off. A provider the user switches during detection is left to them.use-settings-bootstrap.tstherefore skips its usual first save on a new install.handlePluginsChangedreads the settings after itslist_pluginsawait, not before, and detection reads them from the store at the moment it writes. Before, a WSL card that arrived during detection (the detection batch itself starts the WSL rescan) could undo a provider detection had just turned on, or the other way round.local_http_api/cache.rs) treats nothing as on before the plugin settings are first saved, instead of Claude and Codex.Unchanged:
Left as is:
plugins/mock, which always returns data, so a fresh dev profile turns it on. Release builds don't ship it.Testing
plugins/not-set-up.test.js: with nothing set up, all 18 shipped plugins throw an error thatisNotSetUpErrorknows, and none makes a request. Removing one key from the list makes it fail (checked: Amp).use-provider-detection.test.ts:use-settings-plugin-actions.test.ts: a provider turned on whilelist_pluginsis pending stays on. The test fails when the read is moved back before the await.bunx tsc --noEmit: clean.bun run test: 1582 passed.cargo check: clean.cargo test --lib local_http_api: 27 passed.settings.jsonaside.🤖 Generated with Claude Code
https://claude.ai/code/session_01KHc1HaoK4c5kUmgtCmKuwT