Remove non-connectable OAuth plan metadata
Alessandro committed
Jun 1, 2026 at 03:01 UTC
709f72b317b169ecc10be6d80bec3093c3ba1409
4 files changed
+20
-113
plugins/_oauth/README.md
+1
-7
@@ -33,15 +33,9 @@ Tokens in `auth.json` are password-equivalent credentials. Keep this plugin on t
33
- Supports manual callback paste for remote hosts where the browser cannot reach the local callback directly.
34
- Stores credentials under `usr/plugins/_oauth/xai_grok/auth.json`.
35
36
-### Claude Code and Antigravity Product OAuth
37
-
38
-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.
39
-
36
## Usage Plan Metadata
37
42
-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.
43
-
44
-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.
38
+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.
39
40
## Remote xAI Callback
41
plugins/_oauth/helpers/usage_plans.py
-68
@@ -5,9 +5,7 @@ from typing import Any
5
6
CODEX_PROVIDER_ID = "codex_oauth"
7
GITHUB_COPILOT_PROVIDER_ID = "github_copilot_oauth"
8
-CLAUDE_CODE_PROVIDER_ID = "claude_code_oauth"
8
GEMINI_API_PROVIDER_ID = "gemini_api_oauth"
10
-GEMINI_CODE_ASSIST_PROVIDER_ID = "gemini_code_assist_oauth"
9
XAI_GROK_PROVIDER_ID = "xai_grok_oauth"
10
11
@@ -57,27 +55,6 @@ USAGE_PLAN_CATALOG: dict[str, dict[str, Any]] = {
55
{"label": "GitHub Copilot plans", "url": "https://docs.github.com/en/copilot/get-started/plans"},
56
],
57
},
60
- CLAUDE_CODE_PROVIDER_ID: {
61
- "provider_id": CLAUDE_CODE_PROVIDER_ID,
62
- "display_name": "Claude Code",
63
- "implemented": False,
64
- "plans": [
65
- {"id": "pro", "label": "Pro", "billing": "Subscription", "usage": "Shared Claude and Claude Code usage limits."},
66
- {"id": "max_5x", "label": "Max 5x", "billing": "Subscription", "usage": "Higher included usage than Pro."},
67
- {"id": "max_20x", "label": "Max 20x", "billing": "Subscription", "usage": "Highest individual Claude Code subscription allocation."},
68
- {"id": "team", "label": "Team", "billing": "Seat-based subscription", "usage": "Claude Code included with every Team seat; premium seats add more usage."},
69
- {"id": "enterprise_premium", "label": "Enterprise Premium", "billing": "Seat-based subscription", "usage": "Enterprise seat type with Claude Code access."},
70
- {"id": "enterprise_usage_based", "label": "Enterprise usage-based", "billing": "API-rate consumption", "usage": "Usage billed by consumption instead of per-seat caps."},
71
- ],
72
- "notes": [
73
- "Claude subscription usage and Anthropic API-key billing are distinct systems.",
74
- "An ANTHROPIC_API_KEY can make Claude Code use API billing instead of subscription allocation.",
75
- ],
76
- "sources": [
77
- {"label": "Claude Code with Pro or Max", "url": "https://support.claude.com/en/articles/11145838-use-claude-code-with-your-pro-or-max-plan"},
78
- {"label": "Claude Code with Team or Enterprise", "url": "https://support.claude.com/en/articles/11845131-use-claude-code-with-your-team-or-enterprise-plan"},
79
- ],
80
- },
58
GEMINI_API_PROVIDER_ID: {
59
"provider_id": GEMINI_API_PROVIDER_ID,
60
"display_name": "Google Gemini API",
@@ -98,51 +75,6 @@ USAGE_PLAN_CATALOG: dict[str, dict[str, Any]] = {
75
{"label": "Gemini API billing", "url": "https://ai.google.dev/gemini-api/docs/billing"},
76
],
77
},
101
- GEMINI_CODE_ASSIST_PROVIDER_ID: {
102
- "provider_id": GEMINI_CODE_ASSIST_PROVIDER_ID,
103
- "display_name": "Google Gemini / Antigravity",
104
- "implemented": False,
105
- "implementation_status": "metadata_only",
106
- "plans": [
107
- {"id": "individual", "label": "Antigravity Individual", "billing": "$0/month", "usage": "Baseline Antigravity quota, unlimited tab completions, and CLI access."},
108
- {"id": "google_ai_pro", "label": "Google AI Pro", "billing": "Subscription", "usage": "More generous Antigravity rate limits and AI credit overages."},
109
- {"id": "google_ai_ultra", "label": "Google AI Ultra", "billing": "Subscription", "usage": "Highest Antigravity quota, highest weekly limits, and third-party model access."},
110
- {"id": "organization", "label": "Organization plan", "billing": "Google Cloud", "usage": "Gemini Enterprise Agent Platform access, Cloud project integration, and consumption pricing."},
111
- {"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."},
112
- {"id": "code_assist_enterprise", "label": "Gemini Code Assist Enterprise", "billing": "Google Cloud subscription", "usage": "Enterprise plan with customization and broader Google Cloud integrations."},
113
- {"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."},
114
- ],
115
- "provider_modes": [
116
- {
117
- "id": "gemini_api_oauth",
118
- "label": "Gemini API OAuth",
119
- "allowed": True,
120
- "status": "implemented",
121
- "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.",
122
- },
123
- {
124
- "id": "antigravity_subscription_oauth",
125
- "label": "Antigravity subscription OAuth",
126
- "allowed": False,
127
- "status": "not_implemented",
128
- "note": "Google Antigravity terms prohibit using third-party tools to access the Antigravity service through its OAuth flow.",
129
- },
130
- ],
131
- "notes": [
132
- "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.",
133
- "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.",
134
- "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.",
135
- ],
136
- "sources": [
137
- {"label": "Google Antigravity terms", "url": "https://antigravity.google/terms"},
138
- {"label": "Google Antigravity plans", "url": "https://antigravity.google/docs/plans?id=GoogleAntigravity"},
139
- {"label": "Google Antigravity pricing", "url": "https://antigravity.google/pricing?app=antigravity"},
140
- {"label": "Gemini Code Assist overview", "url": "https://developers.google.com/gemini-code-assist/docs/overview"},
141
- {"label": "Gemini Code Assist quotas", "url": "https://developers.google.com/gemini-code-assist/resources/quotas"},
142
- {"label": "Gemini CLI", "url": "https://developers.google.com/gemini-code-assist/docs/gemini-cli"},
143
- {"label": "Gemini API OAuth", "url": "https://ai.google.dev/gemini-api/docs/oauth"},
144
- ],
145
- },
78
XAI_GROK_PROVIDER_ID: {
79
"provider_id": XAI_GROK_PROVIDER_ID,
80
"display_name": "xAI Grok",
tests/test_oauth_providers.py
+15
-34
@@ -75,11 +75,7 @@ from plugins._oauth.helpers.providers.base import (
75
write_private_json,
76
)
77
from plugins._oauth.helpers.providers.registry import get_provider, provider_registry
78
-from plugins._oauth.helpers.usage_plans import (
79
- CLAUDE_CODE_PROVIDER_ID,
80
- GEMINI_CODE_ASSIST_PROVIDER_ID,
81
- usage_plan_catalog,
82
-)
78
+from plugins._oauth.helpers.usage_plans import usage_plan_catalog
79
80
81
class FakeRequest:
@@ -341,8 +337,12 @@ def test_status_api_returns_provider_registry_shape(monkeypatch):
337
GITHUB_COPILOT_PROVIDER_ID,
338
GEMINI_API_PROVIDER_ID,
339
XAI_GROK_PROVIDER_ID,
344
- CLAUDE_CODE_PROVIDER_ID,
345
- GEMINI_CODE_ASSIST_PROVIDER_ID,
340
+ }
341
+ assert set(response["usage_plan_catalog"]) == {
342
+ CODEX_PROVIDER_ID,
343
+ GITHUB_COPILOT_PROVIDER_ID,
344
+ GEMINI_API_PROVIDER_ID,
345
+ XAI_GROK_PROVIDER_ID,
346
}
347
assert response["codex"] == response["provider_map"][CODEX_PROVIDER_ID]
348
@@ -698,9 +698,16 @@ def test_provider_metadata_marks_new_oauth_providers_as_oauth_api_key_mode():
698
assert metadata["chat"][XAI_GROK_PROVIDER_ID]["api_key_mode"] == "oauth"
699
700
701
-def test_usage_plan_catalog_covers_current_and_nearby_subscription_providers():
701
+def test_usage_plan_catalog_covers_connectable_subscription_providers_only():
702
catalog = usage_plan_catalog()
703
704
+ assert set(catalog) == {
705
+ CODEX_PROVIDER_ID,
706
+ GITHUB_COPILOT_PROVIDER_ID,
707
+ GEMINI_API_PROVIDER_ID,
708
+ XAI_GROK_PROVIDER_ID,
709
+ }
710
+
711
assert {plan["id"] for plan in catalog[CODEX_PROVIDER_ID]["plans"]} >= {
712
"free",
713
"go",
@@ -725,30 +732,6 @@ def test_usage_plan_catalog_covers_current_and_nearby_subscription_providers():
732
"vertex_ai",
733
}
734
assert catalog[GEMINI_API_PROVIDER_ID]["implemented"] is True
728
- assert {plan["id"] for plan in catalog[CLAUDE_CODE_PROVIDER_ID]["plans"]} >= {
729
- "pro",
730
- "max_5x",
731
- "max_20x",
732
- "team",
733
- "enterprise_premium",
734
- "enterprise_usage_based",
735
- }
736
- assert {plan["id"] for plan in catalog[GEMINI_CODE_ASSIST_PROVIDER_ID]["plans"]} >= {
737
- "individual",
738
- "google_ai_pro",
739
- "google_ai_ultra",
740
- "organization",
741
- "code_assist_standard",
742
- "code_assist_enterprise",
743
- "gemini_api_oauth",
744
- }
745
- assert catalog[GEMINI_CODE_ASSIST_PROVIDER_ID]["implementation_status"] == "metadata_only"
746
- google_modes = {
747
- mode["id"]: mode
748
- for mode in catalog[GEMINI_CODE_ASSIST_PROVIDER_ID]["provider_modes"]
749
- }
750
- assert google_modes["gemini_api_oauth"]["allowed"] is True
751
- assert google_modes["antigravity_subscription_oauth"]["allowed"] is False
735
assert {plan["id"] for plan in catalog[XAI_GROK_PROVIDER_ID]["plans"]} >= {
736
"free",
737
"supergrok_lite",
@@ -758,8 +741,6 @@ def test_usage_plan_catalog_covers_current_and_nearby_subscription_providers():
741
"enterprise",
742
"api_credits",
743
}
761
- assert catalog[CLAUDE_CODE_PROVIDER_ID]["implemented"] is False
762
- assert catalog[GEMINI_CODE_ASSIST_PROVIDER_ID]["implemented"] is False
744
745
746
def test_disconnect_api_returns_provider_result_contract(monkeypatch):
tests/test_oauth_static.py
+4
-4
@@ -91,12 +91,12 @@ def test_usage_plan_catalog_is_visible_without_provider_cards():
91
plans_py = (PROJECT_ROOT / "plugins/_oauth/helpers/usage_plans.py").read_text(encoding="utf-8")
92
93
assert "oauth-plan-catalog" in config_html
94
- assert "Metadata only" in store_js
95
- assert "Google Gemini / Antigravity" in plans_py
94
assert "Google Gemini API" in plans_py
95
assert "GEMINI_API_PROVIDER_ID" in plans_py
98
- assert "antigravity_subscription_oauth" in plans_py
99
- assert '"allowed": False' in plans_py
96
+ assert "Google Gemini / Antigravity" not in plans_py
97
+ assert "Claude Code" not in plans_py
98
+ assert "antigravity_subscription_oauth" not in plans_py
99
+ assert "claude_code_oauth" not in plans_py
100
101
102
def test_oauth_model_wrappers_do_not_add_box_borders_or_lateral_padding():