agycraft-mcp 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agycraft-mcp",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Privacy-first local MCP server & CLI doctor for Antigravity (AGY) and Gemini CLI — token usage audit, KV cache diagnostics, error attribution, and model selection.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -0,0 +1,295 @@
1
+ {
2
+ "schema_version": "1.0.0",
3
+ "generated_at": "2026-12-02T00:00:00Z",
4
+ "updated_at": "2026-12-02T00:00:00Z",
5
+ "channels": [
6
+ {
7
+ "channel_id": "google_oauth",
8
+ "aliases": [],
9
+ "display_name": "Google Account OAuth (Consumer / Workspace)",
10
+ "category": "subscription",
11
+ "billing_model": "shared_bucket",
12
+ "priority": 30,
13
+ "detection": {
14
+ "endpoint_regexes": [
15
+ "daily-cloudcode-pa\\.googleapis\\.com",
16
+ "cloudaicompanion\\.googleapis\\.com",
17
+ "antigravity-unleash\\.goog"
18
+ ],
19
+ "log_auth_method_values": [
20
+ "google_oauth",
21
+ "oauth",
22
+ "login_with_google",
23
+ "agy_oauth",
24
+ "consumer"
25
+ ],
26
+ "settings_auth_type_patterns": [
27
+ "oauth"
28
+ ],
29
+ "env_presence_keys": [],
30
+ "env_conflict_keys": [
31
+ "GEMINI_API_KEY",
32
+ "GOOGLE_API_KEY",
33
+ "GOOGLE_CLOUD_PROJECT",
34
+ "GOOGLE_GENAI_USE_VERTEXAI",
35
+ "GOOGLE_APPLICATION_CREDENTIALS",
36
+ "GOOGLE_CLOUD_API_KEY"
37
+ ],
38
+ "local_config_files": [
39
+ "~/.gemini/oauth_creds.json",
40
+ "~/.gemini/antigravity-cli/antigravity-oauth-token"
41
+ ]
42
+ },
43
+ "error_signature_regexes": [
44
+ "WEEKLY_LIMIT_EXCEEDED",
45
+ "Reset Onboarding",
46
+ "5-hour|rolling\\s*5h|weekly\\s*limit",
47
+ "AI Pro|AI Ultra|AI Credits",
48
+ "daily-cloudcode-pa\\.googleapis\\.com",
49
+ "cloudaicompanion\\.googleapis\\.com",
50
+ "antigravity-unleash\\.goog",
51
+ "oauth_creds\\.json"
52
+ ],
53
+ "quota_reset_policy": {
54
+ "window_type": "rolling_5h_7d",
55
+ "reset_timezone": "America/Los_Angeles",
56
+ "reset_clock": "00:00",
57
+ "supports_kv_cache_discount": false,
58
+ "background_call_billed": false,
59
+ "thinking_bucket_multiplier": "4x-8x"
60
+ },
61
+ "recommended_behaviors": {
62
+ "thinking_guidance": "Thinking consumes the 5h/7d shared quota bucket at a 4x-8x input multiplier; downgrade to Medium/Low for routine coding.",
63
+ "kv_cache_guidance": "Avoid frequent /compact calls when cache hit rate is high (>=85%) so the prefix stays intact and the shared quota bucket lasts longer.",
64
+ "throttling_guidance": "Stagger heavy batch workloads across 5h rolling windows and align with PT midnight (America/Los_Angeles 00:00) quota resets.",
65
+ "model_routing_guidance": "Use Orchestrator routing (Neon for planning -> Hydrogen/Flash for execution) to maximize 5h/7d bucket endurance.",
66
+ "isolation_commands": [
67
+ "unset GEMINI_API_KEY GOOGLE_API_KEY GOOGLE_CLOUD_PROJECT GOOGLE_APPLICATION_CREDENTIALS CLAUDE_CODE_USE_VERTEX GOOGLE_GENAI_USE_VERTEXAI GOOGLE_CLOUD_API_KEY"
68
+ ],
69
+ "verify_command": "npx agycraft-mcp doctor --auth-mode google_oauth",
70
+ "thinking_guidance_zh": "Thinking 按 4x–8x 输入倍率消耗 5h/7d 共享配额桶,常规编码建议降级为 Medium/Low。",
71
+ "kv_cache_guidance_zh": "高缓存命中(>=85%)时避免频繁 /compact 破坏前缀,以延长共享配额桶续航。",
72
+ "throttling_guidance_zh": "错峰安排重型批处理至 5h 滚动窗口,并对齐 PT 午夜(America/Los_Angeles 00:00)配额重置。",
73
+ "model_routing_guidance_zh": "采用 Orchestrator 路由(Neon 规划 → Hydrogen/Flash 执行)以最大化 5h/7d 桶续航。"
74
+ },
75
+ "display_name_zh": "Google 账号 OAuth(个人订阅 / Workspace)"
76
+ },
77
+ {
78
+ "channel_id": "gcp_vertex_adc",
79
+ "legacy_id": "gcp_adc",
80
+ "aliases": [
81
+ "gcp_adc"
82
+ ],
83
+ "display_name": "GCP Vertex AI (ADC / Service Account)",
84
+ "category": "cloud_payg",
85
+ "billing_model": "payg_credit",
86
+ "priority": 80,
87
+ "detection": {
88
+ "endpoint_regexes": [
89
+ "([a-z0-9-]+-)?aiplatform\\.googleapis\\.com(?!/.*\\?key=)"
90
+ ],
91
+ "log_auth_method_values": [
92
+ "gcp_adc",
93
+ "gcp_vertex_adc",
94
+ "vertex_adc",
95
+ "vertex_ai",
96
+ "service_account",
97
+ "gcp"
98
+ ],
99
+ "settings_auth_type_patterns": [
100
+ "vertex",
101
+ "adc",
102
+ "compute",
103
+ "gcp"
104
+ ],
105
+ "env_presence_keys": [
106
+ "GOOGLE_GENAI_USE_VERTEXAI",
107
+ "GOOGLE_CLOUD_PROJECT",
108
+ "GOOGLE_APPLICATION_CREDENTIALS",
109
+ "CLAUDE_CODE_USE_VERTEX",
110
+ "ANTHROPIC_VERTEX_PROJECT_ID"
111
+ ],
112
+ "env_true_only_keys": [
113
+ "GOOGLE_GENAI_USE_VERTEXAI",
114
+ "CLAUDE_CODE_USE_VERTEX"
115
+ ],
116
+ "env_conflict_keys": [
117
+ "GEMINI_API_KEY",
118
+ "GOOGLE_API_KEY"
119
+ ],
120
+ "local_config_files": [
121
+ "~/.config/gcloud/application_default_credentials.json"
122
+ ],
123
+ "agy_settings_keys": [
124
+ "gcp"
125
+ ]
126
+ },
127
+ "error_signature_regexes": [
128
+ "aiplatform\\.googleapis\\.com(?!/.*\\?key=)",
129
+ "projects/[^/]+/locations/",
130
+ "SERVICE_DISABLED",
131
+ "roles/aiplatform\\.user",
132
+ "aiplatform\\.endpoints\\.predict",
133
+ "not found in location",
134
+ "VPC Service Controls|vpcServiceControlsUniqueIdentifier",
135
+ "invalid_grant|reauth related error|Refreshing credentials failed",
136
+ "GOOGLE_APPLICATION_CREDENTIALS|GOOGLE_GENAI_USE_VERTEXAI"
137
+ ],
138
+ "quota_reset_policy": {
139
+ "window_type": "rpm_tpm_regional",
140
+ "reset_timezone": "UTC",
141
+ "reset_clock": null,
142
+ "supports_kv_cache_discount": true,
143
+ "kv_cache_discount_rate": "10%",
144
+ "background_call_billed": true,
145
+ "thinking_bucket_multiplier": null
146
+ },
147
+ "recommended_behaviors": {
148
+ "thinking_guidance": "Billed in real USD/Credit at actual Vertex AI output token rates (no 5h/7d bucket); enable High Thinking only for complex multi-file reasoning.",
149
+ "kv_cache_guidance": "Keeping the prefix stable triggers implicit KV Cache (10% rate discount; requires >=4,096 base tokens + >=2,050 new tokens per turn), directly lowering your USD bill.",
150
+ "throttling_guidance": "Burst 429s stem from project-level regional RPM/TPM limits or DSQ congestion; set GOOGLE_CLOUD_LOCATION=global, spread concurrency, or request a regional quota increase.",
151
+ "background_spend_guidance": "Background monitoring (MODEL_TIER_FLASH_LITE) and frequent CHECKPOINT calls incur real PAYG billing on Vertex AI; avoid idle polling.",
152
+ "model_routing_guidance": "Orchestrator routing (Neon for planning -> Hydrogen/Flash for execution) directly reduces real USD/Credit spend per request.",
153
+ "isolation_commands": [
154
+ "unset GEMINI_API_KEY GOOGLE_API_KEY",
155
+ "export GOOGLE_GENAI_USE_VERTEXAI=true"
156
+ ],
157
+ "verify_command": "gcloud config get-value project && gcloud auth application-default print-access-token >/dev/null && echo OK",
158
+ "thinking_guidance_zh": "按 Vertex AI 实际输出单价实时扣除美元/Credit(无 5h/7d 桶),仅在复杂多文件推理时开启 High Thinking。",
159
+ "kv_cache_guidance_zh": "保持前缀稳定可触发隐式 KV Cache(10% 费率省钱效应,需满足 >=4,096 base tokens + 每轮 >=2,050 new tokens),直接降低真实美元账单。",
160
+ "throttling_guidance_zh": "突发 429 源于项目级区域 RPM/TPM 或 DSQ 拥堵;建议设置 GOOGLE_CLOUD_LOCATION=global、分散并发或申请提升区域配额。",
161
+ "background_spend_guidance_zh": "后台监控(MODEL_TIER_FLASH_LITE)与高频 CHECKPOINT 在 Vertex AI 下均会产生真实按量计费,请避免无意义空转。",
162
+ "model_routing_guidance_zh": "Orchestrator 路由(Neon 规划 → Hydrogen/Flash 执行)可直接降低单次请求真实美元/Credit 支出。"
163
+ },
164
+ "display_name_zh": "GCP Vertex AI(ADC / 服务账号)"
165
+ },
166
+ {
167
+ "channel_id": "gemini_api_key",
168
+ "legacy_id": "api_key",
169
+ "aliases": [
170
+ "api_key"
171
+ ],
172
+ "display_name": "Gemini Developer API (AI Studio API Key)",
173
+ "category": "developer_api",
174
+ "billing_model": "tiered_api_key",
175
+ "priority": 100,
176
+ "detection": {
177
+ "endpoint_regexes": [
178
+ "generativelanguage\\.googleapis\\.com"
179
+ ],
180
+ "log_auth_method_values": [
181
+ "api_key",
182
+ "api-key",
183
+ "apikey",
184
+ "gemini_api_key",
185
+ "ai_studio"
186
+ ],
187
+ "settings_auth_type_patterns": [
188
+ "api-key",
189
+ "api_key",
190
+ "gemini-api-key"
191
+ ],
192
+ "env_presence_keys": [
193
+ "GEMINI_API_KEY",
194
+ "GOOGLE_API_KEY"
195
+ ],
196
+ "env_conflict_keys": [
197
+ "GOOGLE_GENAI_USE_VERTEXAI",
198
+ "GOOGLE_APPLICATION_CREDENTIALS",
199
+ "GOOGLE_CLOUD_PROJECT"
200
+ ],
201
+ "local_config_files": []
202
+ },
203
+ "error_signature_regexes": [
204
+ "generativelanguage\\.googleapis\\.com",
205
+ "API_KEY_INVALID",
206
+ "x-goog-api-key",
207
+ "AI Studio|Free Tier|Tier 1.*spend cap"
208
+ ],
209
+ "quota_reset_policy": {
210
+ "window_type": "rpm_tpm_rpd_tiered",
211
+ "reset_timezone": "America/Los_Angeles",
212
+ "reset_clock": "00:00",
213
+ "supports_kv_cache_discount": true,
214
+ "kv_cache_discount_rate": "10%-25%",
215
+ "background_call_billed": true,
216
+ "thinking_bucket_multiplier": null
217
+ },
218
+ "recommended_behaviors": {
219
+ "thinking_guidance": "AI Studio Paid Tier bills by actual output tokens (Free Tier enforces strict RPD/RPM limits); budget Thinking usage accordingly.",
220
+ "kv_cache_guidance": "Use implicit/explicit Context Caching to cut repeated-prefix costs; note that Free Tier prompts may be subject to different data retention policies.",
221
+ "throttling_guidance": "429s stem from your AI Studio Tier's RPM/TPM/RPD limits or 10-minute Spend Cap; check aistudio.google.com quotas or upgrade to a paid Tier (gcloud region switching does not apply).",
222
+ "background_spend_guidance": "Exposing GEMINI_API_KEY in the AGY/CLI shell both hijacks OAuth/ADC channels and causes background calls to consume your personal API key quota.",
223
+ "model_routing_guidance": "Route lightweight tasks to Flash/Flash-Lite to conserve RPD and paid Tier spend.",
224
+ "isolation_commands": [
225
+ "unset GOOGLE_GENAI_USE_VERTEXAI GOOGLE_APPLICATION_CREDENTIALS GOOGLE_CLOUD_PROJECT"
226
+ ],
227
+ "verify_command": "npx agycraft-mcp doctor --auth-mode gemini_api_key",
228
+ "thinking_guidance_zh": "AI Studio Paid Tier 按实际输出 Token 计费(Free Tier 受严格 RPD/RPM 限制),请按需控制 Thinking 预算。",
229
+ "kv_cache_guidance_zh": "利用隐式/显式 Context Caching 降低重复前缀成本;注意 Free Tier 提示词可能受限于不同的数据留存政策。",
230
+ "throttling_guidance_zh": "429 源于 AI Studio 所属 Tier 的 RPM/TPM/RPD 或 10 分钟 Spend Cap 上限;检查 aistudio.google.com 配额页或升级付费 Tier(不支持 gcloud 区域切换)。",
231
+ "background_spend_guidance_zh": "若将 GEMINI_API_KEY 暴露在 AGY/CLI Shell 中,不仅会劫持 OAuth/ADC 通道,还会导致后台调用消耗个人 API Key 额度。",
232
+ "model_routing_guidance_zh": "轻量任务路由至 Flash/Flash-Lite 以节省 RPD 与付费 Tier 费用。"
233
+ },
234
+ "display_name_zh": "Gemini Developer API(AI Studio API Key)"
235
+ },
236
+ {
237
+ "channel_id": "vertex_express_key",
238
+ "aliases": [],
239
+ "display_name": "Vertex AI Express Mode (90-Day Trial API Key)",
240
+ "category": "cloud_payg",
241
+ "billing_model": "express_trial_90d",
242
+ "priority": 90,
243
+ "detection": {
244
+ "endpoint_regexes": [
245
+ "aiplatform\\.googleapis\\.com/.*\\?key="
246
+ ],
247
+ "log_auth_method_values": [
248
+ "vertex_express",
249
+ "vertex_express_key",
250
+ "express_mode"
251
+ ],
252
+ "settings_auth_type_patterns": [
253
+ "express"
254
+ ],
255
+ "env_presence_keys": [
256
+ "GOOGLE_CLOUD_API_KEY"
257
+ ],
258
+ "env_conflict_keys": [
259
+ "GEMINI_API_KEY"
260
+ ],
261
+ "local_config_files": []
262
+ },
263
+ "error_signature_regexes": [
264
+ "Express Mode|90-day.*trial|GOOGLE_CLOUD_API_KEY",
265
+ "aiplatform\\.googleapis\\.com/.*\\?key="
266
+ ],
267
+ "quota_reset_policy": {
268
+ "window_type": "rpm_tpm_regional",
269
+ "reset_timezone": "UTC",
270
+ "reset_clock": null,
271
+ "supports_kv_cache_discount": true,
272
+ "kv_cache_discount_rate": "10%",
273
+ "background_call_billed": true,
274
+ "thinking_bucket_multiplier": null
275
+ },
276
+ "recommended_behaviors": {
277
+ "thinking_guidance": "Vertex Express Mode enforces strict project-level prototype RPM/TPM limits; use Flash or Medium Thinking for routine testing.",
278
+ "kv_cache_guidance": "Supports Vertex AI implicit caching; after the 90-day free trial expires, link Cloud Billing to transition to standard PAYG.",
279
+ "throttling_guidance": "429 usually indicates hitting the Express free quota cap or 90-day trial expiration; link a billing account in GCP Console to lift the limit.",
280
+ "background_spend_guidance": "Lightweight background calls under Vertex Express Mode still consume your limited 90-day trial RPM/TPM and free credit allowance.",
281
+ "model_routing_guidance": "Prefer Flash/Flash-Lite during prototyping to avoid rapidly exhausting the Express free allowance.",
282
+ "isolation_commands": [
283
+ "unset GEMINI_API_KEY"
284
+ ],
285
+ "verify_command": "npx agycraft-mcp doctor --auth-mode vertex_express_key",
286
+ "thinking_guidance_zh": "Vertex Express Mode 拥有严格的项目级原型 RPM/TPM 限制,建议常规测试使用 Flash/Medium Thinking。",
287
+ "kv_cache_guidance_zh": "支持 Vertex AI 隐式缓存,注意 90 天免费试用期到期后需绑定 Cloud Billing 转入标准按量模式。",
288
+ "throttling_guidance_zh": "429 通常意味着触发 Express 免费额度上限或 90 天试用期届满,请在 GCP Console 绑定结算账号解除限制。",
289
+ "background_spend_guidance_zh": "Vertex Express Mode 后台轻量调用会消耗有限的 90 天试用 RPM/TPM 与免费额度。",
290
+ "model_routing_guidance_zh": "原型验证阶段优先使用 Flash/Flash-Lite,避免快速耗尽 Express 免费额度。"
291
+ },
292
+ "display_name_zh": "Vertex AI Express Mode(90 天免绑卡试用 Key)"
293
+ }
294
+ ]
295
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schema_version": "1.0.0",
3
- "generated_at": "2026-11-26T03:55:52.857Z",
3
+ "generated_at": "2026-12-02T05:47:43.080Z",
4
4
  "entries": [
5
5
  {
6
6
  "id": "agy-2026-11-25-v2-35-2-midturn-switch",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schema_version": "1.0.0",
3
- "generated_at": "2026-11-26T03:55:52.857Z",
3
+ "generated_at": "2026-12-02T05:47:43.080Z",
4
4
  "domains": [
5
5
  {
6
6
  "id": "quota",
@@ -109,6 +109,110 @@
109
109
  "resolved_in_version": null,
110
110
  "deep_link": "/fix/google/429-desync",
111
111
  "official_source_url": "https://aistudio.google.com/docs/rate-limits",
112
+ "applicable_auth_modes": [
113
+ "google_oauth",
114
+ "gcp_vertex_adc",
115
+ "gemini_api_key",
116
+ "vertex_express_key"
117
+ ],
118
+ "channel_variants": {
119
+ "google_oauth": {
120
+ "root_cause": "Accidental GEMINI_API_KEY / GOOGLE_CLOUD_PROJECT env override hijacking OAuth, or 5h/7d shared-bucket / AI Credits exhaustion on daily-cloudcode-pa.googleapis.com.",
121
+ "root_cause_zh": "Shell 中残留的 GEMINI_API_KEY / GOOGLE_CLOUD_PROJECT 劫持了 OAuth 通道,或 daily-cloudcode-pa.googleapis.com 的 5h/7d 共享配额桶/AI Credits 触顶。",
122
+ "fix_commands": [
123
+ {
124
+ "label": "Unset hijacking API key & Vertex env vars",
125
+ "os": "unix",
126
+ "command": "unset GEMINI_API_KEY GOOGLE_API_KEY GOOGLE_CLOUD_PROJECT GOOGLE_APPLICATION_CREDENTIALS GOOGLE_GENAI_USE_VERTEXAI GOOGLE_CLOUD_API_KEY"
127
+ },
128
+ {
129
+ "label": "Verify OAuth channel isolation",
130
+ "os": "all",
131
+ "command": "npx agycraft-mcp doctor --auth-mode google_oauth"
132
+ }
133
+ ],
134
+ "dont_dos": [
135
+ "Do NOT troubleshoot google_oauth 429s by switching GCP regions (GOOGLE_CLOUD_LOCATION) or checking Cloud Billing.",
136
+ "Do NOT spam rapid retries in a loop — repeated 429 bursts trigger abuse cooldowns."
137
+ ],
138
+ "dont_dos_zh": [
139
+ "不要按 GCP Region 切换或 Cloud Billing 排查个人 OAuth 订阅配额。",
140
+ "严禁死循环狂点重试,高频 429 会触发风控冷却。"
141
+ ]
142
+ },
143
+ "gcp_vertex_adc": {
144
+ "root_cause": "Project/region RPM, TPM, or Dynamic Shared Quota (DSQ) saturation on aiplatform.googleapis.com, or unbilled GCP project (limit: 0).",
145
+ "root_cause_zh": "aiplatform.googleapis.com 上当前 GCP Project 与 Region 的 RPM/TPM 或动态共享配额(DSQ)拥堵,或项目未绑定有效 Cloud Billing(limit: 0)。",
146
+ "fix_commands": [
147
+ {
148
+ "label": "Switch to global Vertex endpoint & isolate API keys",
149
+ "os": "unix",
150
+ "command": "unset GEMINI_API_KEY GOOGLE_API_KEY GOOGLE_CLOUD_API_KEY && export GOOGLE_GENAI_USE_VERTEXAI=true GOOGLE_CLOUD_LOCATION=global"
151
+ },
152
+ {
153
+ "label": "Verify active GCP billing & project",
154
+ "os": "all",
155
+ "command": "gcloud config get-value project && gcloud auth application-default print-access-token >/dev/null && echo OK"
156
+ }
157
+ ],
158
+ "dont_dos": [
159
+ "Do NOT run Reset Onboarding or wait for PT midnight 5h/7d buckets — Vertex AI uses real-time Cloud Billing and regional RPM/TPM.",
160
+ "Do NOT check quota on aistudio.google.com for Vertex AI endpoints."
161
+ ],
162
+ "dont_dos_zh": [
163
+ "不要执行 Reset Onboarding 或等待 PT 午夜 5h/7d 桶重置,Vertex AI 走实时 Cloud Billing 与区域 RPM/TPM。",
164
+ "不要去 aistudio.google.com 查看 Vertex AI 端点的配额。"
165
+ ]
166
+ },
167
+ "gemini_api_key": {
168
+ "root_cause": "AI Studio / generativelanguage.googleapis.com Free Tier RPD/RPM ceiling, Tier 1 10-min $10 spend cap, or unbilled project limit: 0.",
169
+ "root_cause_zh": "generativelanguage.googleapis.com 命中 AI Studio Free Tier RPD/RPM 上限、Tier 1 每 10 分钟 $10 消费上限,或未绑定计费导致 limit: 0。",
170
+ "fix_commands": [
171
+ {
172
+ "label": "Isolate AI Studio API key from Vertex env vars",
173
+ "os": "unix",
174
+ "command": "unset GOOGLE_GENAI_USE_VERTEXAI GOOGLE_APPLICATION_CREDENTIALS GOOGLE_CLOUD_PROJECT GOOGLE_CLOUD_API_KEY"
175
+ },
176
+ {
177
+ "label": "Verify AI Studio channel health",
178
+ "os": "all",
179
+ "command": "npx agycraft-mcp doctor --auth-mode gemini_api_key"
180
+ }
181
+ ],
182
+ "dont_dos": [
183
+ "Do NOT attempt to fix AI Studio 429s with gcloud auth application-default login or GOOGLE_CLOUD_LOCATION.",
184
+ "Do NOT expose GEMINI_API_KEY globally in interactive AGY/CLI shells where OAuth is intended."
185
+ ],
186
+ "dont_dos_zh": [
187
+ "不要用 gcloud auth application-default login 或切换 GOOGLE_CLOUD_LOCATION 排查 AI Studio 429。",
188
+ "不要在预期使用 OAuth 的 AGY/CLI Shell 中全局导出 GEMINI_API_KEY。"
189
+ ]
190
+ },
191
+ "vertex_express_key": {
192
+ "root_cause": "Vertex AI Express Mode 90-day trial quota exhausted or trial period expired on aiplatform.googleapis.com (?key=GOOGLE_CLOUD_API_KEY).",
193
+ "root_cause_zh": "Vertex AI Express Mode(GOOGLE_CLOUD_API_KEY)触发 90 天免绑卡试用额度上限或试用期已届满。",
194
+ "fix_commands": [
195
+ {
196
+ "label": "Isolate Express Mode key from AI Studio key",
197
+ "os": "unix",
198
+ "command": "unset GEMINI_API_KEY"
199
+ },
200
+ {
201
+ "label": "Verify Vertex Express channel",
202
+ "os": "all",
203
+ "command": "npx agycraft-mcp doctor --auth-mode vertex_express_key"
204
+ }
205
+ ],
206
+ "dont_dos": [
207
+ "Do NOT confuse GOOGLE_CLOUD_API_KEY (aiplatform.googleapis.com) with GEMINI_API_KEY (generativelanguage.googleapis.com).",
208
+ "Do NOT check aistudio.google.com for Express Mode trial limits — upgrade via GCP Console Cloud Billing."
209
+ ],
210
+ "dont_dos_zh": [
211
+ "不要混淆 GOOGLE_CLOUD_API_KEY(Vertex Express)与 GEMINI_API_KEY(AI Studio)。",
212
+ "不要去 aistudio.google.com 查 Express 试用额度,需在 GCP Console 绑定结算账号转正。"
213
+ ]
214
+ }
215
+ },
112
216
  "history": [
113
217
  {
114
218
  "date": "2026-11-26",
@@ -149,13 +253,13 @@
149
253
  "root_cause": "True shared-bucket exhaustion across the 5-hour rolling window or 7-day weekly ceiling. Note that implicit full-request KV caching requires >= 4,096 base tokens AND >= 2,050 new tokens added per multi-turn loop.",
150
254
  "root_cause_zh": "5 小时滚动窗口或 7 天周共享桶真实耗尽。常见诱因包括用 Neon/Carbon 做机械改写、长会话未及时 /compact,或破坏了 4,096 Token 隐式缓存前缀(多轮需新增 >= 2,050 Token 才能完整缓存上一轮)。",
151
255
  "steps": [
152
- "Audit local 5h/7d burn and cache-hit warnings with `agycraft-mcp` (`analyze_token_usage` + `get_saving_recommendations`).",
256
+ "Audit local 5h/7d burn and long-session snowball warnings with `agycraft-mcp` (`analyze_token_usage` + `get_saving_recommendations`).",
153
257
  "Run `/compact` immediately or switch mid-turn (AGY v2.35.2+) from Neon to Hydrogen.",
154
258
  "Check `/usage` and `/credits` in Antigravity CLI to see whether AI Credit overages are set to `Never` or `Always`.",
155
259
  "Add `.geminiignore` to exclude `node_modules`, build outputs, and lockfiles from context ingestion."
156
260
  ],
157
261
  "steps_zh": [
158
- "通过 `agycraft-mcp`(`analyze_token_usage` + `get_saving_recommendations`)排查本机 5h/7d 消耗与缓存失效原因。",
262
+ "通过 `agycraft-mcp`(`analyze_token_usage` + `get_saving_recommendations`)排查本机 5h/7d 消耗与长会话雪球风险。",
159
263
  "立即执行 `/compact` 压缩上下文,或利用 AGY v2.35.2+ 在轮次中将 Neon 切换为 Hydrogen。",
160
264
  "在 AGY CLI 中运行 `/usage` 与 `/credits` 查看配额与 AI Credits 超额策略(Never / Always)。",
161
265
  "维护 `.geminiignore` 排除 `node_modules`、构建产物与锁文件。"
@@ -271,6 +375,108 @@
271
375
  "resolved_in_version": null,
272
376
  "deep_link": "/fix/google/403-auth-mismatch",
273
377
  "official_source_url": "https://aistudio.google.com/docs/troubleshooting",
378
+ "applicable_auth_modes": [
379
+ "google_oauth",
380
+ "gcp_vertex_adc",
381
+ "gemini_api_key",
382
+ "vertex_express_key"
383
+ ],
384
+ "channel_variants": {
385
+ "google_oauth": {
386
+ "root_cause": "Stale OAuth grant in ~/.gemini/oauth_creds.json, account switch mismatch, or accidental Vertex/API Key env vars overriding consumer OAuth.",
387
+ "root_cause_zh": "~/.gemini/oauth_creds.json 本地 OAuth 授权过期、账号切换错位,或被 Vertex/API Key 环境变量串通道覆盖。",
388
+ "fix_commands": [
389
+ {
390
+ "label": "Clear stale OAuth cache & isolate env",
391
+ "os": "unix",
392
+ "command": "unset GEMINI_API_KEY GOOGLE_API_KEY GOOGLE_CLOUD_PROJECT GOOGLE_APPLICATION_CREDENTIALS GOOGLE_GENAI_USE_VERTEXAI && rm -f ~/.gemini/oauth_creds.json"
393
+ },
394
+ {
395
+ "label": "Re-login via AGY / Gemini CLI OAuth",
396
+ "os": "all",
397
+ "command": "npx agycraft-mcp doctor --auth-mode google_oauth"
398
+ }
399
+ ],
400
+ "dont_dos": [
401
+ "Do NOT inspect, copy, or share ~/.gemini/oauth_creds.json contents.",
402
+ "Do NOT run gcloud auth application-default login to fix personal Google OAuth login."
403
+ ],
404
+ "dont_dos_zh": [
405
+ "严禁读取、复制或分享 ~/.gemini/oauth_creds.json 内容。",
406
+ "不要用 gcloud auth application-default login 修复个人 OAuth 登录。"
407
+ ]
408
+ },
409
+ "gcp_vertex_adc": {
410
+ "root_cause": "Missing roles/aiplatform.user IAM role, aiplatform.googleapis.com SERVICE_DISABLED, VPC Service Controls block, or expired ADC token (invalid_grant).",
411
+ "root_cause_zh": "缺少 roles/aiplatform.user IAM 权限、项目未启用 aiplatform.googleapis.com(SERVICE_DISABLED)、受 VPC Service Controls 拦截,或 ADC 凭证过期(invalid_grant)。",
412
+ "fix_commands": [
413
+ {
414
+ "label": "Enable Vertex AI API & refresh ADC",
415
+ "os": "all",
416
+ "command": "gcloud services enable aiplatform.googleapis.com && gcloud auth application-default login"
417
+ },
418
+ {
419
+ "label": "Verify project & ADC access token",
420
+ "os": "unix",
421
+ "command": "unset GEMINI_API_KEY GOOGLE_API_KEY && export GOOGLE_GENAI_USE_VERTEXAI=true && gcloud config get-value project"
422
+ }
423
+ ],
424
+ "dont_dos": [
425
+ "Do NOT delete ~/.gemini/oauth_creds.json expecting it to fix Vertex ADC/SA authentication.",
426
+ "Do NOT mix GEMINI_API_KEY with GOOGLE_GENAI_USE_VERTEXAI=true."
427
+ ],
428
+ "dont_dos_zh": [
429
+ "不要删除 ~/.gemini/oauth_creds.json 来修复 Vertex ADC/SA 鉴权。",
430
+ "严禁将 GEMINI_API_KEY 与 GOOGLE_GENAI_USE_VERTEXAI=true 混用。"
431
+ ]
432
+ },
433
+ "gemini_api_key": {
434
+ "root_cause": "Invalid, revoked, or HTTP-referrer/IP-restricted GEMINI_API_KEY on generativelanguage.googleapis.com (API_KEY_INVALID).",
435
+ "root_cause_zh": "generativelanguage.googleapis.com 拒绝了无效、已吊销或受 Referrer/IP 限制的 GEMINI_API_KEY(API_KEY_INVALID)。",
436
+ "fix_commands": [
437
+ {
438
+ "label": "Clear conflicting Vertex env vars",
439
+ "os": "unix",
440
+ "command": "unset GOOGLE_GENAI_USE_VERTEXAI GOOGLE_APPLICATION_CREDENTIALS GOOGLE_CLOUD_PROJECT GOOGLE_CLOUD_API_KEY"
441
+ },
442
+ {
443
+ "label": "Verify AI Studio key mode",
444
+ "os": "all",
445
+ "command": "npx agycraft-mcp doctor --auth-mode gemini_api_key"
446
+ }
447
+ ],
448
+ "dont_dos": [
449
+ "Do NOT print or echo $GEMINI_API_KEY in terminal logs or bug reports.",
450
+ "Do NOT configure IAM roles/aiplatform.user for an AI Studio API key."
451
+ ],
452
+ "dont_dos_zh": [
453
+ "严禁在终端日志或 Issue 中打印 $GEMINI_API_KEY 明文。",
454
+ "AI Studio Key 无需也不能通过 IAM roles/aiplatform.user 修复。"
455
+ ]
456
+ },
457
+ "vertex_express_key": {
458
+ "root_cause": "Invalid GOOGLE_CLOUD_API_KEY, missing Express Mode project enablement, or attempting restricted enterprise endpoints with an Express trial key.",
459
+ "root_cause_zh": "GOOGLE_CLOUD_API_KEY 无效、未开通 Vertex Express Mode 项目,或尝试用 Express 试用 Key 调用受限企业端点。",
460
+ "fix_commands": [
461
+ {
462
+ "label": "Ensure Express Mode key isolation",
463
+ "os": "unix",
464
+ "command": "unset GEMINI_API_KEY GOOGLE_APPLICATION_CREDENTIALS"
465
+ },
466
+ {
467
+ "label": "Verify Express Mode channel",
468
+ "os": "all",
469
+ "command": "npx agycraft-mcp doctor --auth-mode vertex_express_key"
470
+ }
471
+ ],
472
+ "dont_dos": [
473
+ "Do NOT pass an AI Studio GEMINI_API_KEY to aiplatform.googleapis.com Express endpoints."
474
+ ],
475
+ "dont_dos_zh": [
476
+ "不要将 AI Studio 的 GEMINI_API_KEY 传给 aiplatform.googleapis.com Express 端点。"
477
+ ]
478
+ }
479
+ },
274
480
  "history": [
275
481
  {
276
482
  "date": "2026-11-26",
@@ -350,6 +556,87 @@
350
556
  "resolved_in_version": null,
351
557
  "deep_link": "/fix/google/503-504-stall",
352
558
  "official_source_url": "https://status.cloud.google.com/",
559
+ "applicable_auth_modes": [
560
+ "google_oauth",
561
+ "gcp_vertex_adc",
562
+ "gemini_api_key",
563
+ "vertex_express_key"
564
+ ],
565
+ "channel_variants": {
566
+ "google_oauth": {
567
+ "root_cause": "Upstream daily-cloudcode-pa.googleapis.com capacity wave, antigravity-unleash.goog feature-flag handshake stall, or oversized uncompacted prompt with high/xhigh thinking.",
568
+ "root_cause_zh": "daily-cloudcode-pa.googleapis.com 上游容量波动、antigravity-unleash.goog 特性开关握手超时,或超大未压缩上下文叠加 high/xhigh 深度思考导致 504。",
569
+ "fix_commands": [
570
+ {
571
+ "label": "Check AGY & Cloud Status",
572
+ "os": "unix",
573
+ "command": "curl -sS https://status.cloud.google.com/incidents.json | node -e 'const d=JSON.parse(require(\"fs\").readFileSync(0,\"utf8\")); console.log(\"Active:\", d.filter(i=>!i.end).length)'"
574
+ }
575
+ ],
576
+ "dont_dos": [
577
+ "Do NOT re-send a 500k-token uncached prompt repeatedly when 504 occurs — run /compact and step down to Hydrogen."
578
+ ],
579
+ "dont_dos_zh": [
580
+ "遇到 504 超时不要原样重发 500k+ 超大上下文,应执行 /compact 并切换至 Hydrogen。"
581
+ ]
582
+ },
583
+ "gcp_vertex_adc": {
584
+ "root_cause": "Regional Vertex AI endpoint capacity congestion (e.g. us-central1) or 504 deadline exceeded on large uncached payloads.",
585
+ "root_cause_zh": "Vertex AI 单一区域端点(如 us-central1)容量拥堵,或超大请求在区域端点触发 504 DEADLINE_EXCEEDED。",
586
+ "fix_commands": [
587
+ {
588
+ "label": "Route Vertex AI traffic to global endpoint",
589
+ "os": "unix",
590
+ "command": "export GOOGLE_CLOUD_LOCATION=global"
591
+ },
592
+ {
593
+ "label": "Verify Vertex AI regional reachability",
594
+ "os": "unix",
595
+ "command": "curl -I -sS --max-time 8 https://aiplatform.googleapis.com/ | head -n 5"
596
+ }
597
+ ],
598
+ "dont_dos": [
599
+ "Do NOT pin a congested single region when GOOGLE_CLOUD_LOCATION=global is supported for the model."
600
+ ],
601
+ "dont_dos_zh": [
602
+ "在模型支持 global 端点时,不要死锁拥堵的单一区域。"
603
+ ]
604
+ },
605
+ "gemini_api_key": {
606
+ "root_cause": "generativelanguage.googleapis.com transient 503 overload or 504 server deadline on oversized single-turn payloads.",
607
+ "root_cause_zh": "generativelanguage.googleapis.com 瞬时 503 过载,或单轮超大请求触发 504 超时。",
608
+ "fix_commands": [
609
+ {
610
+ "label": "Verify generativelanguage.googleapis.com TLS reachability",
611
+ "os": "unix",
612
+ "command": "curl -I -sS --max-time 8 https://generativelanguage.googleapis.com/ | head -n 5"
613
+ }
614
+ ],
615
+ "dont_dos": [
616
+ "Do NOT disable exponential backoff in custom API scripts during 503 waves."
617
+ ],
618
+ "dont_dos_zh": [
619
+ "503 波动期间严禁关闭自定义脚本的指数退避重试。"
620
+ ]
621
+ },
622
+ "vertex_express_key": {
623
+ "root_cause": "Vertex AI Express Mode shared prototype pool 503 overload or 504 deadline on aiplatform.googleapis.com.",
624
+ "root_cause_zh": "Vertex AI Express Mode 共享原型池在 aiplatform.googleapis.com 出现 503 过载或 504 超时。",
625
+ "fix_commands": [
626
+ {
627
+ "label": "Verify aiplatform.googleapis.com reachability",
628
+ "os": "unix",
629
+ "command": "curl -I -sS --max-time 8 https://aiplatform.googleapis.com/ | head -n 5"
630
+ }
631
+ ],
632
+ "dont_dos": [
633
+ "Do NOT spam unbacked retries on Express Mode during 503 waves."
634
+ ],
635
+ "dont_dos_zh": [
636
+ "503 波动期间不要在 Express Mode 上无退避并发重试。"
637
+ ]
638
+ }
639
+ },
353
640
  "history": [
354
641
  {
355
642
  "date": "2026-11-26",