Agent Zero AI framework
Remove non-connectable OAuth plan metadata
Alessandro709f72b317b1
diff --git a/plugins/_oauth/README.md b/plugins/_oauth/README.mdindex c1308acd7..f8f8a4b3b 100644--- a/plugins/_oauth/README.md+++ b/plugins/_oauth/README.md@@ -33,15 +33,9 @@ Tokens in `auth.json` are password-equivalent credentials. Keep this plugin on t- Supports manual callback paste for remote hosts where the browser cannot reach the local callback directly.- Stores credentials under `usr/plugins/_oauth/xai_grok/auth.json`.-### Claude Code and Antigravity Product OAuth--Claude Code subscription OAuth and Antigravity product OAuth are intentionally metadata-only. They are product-specific login flows rather than third-party provider contracts for Agent Zero to route model traffic through.-## Usage Plan Metadata-The status API exposes `usage_plan_catalog` for subscription and billing context. It covers the implemented Codex, GitHub Copilot, Google Gemini API, and xAI providers, plus nearby Claude Code and Google Gemini / Antigravity plan families.--Google Gemini API OAuth is implemented through a user-provided Google Cloud OAuth client. Google Gemini / Antigravity subscription metadata remains separate because Antigravity and Gemini Code Assist product OAuth are not third-party model-provider contracts.+The status API exposes `usage_plan_catalog` for subscription and billing context. It covers only connectable providers: Codex, GitHub Copilot, Google Gemini API, and xAI Grok.## Remote xAI Callbackdiff --git a/plugins/_oauth/helpers/usage_plans.py b/plugins/_oauth/helpers/usage_plans.pyindex b3c3391cb..b2957f45a 100644--- a/plugins/_oauth/helpers/usage_plans.py+++ b/plugins/_oauth/helpers/usage_plans.py@@ -5,9 +5,7 @@ from typing import AnyCODEX_PROVIDER_ID = "codex_oauth"GITHUB_COPILOT_PROVIDER_ID = "github_copilot_oauth"-CLAUDE_CODE_PROVIDER_ID = "claude_code_oauth"GEMINI_API_PROVIDER_ID = "gemini_api_oauth"-GEMINI_CODE_ASSIST_PROVIDER_ID = "gemini_code_assist_oauth"XAI_GROK_PROVIDER_ID = "xai_grok_oauth"@@ -57,27 +55,6 @@ USAGE_PLAN_CATALOG: dict[str, dict[str, Any]] = {{"label": "GitHub Copilot plans", "url": "https://docs.github.com/en/copilot/get-started/plans"},],},- CLAUDE_CODE_PROVIDER_ID: {- "provider_id": CLAUDE_CODE_PROVIDER_ID,- "display_name": "Claude Code",- "implemented": False,- "plans": [- {"id": "pro", "label": "Pro", "billing": "Subscription", "usage": "Shared Claude and Claude Code usage limits."},- {"id": "max_5x", "label": "Max 5x", "billing": "Subscription", "usage": "Higher included usage than Pro."},- {"id": "max_20x", "label": "Max 20x", "billing": "Subscription", "usage": "Highest individual Claude Code subscription allocation."},- {"id": "team", "label": "Team", "billing": "Seat-based subscription", "usage": "Claude Code included with every Team seat; premium seats add more usage."},- {"id": "enterprise_premium", "label": "Enterprise Premium", "billing": "Seat-based subscription", "usage": "Enterprise seat type with Claude Code access."},- {"id": "enterprise_usage_based", "label": "Enterprise usage-based", "billing": "API-rate consumption", "usage": "Usage billed by consumption instead of per-seat caps."},- ],- "notes": [- "Claude subscription usage and Anthropic API-key billing are distinct systems.",- "An ANTHROPIC_API_KEY can make Claude Code use API billing instead of subscription allocation.",- ],- "sources": [- {"label": "Claude Code with Pro or Max", "url": "https://support.claude.com/en/articles/11145838-use-claude-code-with-your-pro-or-max-plan"},- {"label": "Claude Code with Team or Enterprise", "url": "https://support.claude.com/en/articles/11845131-use-claude-code-with-your-team-or-enterprise-plan"},- ],- },GEMINI_API_PROVIDER_ID: {"provider_id": GEMINI_API_PROVIDER_ID,"display_name": "Google Gemini API",@@ -98,51 +75,6 @@ USAGE_PLAN_CATALOG: dict[str, dict[str, Any]] = {{"label": "Gemini API billing", "url": "https://ai.google.dev/gemini-api/docs/billing"},],},- GEMINI_CODE_ASSIST_PROVIDER_ID: {- "provider_id": GEMINI_CODE_ASSIST_PROVIDER_ID,- "display_name": "Google Gemini / Antigravity",- "implemented": False,- "implementation_status": "metadata_only",- "plans": [- {"id": "individual", "label": "Antigravity Individual", "billing": "$0/month", "usage": "Baseline Antigravity quota, unlimited tab completions, and CLI access."},- {"id": "google_ai_pro", "label": "Google AI Pro", "billing": "Subscription", "usage": "More generous Antigravity rate limits and AI credit overages."},- {"id": "google_ai_ultra", "label": "Google AI Ultra", "billing": "Subscription", "usage": "Highest Antigravity quota, highest weekly limits, and third-party model access."},- {"id": "organization", "label": "Organization plan", "billing": "Google Cloud", "usage": "Gemini Enterprise Agent Platform access, Cloud project integration, and consumption pricing."},- {"id": "code_assist_standard", "label": "Gemini Code Assist Standard", "billing": "Google Cloud subscription", "usage": "Organization plan for code assistance, agent mode, and Gemini CLI quotas."},- {"id": "code_assist_enterprise", "label": "Gemini Code Assist Enterprise", "billing": "Google Cloud subscription", "usage": "Enterprise plan with customization and broader Google Cloud integrations."},- {"id": "gemini_api_oauth", "label": "Gemini API OAuth", "billing": "Google Cloud project", "usage": "Official third-party OAuth path with a user-provided Google Cloud OAuth client."},- ],- "provider_modes": [- {- "id": "gemini_api_oauth",- "label": "Gemini API OAuth",- "allowed": True,- "status": "implemented",- "note": "Implemented as the separate Google Gemini API OAuth provider. It requires a user-configured Google Cloud OAuth client and does not spend Antigravity or Google AI subscription quota.",- },- {- "id": "antigravity_subscription_oauth",- "label": "Antigravity subscription OAuth",- "allowed": False,- "status": "not_implemented",- "note": "Google Antigravity terms prohibit using third-party tools to access the Antigravity service through its OAuth flow.",- },- ],- "notes": [- "Official Gemini API OAuth requires a Google Cloud OAuth client and is separate from Google AI Pro, Google AI Ultra, Antigravity, Gemini Code Assist, and Gemini CLI quotas.",- "Antigravity and Gemini Code Assist subscription OAuth are metadata-only here because Google does not authorize third-party tools to access the service through those product OAuth flows.",- "Gemini CLI quotas are provided by Gemini Code Assist editions and shared with Code Assist agent mode; the CLI can also use a Gemini API key for pay-as-you-go usage.",- ],- "sources": [- {"label": "Google Antigravity terms", "url": "https://antigravity.google/terms"},- {"label": "Google Antigravity plans", "url": "https://antigravity.google/docs/plans?id=GoogleAntigravity"},- {"label": "Google Antigravity pricing", "url": "https://antigravity.google/pricing?app=antigravity"},- {"label": "Gemini Code Assist overview", "url": "https://developers.google.com/gemini-code-assist/docs/overview"},- {"label": "Gemini Code Assist quotas", "url": "https://developers.google.com/gemini-code-assist/resources/quotas"},- {"label": "Gemini CLI", "url": "https://developers.google.com/gemini-code-assist/docs/gemini-cli"},- {"label": "Gemini API OAuth", "url": "https://ai.google.dev/gemini-api/docs/oauth"},- ],- },XAI_GROK_PROVIDER_ID: {"provider_id": XAI_GROK_PROVIDER_ID,"display_name": "xAI Grok",diff --git a/tests/test_oauth_providers.py b/tests/test_oauth_providers.pyindex 3997342ff..27559bdb0 100644--- a/tests/test_oauth_providers.py+++ b/tests/test_oauth_providers.py@@ -75,11 +75,7 @@ from plugins._oauth.helpers.providers.base import (write_private_json,)from plugins._oauth.helpers.providers.registry import get_provider, provider_registry-from plugins._oauth.helpers.usage_plans import (- CLAUDE_CODE_PROVIDER_ID,- GEMINI_CODE_ASSIST_PROVIDER_ID,- usage_plan_catalog,-)+from plugins._oauth.helpers.usage_plans import usage_plan_catalogclass FakeRequest:@@ -341,8 +337,12 @@ def test_status_api_returns_provider_registry_shape(monkeypatch):GITHUB_COPILOT_PROVIDER_ID,GEMINI_API_PROVIDER_ID,XAI_GROK_PROVIDER_ID,- CLAUDE_CODE_PROVIDER_ID,- GEMINI_CODE_ASSIST_PROVIDER_ID,+ }+ assert set(response["usage_plan_catalog"]) == {+ CODEX_PROVIDER_ID,+ GITHUB_COPILOT_PROVIDER_ID,+ GEMINI_API_PROVIDER_ID,+ XAI_GROK_PROVIDER_ID,}assert response["codex"] == response["provider_map"][CODEX_PROVIDER_ID]@@ -698,9 +698,16 @@ def test_provider_metadata_marks_new_oauth_providers_as_oauth_api_key_mode():assert metadata["chat"][XAI_GROK_PROVIDER_ID]["api_key_mode"] == "oauth"-def test_usage_plan_catalog_covers_current_and_nearby_subscription_providers():+def test_usage_plan_catalog_covers_connectable_subscription_providers_only():catalog = usage_plan_catalog()+ assert set(catalog) == {+ CODEX_PROVIDER_ID,+ GITHUB_COPILOT_PROVIDER_ID,+ GEMINI_API_PROVIDER_ID,+ XAI_GROK_PROVIDER_ID,+ }+assert {plan["id"] for plan in catalog[CODEX_PROVIDER_ID]["plans"]} >= {"free","go",@@ -725,30 +732,6 @@ def test_usage_plan_catalog_covers_current_and_nearby_subscription_providers():"vertex_ai",}assert catalog[GEMINI_API_PROVIDER_ID]["implemented"] is True- assert {plan["id"] for plan in catalog[CLAUDE_CODE_PROVIDER_ID]["plans"]} >= {- "pro",- "max_5x",- "max_20x",- "team",- "enterprise_premium",- "enterprise_usage_based",- }- assert {plan["id"] for plan in catalog[GEMINI_CODE_ASSIST_PROVIDER_ID]["plans"]} >= {- "individual",- "google_ai_pro",- "google_ai_ultra",- "organization",- "code_assist_standard",- "code_assist_enterprise",- "gemini_api_oauth",- }- assert catalog[GEMINI_CODE_ASSIST_PROVIDER_ID]["implementation_status"] == "metadata_only"- google_modes = {- mode["id"]: mode- for mode in catalog[GEMINI_CODE_ASSIST_PROVIDER_ID]["provider_modes"]- }- assert google_modes["gemini_api_oauth"]["allowed"] is True- assert google_modes["antigravity_subscription_oauth"]["allowed"] is Falseassert {plan["id"] for plan in catalog[XAI_GROK_PROVIDER_ID]["plans"]} >= {"free","supergrok_lite",@@ -758,8 +741,6 @@ def test_usage_plan_catalog_covers_current_and_nearby_subscription_providers():"enterprise","api_credits",}- assert catalog[CLAUDE_CODE_PROVIDER_ID]["implemented"] is False- assert catalog[GEMINI_CODE_ASSIST_PROVIDER_ID]["implemented"] is Falsedef test_disconnect_api_returns_provider_result_contract(monkeypatch):diff --git a/tests/test_oauth_static.py b/tests/test_oauth_static.pyindex b573611ea..78bd5f52d 100644--- a/tests/test_oauth_static.py+++ b/tests/test_oauth_static.py@@ -91,12 +91,12 @@ def test_usage_plan_catalog_is_visible_without_provider_cards():plans_py = (PROJECT_ROOT / "plugins/_oauth/helpers/usage_plans.py").read_text(encoding="utf-8")assert "oauth-plan-catalog" in config_html- assert "Metadata only" in store_js- assert "Google Gemini / Antigravity" in plans_pyassert "Google Gemini API" in plans_pyassert "GEMINI_API_PROVIDER_ID" in plans_py- assert "antigravity_subscription_oauth" in plans_py- assert '"allowed": False' in plans_py+ assert "Google Gemini / Antigravity" not in plans_py+ assert "Claude Code" not in plans_py+ assert "antigravity_subscription_oauth" not in plans_py+ assert "claude_code_oauth" not in plans_pydef test_oauth_model_wrappers_do_not_add_box_borders_or_lateral_padding():