jcode icon indicating copy to clipboard operation
jcode copied to clipboard

Gemini OAuth succeeds but individual accounts fail at inference after Code Assist client retirement

Open ianalitis opened this issue 3 months ago • 2 comments

Summary

Regular gemini OAuth completes successfully in Jcode and the token refreshes, but Gemini inference is unusable for an individual free Google account. The first provider request fails with Google's message that this OAuth client is no longer supported for Gemini Code Assist for individuals.

This is not a stale authorization URL or a broken custom OAuth client override. The current Jcode-generated login completed, and no GEMINI_CLIENT_ID or GEMINI_CLIENT_SECRET override was present.

Environment

  • Jcode: v0.81.5-dev (422da2bc0)
  • macOS: 26.6.2, arm64
  • Google account tier: individual/free
  • Intended provider: gemini, not antigravity, gemini-api, or the Gmail google provider

Reproduction

  1. Ensure no custom GEMINI_CLIENT_ID or GEMINI_CLIENT_SECRET is set.

  2. Run:

    jcode login --provider gemini --no-browser
    
  3. Complete the newly generated OAuth flow.

  4. Run:

    jcode auth-test --provider gemini --no-update
    

Actual behavior

Credential loading and refresh pass, but the provider smoke request fails:

✓ credential_probe: Loaded Gemini tokens.
✓ refresh_probe: Gemini token load/refresh succeeded.
✗ provider_smoke: gemini provider smoke prompt failed: This client is no longer supported for Gemini Code Assist for individuals. To continue using Gemini, please migrate to the Antigravity suite of products: https://antigravity.google
result: FAIL

jcode auth status consequently has a confusing split state: the Gemini credential is shown as available/authenticated while runtime validation has failed. Repeating OAuth does not change the result.

Expected behavior

One of the following should be true:

  1. The regular gemini provider uses a currently supported Google OAuth client and inference works for the documented account types.
  2. If Google no longer permits this path for individual accounts, Jcode should detect the exact rejection and mark the provider as configured but unusable, with an actionable compatibility message.

A successful OAuth exchange alone should not imply that Gemini is an available routing candidate.

Why this matters

The Google response directs users toward Antigravity, but Antigravity is a distinct provider and account/product path. Automatically treating that response as a successful migration path can mislead users who intended regular Gemini OAuth or who only have a free consumer account.

This also affects model routing. A credential-presence check can leave Gemini appearing eligible even though every real request will fail.

Suggested acceptance criteria

  • Add a regression fixture for the exact Google rejection message.
  • Classify this as an account/client compatibility failure rather than a generic authentication failure.
  • Ensure provider status and routing distinguish credential available from runtime usable.
  • Do not recommend repeated reauthentication for this response.
  • Document which Google account/product tiers the regular gemini provider currently supports.

Related but distinct: #968 covers OAuth/API-key status conflation. This report concerns valid regular OAuth credentials that fail at runtime because Google rejects the client for individual accounts.

ianalitis avatar Aug 30 '26 17:08 ianalitis

A patch is now prepared locally and independently reviewed. It is not pushed yet.

The fix:

  • classifies Google's exact permanent individual-account compatibility failure,
  • keeps credential status available for explicit diagnostics,
  • removes failed Gemini OAuth from the complete automatic MultiProvider route set,
  • prevents the supplemental auto-discovery path from re-enabling it,
  • keeps the block after validation staleness until an affirmative successful validation replaces the failure,
  • preserves the Gemini Developer API-key path and explicit --provider gemini selection,
  • gives auth doctor actionable guidance without recommending reauthentication,
  • documents the gemini-api alternative.

Validation completed:

  • red-to-green regressions for doctor guidance, persistent auto-routing exclusion, supplemental detection, full Auto route registration, API-key bypass, provider scoping, and successful recovery,
  • cargo check -p jcode-base --lib,
  • cargo check --lib,
  • cargo fmt --all -- --check,
  • git diff --check,
  • independent final diff review: no material blocker.

The broad jcode-base test run reached 1,318 passes and 17 unrelated existing environment/fixture/catalog failures. Those failures were not suppressed. I will link the commit/PR once publishing the branch is authorized.

ianalitis avatar Aug 30 '26 19:08 ianalitis

The final validated branch is now pushed:

  • Head: ianalitis:jcode/fix-gemini-individual-oauth-status
  • Latest commit: c8b2ec774
  • Compare / PR form: https://github.com/1jehuang/jcode/compare/master...ianalitis:jcode:jcode/fix-gemini-individual-oauth-status?expand=1

Additional full-path gaps found during validation are included:

  • default MultiProvider::new/new_fast construction now filters the permanent compatibility failure,
  • explicit CLI/environment Gemini startup remains available for diagnostics,
  • auth refresh and fresh-session forks keep the same routing decision,
  • auth-test --no-smoke cannot replace a persisted runtime failure with credential-only success,
  • forced OAuth cannot be bypassed by an API key in construction, status, runtime, or auth-test.

Focused regressions, all-target/all-feature compilation, affected-package Clippy, and a real structured auth-test binary smoke passed. The broad jcode-base run reached 1,318 passes with 17 unrelated existing failures and 2 ignored; no failures or ratchets were suppressed.

ianalitis avatar Aug 31 '26 05:08 ianalitis