fix(google-antigravity): discoverAntigravityProject fails with missing_project when project is not auto-discovered, rejecting valid tokens
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- authentication, backend
Research direction
Start with src/oauth/account-import/google-antigravity-adapter.ts and the discoverAntigravityProject implementation referenced in the issue. Trace how discovery handles loadCodeAssist and onboardUser, then inspect the account import and OAuth parameter paths. Done means valid credentials are accepted when discovery returns no project and the issue’s aicode-consumers scenario works; linked pull request #7385 indicates work is already underway.
Written by the indexing model from the issue text.
Description
Client or integration
- OpenCodex dashboard
- Direct HTTP/API client
Area
- Authentication and account pool
- Provider adapter
Version
2.83.0 (commit 33b321853aff76045617824793cc7cbc1d4084e7)
Operating system
Linux (Ubuntu 26.04 LTS / Docker)
Provider and model
google-antigravity
Summary
During Google Antigravity OAuth or account import (createAntigravityAccountImportAdapter), OpenCodex mandates discovery of a Cloud Code Assist projectId via discoverAntigravityProject:
const projectId = await discoverAntigravityProject(creds.access, this.ctrl.signal);
if (!projectId) {
throw new Error("Antigravity login could not discover a Cloud Code Assist project for this account. Ensure the account has Antigravity/Cloud Code Assist access and try again.");
}
In src/oauth/account-import/google-antigravity-adapter.ts:
if (typeof credential.projectId !== "string" || credential.projectId.length === 0) {
return { status: "failed", code: "missing_project" };
}
If Google's loadCodeAssist or onboardUser endpoints do not return a project identifier matching the parser's specific expectations (e.g. accounts with existing consumer tiers or established aicode-consumers project mapping), discoverAntigravityProject returns undefined.
As a result, OpenCodex rejects the entire authentication attempt (code: missing_project) and discards the valid refresh token, even though the token works properly when configured with the standard Antigravity project (aicode-consumers).
Reproduction
- Attempt an OAuth login or cockpit import (
POST /api/oauth/accounts/import) for a Google account whoseloadCodeAssistAPI response does not populatecloudaicompanionProjector matches consumer project configurations. - The authorization exchange succeeds and issues valid
access_tokenandrefresh_token. discoverAntigravityProjectrunsloadCodeAssist-> fails/returns no recognized key, then runsonboardUser-> returns undefined.- The import/login fails with
missing_project/credential_rejected. - If the same refresh token is persisted in
auth.jsonwith"projectId": "aicode-consumers", requests to/v1/chat/completions(e.g.gemini-3.8-flash) succeed with HTTP 200.
Expected behaviour
discoverAntigravityProjectshould fall back to a standard default project ID (such asaicode-consumers) if discovery endpoints do not return an explicit enterprise project.- The account import payload (
CockpitAccountRecord) and manual OAuth parameters should allow an optionalproject_idoverride so accounts are not rejected outright when discovery fails. - A failed discovery should not discard otherwise valid OAuth credentials.
Checks
- I searched existing issues and documentation.
- I removed secrets, tokens, account details, request credentials, and personal data.
- Dominant language
- TypeScript
- Stars
- 16.9k
- Forks
- 1.3k
- Avg merge
- 7h 34m
- Merged PRs (30d)
- 667
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lidge-jun/opencodex
-
Transient OAuth login failure persists in getLoginStatus and masks active account in dashboardPossibly taken A pull request linked to this issue is open or already merged. Openaccount-pool bug gui
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
lidge-jun/opencodex#7378 · 2 comments ·
Maintainers usually reply within 1 day
-
account-pool enhancement needs-design proxy
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
lidge-jun/opencodex#6737 · 1 comment ·
Maintainers usually reply within 1 day
-
account-pool bug needs-design provider proxy
Difficulty 4/5 3-5 days Newbie friendliness 42/100
lidge-jun/opencodex#7380 · 3 comments ·
Maintainers usually reply within 1 day
-
[Bug] 2.88.0: opted-in pool account leaves rotation 5 min after its last credit read once its 5h window is full; requests fall to the hard-locked main accountPossibly taken A pull request linked to this issue is open or already merged. Openaccount-pool bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
lidge-jun/opencodex#7377 · 2 comments ·
Maintainers usually reply within 1 day
-
[Bug] OpenCodex 2.88.0: existing threads fail after model/provider switching when encrypted reasoning is rejected inside HTTP 200 SSEPossibly taken A pull request linked to this issue is open or already merged. Openbug proxy streaming tools
Difficulty 5/5 Over a week Newbie friendliness 35/100
lidge-jun/opencodex#7369 · 2 comments ·
Maintainers usually reply within 1 day
All issues in lidge-jun/opencodex
Similar issues
-
docs(api): openapi.yaml still documents gif-tools optimize colors as 2-256 instead of 2, 4, 16, 256Openarea: backend documentation priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
snapotter-hq/SnapOtter#2919 ·
Maintainers usually reply within 1 day
-
accepted :+1: bug db/redis
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
beekeeper-studio/beekeeper-studio#4882 · 1 comment ·
Maintainers usually reply within 1 day
-
ready-for-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
konflux-ci/konflux-ui#1630 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
ahmedkhaleel2004/gitdiagram#233 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
simkimsia/netlify-axi#19 ·
Maintainers usually reply within 1 day