Skip to content

fix(providers): remove google-antigravity OAuth provider + fix bare-alias hijack - #51413

Closed
infinitycrew39 wants to merge 2 commits into
NousResearch:mainfrom
infinitycrew39:fix/antigravity-provider-removal
Closed

fix(providers): remove google-antigravity OAuth provider + fix bare-alias hijack#51413
infinitycrew39 wants to merge 2 commits into
NousResearch:mainfrom
infinitycrew39:fix/antigravity-provider-removal

Conversation

@infinitycrew39

@infinitycrew39 infinitycrew39 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

🚨 Problem: 'gemini-3.1-pro-low is not a valid model ID' error

After a couple of messages, users running Hermes with google-antigravity OAuth provider get:

WARNING: Title generation failed: Error code: 400 - {'error': {'message': 'gemini-3.1-pro-low is not a valid model ID', ...}}

🔎 Root Cause

The google-antigravity OAuth provider re-exposes Claude/Gemini/GPT models from upstream vendors (when the account is entitled). Due to dict insertion order in model catalog resolution:

  1. User types -m gemini or Hermes picks a model name like gemini-3.1-pro-low
  2. detect_static_provider_for_model() checks provider catalogs in order
  3. google-antigravity catalog claims this alias before the native gemini provider (native vendor always wins for models)
  4. google-antigravity receives the request but doesn't actually support that model → 400 error

✅ Solution: Remove the Dangerous Provider Entirely

Why not just fix the alias hijack? Because Google actively bans accounts for using OAuth gemini/antigravity:

Fixing to make it work would expose users to account bans. Removal is the only safe path.

📋 Changes

Two commits:

  1. fix(antigravity): Move model flow + defer borrowed-model providers to last-resort matching (Commit 1)
  2. feat(providers): Remove both OAuth providers + all related auth/runtime/config wiring (Commit 2)

Files removed: ~5K lines (google_oauth.py, antigravity_oauth.py, gemini_cloudcode_adapter.py, tests, docs)

✨ What Still Works

API-key gemini provider (GOOGLE_API_KEY env var) → fully supported

  • This uses generativelanguage.googleapis.com directly
  • Not affected by Google's OAuth ban
  • Recommended for production use

OAuth providers (google-gemini-cli, google-antigravity) → removed

  • Banned by Google
  • Unsafe for production

Fixes

  • Resolves 'not a valid model ID' errors with google-antigravity
  • Prevents accounts from being banned by Google
  • Restores bare-alias resolution to native vendors (sonnet → anthropic, not antigravity)

teknium1 added 2 commits June 23, 2026 22:22
…ias hijack

CI on the salvage caught two issues the stale PR base masked:

1. The model-setup flows were extracted from main.py into
   hermes_cli/model_setup_flows.py after @pmos69 forked. The cherry-pick
   re-introduced a stale _model_flow_custom into main.py (duplicating the
   one main.py now imports) and put _model_flow_google_antigravity there too.
   Move the antigravity flow into model_setup_flows.py alongside its siblings
   and drop the stale _model_flow_custom dup. Fixes the getpass/stdin OSError
   in tests/cli/test_cli_provider_resolution.py.

2. google-antigravity re-exposes Claude/Gemini/GPT-OSS models, so its catalog
   was hijacking bare short aliases (`sonnet` -> google-antigravity instead of
   anthropic) in detect_static_provider_for_model via dict insertion order.
   Add _BORROWED_MODEL_PROVIDERS and defer those providers to a last-resort
   pass so a model's native vendor always wins alias/direct-catalog detection.
   Fixes tests/hermes_cli/test_models.py::test_short_alias_resolves_to_static_model.
…providers (NousResearch#50492)

* feat(providers): remove google-gemini-cli + google-antigravity OAuth providers

Google now actively bans accounts for third-party tools that piggyback on
Gemini CLI / Antigravity / Code Assist OAuth, and because abuse prevention
sits at a backend layer the ban can extend to the entire Google account
(Gmail/Drive), with a second violation being permanent.
Ref: google-gemini/gemini-cli#20632

Removes both OAuth inference providers entirely (modules, provider profiles,
auth/runtime/config/models wiring, the /gquota Code Assist quota command,
the antigravity-cli optional skill, desktop + docs surface in en + zh-Hans).
The API-key 'gemini' provider (GOOGLE_API_KEY/GEMINI_API_KEY against
generativelanguage.googleapis.com) is unaffected and stays fully supported.

* fix(skills): keep the antigravity-cli skill — only the OAuth provider is removed

The antigravity-cli optional skill orchestrates the external `agy` binary as
a coding-agent tool via the terminal tool — it does NOT wrap Hermes inference
through the banned google-antigravity OAuth provider, so it carries none of
the account-ban risk that motivated removing that provider. Restore the skill,
its docs page, the sidebar entry, and the optional-skills catalog row. The
google-antigravity / google-gemini-cli inference providers stay fully removed.
@alt-glitch alt-glitch added type/refactor Code restructuring, no behavior change comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard comp/plugins Plugin system and bundled plugins comp/desktop Electron desktop app (apps/desktop/*) area/auth Authentication, OAuth, credential pools provider/gemini Google Gemini (AI Studio, Cloud Code) P3 Low — cosmetic, nice to have duplicate This issue or pull request already exists labels Jun 23, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of merged #50492 — that PR (by core maintainer @teknium1) already removed the google-antigravity + google-gemini-cli OAuth providers entirely. Verified on main: agent/google_oauth.py, agent/gemini_cloudcode_adapter.py, and agent/google_code_assist.py are already absent and no antigravity references remain in agent/, hermes_cli/, or plugins/model-providers/. This PR's branch predates that merge (its diff removes files that no longer exist on main), so it is stale/redundant. The API-key Gemini provider is unaffected either way.

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

Verdict: Comment — High surface area (61 files, +161/-4954). Human review recommended.

This PR removes the google-gemini-cli OAuth provider and the entire gemini_cloudcode_adapter.py file (909 lines deleted). The removal is massive but appears to be a clean excision of unused/deprecated code.

Observations

  • The deleted adapter was a reverse-engineered OpenAI-compatible facade for Google's Cloud Code Assist backend
  • The PR also removes the provider routing in agent_init.py that directed google-gemini-cli to this adapter
  • No replacement is provided — this appears to be a deliberate removal of a deprecated path

Suggestions

  • Confirm that no active users depend on the google-gemini-cli provider before merge
  • Consider adding a migration note in release documentation

Reviewed by Hermes Agent

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for this — and for the thorough writeup on the account-ban risk, which is exactly the reasoning we landed on.

Both OAuth providers (google-antigravity and google-gemini-cli) were already removed on main in #50492 (merged Jun 22), so the substantive payload here (commit 95d3d681a) is redundant — current main no longer has google_oauth.py, gemini_cloudcode_adapter.py, google_code_assist.py, or any auth/runtime/config wiring for them. This PR was built against a base from just before #50492 landed, which is why the diff includes deleting files that are already gone.

Closing as superseded. If -m gemini / bare-alias resolution still misbehaves on current main after the provider removal, please open a fresh issue against today's main with a repro — we'll fix that on its own footing. Appreciate the contribution.

@teknium1 teknium1 closed this Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/auth Authentication, OAuth, credential pools comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard comp/desktop Electron desktop app (apps/desktop/*) comp/plugins Plugin system and bundled plugins duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have provider/gemini Google Gemini (AI Studio, Cloud Code) type/refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants