Repository navigation
[Feature]: Support Kimi (ACP Registry / Kimi Code CLI) and Gemini 4 Argon (Antigravity) in Usage -> Limits, quota banners, and model-scoped quota matching #28946
Replies: 2 comments
|
Adding one more symptom that I don't think is captured above (on T3 Code desktop, Kimi via the ACP Registry, When the Kimi subscription hits its usage limit mid-thread, the turn is not classified as a usage limit at all. There is no The provider does return a quota error on the wire (the 429 "You've reached your 5-hour usage limit" quoted above), but T3 doesn't map it to the usage-limit path — the turn completes as an empty reply instead of transitioning to This looks like the same bug class as #28658 (Antigravity 429 finishes the turn as completed instead of showing the usage-limit banner), just via the Kimi ACP path — so the fix probably belongs in the shared limit-classification layer rather than in a Kimi-specific probe. |
|
Kimi is now supported through ACP Registry, but Usage → Tokens/Cost still omits it on T3 Code 0.1.7 and current I confirmed this locally with Kimi Code CLI 2.5.2. Kimi persists turn-scoped Could we split this out from the broader quota/limits work as a focused Kimi Tokens/Cost integration? I’d like to propose a PR that:
The PR would not touch quota APIs, OAuth, legacy Kimi 1.x, or other providers. The earlier #7936 was closed when Kimi was not a supported provider; that constraint no longer applies. Would this direction and narrower scope be approved? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Before submitting
Area
apps/server, apps/web, apps/mobile, packages/shared (Usage & Subscription Limits — ACP Registry Kimi provider & Antigravity
gemini-4-argon)Problem
Part 1: Kimi (
acpRegistry_kimi_cli/ Kimi Code CLI)When using Kimi (
acpRegistry_kimi_cli/ Kimi Code CLI2.4.1or ACP Registrykimi1.52.0), T3 Code0.1.6has no Usage Limit UI and no Kimi usage integration across three surfaces:Usage -> Limits(mod+u->l) completely omits Kimi:Even when
acpRegistry_kimi_cliis enabled, installed, andstatus: "ready", Kimi does not appear in Subscription Limits at all — neither live rolling quota bars (5-hourwindow,7-daywindow, monthly code/total quota, and Booster extra-usage wallet) nor even an external Manage usage fallback link (https://www.kimi.com/membership/subscription?tab=quota, compare fix(usage): show Devin in subscription Limits #26381 for Devin).HTTP 429) has no usage-limit banner / reset timer / snooze integration:When a Kimi Coding subscription hits its 5-hour rolling window,
kimireturns:snoozeLimitedThreads/autoResumeLimitedThreadsand model-picker out-of-quota indicators.Usage -> Tokens / Costomits Kimi local session transcripts:usage-scan-cache-v10.jsonscans~/.claude,~/.codex,~/.grok, and~/.pi, but does not scan Kimi Code's~/.kimi-code/sessions(agents/*/wire.jsonlusage.recordevents) or legacy~/.kimi/sessions. (Previous PRs feat(usage): include Kimi Code activity #7936 and feat(server): show Kimi Code plan limits on Claude relay instances #13587 were closed unmerged, and feat(server): show Kimi Code plan limits on Claude relay instances #13587 only targetedclaudeAgentrelay instances rather thanacpRegistryKimi instances.)Part 2: Gemini 4 Argon (
gemini-4-argonvia Antigravity)Antigravity meters Gemini 4 Argon in its own dedicated weekly WTU quota group (
displayName: "Gemini 4 Argon",bucketId: "gemini-argon-wtu-weekly"), separate from standardGemini Models(gemini-5h,gemini-weekly) andClaude and GPT models(3p-5h,3p-weekly).0.1.6stable:In
0.1.6,apps/server/src/provider/antigravityUsageLimits.tssendsUser-Agent: antigravity/hub/1.0.0 ..., causingv1internal:retrieveUserQuotaSummaryon bothdaily-cloudcode-paandcloudcode-pato return only3p-5hand3p-weekly— completely hidinggemini-argon-wtu-weekly(even when ~93% consumed on our live account alongsidegemini-weeklyat 0.03% used).(Note: PR fix(server): bump Antigravity quota probe UA to hub/2.24.0 so Gemini limits appear #28090 on
mainbumpsUser-Agenttoantigravity/hub/2.24.0and preservesgroup.displayName"Gemini 4 Argon · Weekly"insummaryWindows(), but several Argon usage-limit gaps remain onmainbelow.)main(post-fix(server): bump Antigravity quota probe UA to hub/2.24.0 so Gemini limits appear #28090),exhaustedUsageWindow()conflatesgemini-argon-wtu-weeklywith all non-Argongemini-*models (packages/shared/src/usageLimits.ts, L43–54):"gemini-argon-wtu-weekly".match(/^(gemini|claude|gpt|3p)-/)?.[1]evaluates to"gemini", exhausting Gemini 4 Argon's weekly WTU quota (gemini-argon-wtu-weeklyatusedPercent >= 100) whilegemini-5h/gemini-weeklystill have >99% remaining causesexhaustedUsageWindow(provider, now, "gemini-3.8-flash")to returngemini-argon-wtu-weekly— falsely markinggemini-3.8-flash(the default Antigravity model) and every other non-Argon Gemini model as out of quota and triggering unwantedresolveNewThreadModelSelectionfallbacks.v1internal:fetchAvailableModelsinspection also shows thinking-level split metering for Argon:gemini-4-argon-lowandgemini-4-argon-mediumreport the weekly Argon WTU bucket (remainingFraction: 0.0666,resetTime: "2026-11-08T18:27:14Z"), whereasgemini-4-argon-highreports thegemini-5hwindow (remainingFraction: 0.9988,resetTime: "2026-11-02T00:45:35Z").modelWindows()fallback inapps/server/src/provider/antigravityUsageLimits.tsstill collapsesgemini-4-argon-*into"Gemini":When
fetchAvailableModelsis used as a fallback,model.modelProvider === "MODEL_PROVIDER_GOOGLE" || modelId.startsWith("gemini-")mergesgemini-4-argon-*andgemini-3.8-flash-*into a singlegemini-quotawindow (max(usedPercent)), overwriting standard Gemini's ~0.1% usage with Argon's ~93% weekly WTU consumption under"Gemini · Reported quota"instead of separating"Gemini 4 Argon"(gemini-argon-quota/gemini-argon-weekly).HTTP 429/RESOURCE_EXHAUSTED, cf. Antigravity quota exhaustion (HTTP 429) finishes the turn as completed instead of showing the usage-limit banner #28658):Hitting
gemini-argon-wtu-weeklyorgemini-5hmid-turn ongemini-4-argondoes not transition the thread intoclass: "usage_limit"paired with Argon'sresetsAttimestamp forsnoozeLimitedThreads/autoResumeLimitedThreads.Expected behavior
Kimi (
acpRegistry_kimi_cli)Usage -> Limitsshows Kimi subscription quotas for enabledacpRegistryKimi instances (supporting both~/.kimi-code/for Kimi Code CLI2.xand~/.kimi/for legacykimi-cli1.x, plusKIMI_CODE_HOMEand bothapi.kimi.com/api.kimi.airegions):packages/oauth/src/managed-usage.ts) queriesGET <base_url>/usages(defaulthttps://api.kimi.com/coding/v1/usagesorhttps://api.kimi.ai/coding/v1/usagesperconfig.toml[providers."managed:kimi-code"].base_url) withAuthorization: Bearer <access_token>(refreshing viarefresh_tokenincredentials/kimi-code.jsonwhenexpires_athas passed).usages.limit_5h:{ used_ratio, reset_time }(5-hour rolling quota)usages.limit_7d:{ used_ratio, reset_time }(7-day rolling quota)usages.limit_month_code&usages.limit_month_total:{ used_ratio, reset_time }boosterWallet:{ balance: { type: "BOOSTER", amount, amountLeft }, monthlyChargeLimit, monthlyUsed, monthlyChargeLimitEnabled }https://www.kimi.com/membership/subscription?tab=quota(orkimi.aiequivalent).limit_5h.reset_time/limit_7d.reset_timewindow sosnoozeLimitedThreadsandautoResumeLimitedThreadswork cleanly as they do for Claude and Codex.~/.kimi-code/sessions(and~/.kimi/sessions) in usage transcript scanning.Gemini 4 Argon (
gemini-4-argonvia Antigravity)Gemini 4 Argonusage-limit visibility in shipped releases: Ship theantigravity/hub/2.24.0+(or installedantigravity/acp/<version>) quota probe soUsage -> Limits,/usage-limits, and the thread details usage card displayGemini 4 Argon · Weekly(gemini-argon-wtu-weekly) alongsideGemini · 5-hour(gemini-5h) andGemini · Weekly(gemini-weekly).packages/shared/src/usageLimits.ts:gemini-argon-*windows as anargon-specific pool so exhaustinggemini-argon-wtu-weeklynever marks non-Argongemini-*models (such asgemini-3.8-flash) as exhausted.gemini-4-argon*models againstgemini-argon-*(taking thinking-level metering into account wherelow/mediumconsumegemini-argon-wtu-weeklyandhighconsumesgemini-5h/gemini-weekly).modelWindows()fallback (antigravityUsageLimits.ts): ClassifymodelId.includes("argon")(gemini-4-argon-*) under its owngemini-argon-*window ("Gemini 4 Argon") rather than merging it into"Gemini".usage_limitbanners with the applicablegemini-argon-wtu-weekly/gemini-5hresetsAtwhengemini-4-argonhits429 RESOURCE_EXHAUSTED.Version or commit
T3 Code server/desktop
0.1.6(and verified againstmainpost-#28090 at79f1fadf)Environment
0.1.6),antigravityACP1.4.1(gemini-4-argon) &acpRegistry_kimi_clipointing to Kimi Code CLI2.4.1(~/.kimi-code/bin/kimi)0.1.6) & mobileAll reactions