tuxevil-rotator 4.4.9 → 4.5.0

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +2 -1
  3. package/package.json +1 -1
  4. package/src/access-probe.ts +1 -1
  5. package/src/account-store.ts +14 -2
  6. package/src/audio-transcription.ts +1 -0
  7. package/src/auto-model-access.ts +22 -0
  8. package/src/compat/model-specs.ts +7 -0
  9. package/src/compat/schema-sanitizer.ts +420 -287
  10. package/src/compat.ts +110 -66
  11. package/src/config-defaults.ts +7 -0
  12. package/src/fetch-with-retry.ts +294 -16
  13. package/src/idempotency.ts +3 -1
  14. package/src/model-access-api.ts +9 -1
  15. package/src/model-access.ts +2 -2
  16. package/src/notification-poller.ts +9 -1
  17. package/src/provider-catalog-evidence.ts +18 -1
  18. package/src/providers/adapter.ts +5 -0
  19. package/src/providers/credential-helpers.ts +34 -0
  20. package/src/providers/google-antigravity/aicode-eligibility.ts +256 -0
  21. package/src/providers/google-antigravity/aicode-forward.ts +381 -0
  22. package/src/providers/google-antigravity/aicode.ts +478 -0
  23. package/src/providers/google-antigravity/catalog.ts +6 -0
  24. package/src/providers/google-antigravity/code-assist.ts +53 -41
  25. package/src/providers/google-antigravity/dynamic-catalog.ts +72 -7
  26. package/src/providers/google-antigravity/forward.ts +309 -86
  27. package/src/providers/google-antigravity/index.ts +67 -6
  28. package/src/providers/google-antigravity/oauth.ts +22 -12
  29. package/src/providers/google-antigravity/quota.ts +781 -34
  30. package/src/providers/google-antigravity/translators.ts +55 -46
  31. package/src/providers/google-antigravity/twin-payload.ts +231 -0
  32. package/src/providers/ollama/quota.ts +6 -4
  33. package/src/providers/openai-codex/compat.ts +11 -2
  34. package/src/providers/openai-codex/quota.ts +2 -1
  35. package/src/providers/opencode-zen/catalog.ts +159 -13
  36. package/src/providers/opencode-zen/discovery.ts +50 -0
  37. package/src/providers/opencode-zen/index.ts +7 -2
  38. package/src/providers/opencode-zen/quota.ts +14 -1
  39. package/src/proxy.ts +570 -87
  40. package/src/quota-pools.ts +76 -1
  41. package/src/rate-limit-parser.ts +239 -19
  42. package/src/rotator.ts +602 -138
  43. package/src/stream-guards.ts +87 -1
  44. package/src/telemetry.ts +17 -3
  45. package/src/types.ts +168 -9
  46. package/src/validators.ts +3 -0
  47. package/src/web/lib/accounts.ts +2 -0
  48. package/src/web/lib/attention.ts +19 -0
  49. package/src/web/lib/models.ts +6 -1
  50. package/src/web/lib/status.ts +22 -4
  51. package/src/web/pages/AccountDetail.tsx +49 -2
  52. package/src/web/pages/Accounts.tsx +38 -3
  53. package/src/web/pages/ModelAccess.tsx +4 -0
  54. package/src/web/pages/Models.tsx +2 -1
  55. package/src/web/pages/Overview.tsx +15 -1
  56. package/src/web/styles/app.css +73 -3
  57. package/tools/telemetry-receiver/receiver.js +444 -243
package/CHANGELOG.md CHANGED
@@ -2,6 +2,38 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## [4.5.0] - 2026-11-28
6
+
7
+ ### Added
8
+
9
+ - **AICode support (Phases 1–4)**: Adds the `https://www.googleapis.com/auth/aicode` OAuth scope, a `v1alpha` client (`fetchConfig`, `fetchLicenses`) and payload/SSE translation for `aicode.googleapis.com`, dual routing (AICode for eligible models in `availableExperiences`, CCPA fallback otherwise), `v1alpha:fetchQuotaStatus` polling merged with CCPA catalog discovery, and a `missing-aicode-scope` auth warning surfaced in `/api/status`, Overview, Accounts, and AccountDetail. Auto-warmup now defaults to off. See [`docs/aicode-support-plan.md`](docs/aicode-support-plan.md).
10
+ - **Dynamic Antigravity quota groups and windows**: Supports dynamically advertised quota groups/windows (`Argon`, `Gemini Models`, `Claude/GPT`, and custom pools) with per-window dashboard breakdowns, cooldown isolation, and self-healing resets.
11
+ - **SSE keepalive configuration**: New `sseKeepaliveIntervalMs` (default `15000`) writes a `: ping` comment on idle SSE streams so proxies do not drop slow reasoning responses. `0` disables it.
12
+ - **`USE_AICODE` toggle**: `auto` (default) follows Google's `enable-inference-traffic-migration` experiment, `false`/`off` never uses AICode, and `true`/`on` forces it for eligible personal accounts with the `aicode` scope. `TUXEVIL_ROTATOR_USE_AICODE` is accepted as an alias.
13
+
14
+ ### Changed
15
+
16
+ - **Google Antigravity parity**: Aligns wire `User-Agent`, ProtoJSON metadata, `SystemInstruction`/identity prompt composition, `sessionId`, `requestId`, single-account retry curves, and `onboardUser` payloads with the current Antigravity client; the default Antigravity version is now `2.35.2`.
17
+ - **`sticky-quota` draining**: Drains one account sequentially down to 0% before rotating, skipping `rotateOnQuotaDrop` and least-loaded scatter, queuing on concurrency saturation, and restoring the preferred account after cooldowns.
18
+ - **Quota polling**: Adds `0.85x–1.20x` jitter, idle backoff, and staggered per-account spacing to scheduled polls.
19
+ - **Kickstart selection**: Chooses an active eligible alternative when the default model is disabled, and uses `gemini-3.8-flash-tiered` as the default Gemini kickstart model.
20
+
21
+ ### Fixed
22
+
23
+ - Stops cascading HTTP 401/403 responses across endpoints and avoids sending `X-Goog-User-Project` unless explicitly enabled with `GOOG_USER_PROJECT`.
24
+ - Preserves dynamic account catalogs when a refresh fails and matches Carbon/Pro access rules for model discovery.
25
+ - Aligns the default upstream headers timeout with the stream idle limit, strips framing and hop-by-hop headers case-insensitively, flushes multibyte UTF-8 safely, bounds error-body reads, and keeps in-flight lease symmetry.
26
+ - Hardens compatibility schema sanitization, telemetry receiver streaming/auth/pricing, and telemetry URL normalization.
27
+ - Sanitizes non-string enums and `const` unions for Gemini schemas.
28
+
29
+ ### Security
30
+
31
+ - Resolves CodeQL URL-substring sanitization and clear-text logging alerts.
32
+
33
+ ### Contributors
34
+
35
+ - Thanks to [@javargasm](https://github.com/javargasm) (Jeisson Alexander Vargas Marroquin) for the consolidated Antigravity parity, AICode support, sticky-quota draining, and proxy/streaming hardening work in [PR #55](https://github.com/tuxevil/tuxevil-rotator/pull/55), which supersedes [PR #51](https://github.com/tuxevil/tuxevil-rotator/pull/51), [PR #52](https://github.com/tuxevil/tuxevil-rotator/pull/52), and [PR #53](https://github.com/tuxevil/tuxevil-rotator/pull/53), plus the Gemini schema sanitization fix in [PR #54](https://github.com/tuxevil/tuxevil-rotator/pull/54).
36
+
5
37
  ## [4.4.9] - 2026-11-24
6
38
 
7
39
  ### Fixed
package/README.md CHANGED
@@ -55,6 +55,7 @@ Originally built as a multi-account rotator for Google Antigravity. It now gener
55
55
 
56
56
  ## Current Model Update
57
57
 
58
+ - **v4.5.0: AICode support, Antigravity parity, and sticky-quota draining**: Adds Google AICode Phases 1–4 (OAuth `aicode` scope, `aicode.googleapis.com` client, payload/SSE translation, dual routing with CCPA fallback, and `v1alpha:fetchQuotaStatus` polling), dynamic Antigravity quota groups/windows with per-window dashboard breakdowns, `sticky-quota` sequential draining, SSE keepalive (`sseKeepaliveIntervalMs`), and a `USE_AICODE` toggle. Aligns wire headers, prompts, tracking, retries, and single-account retry curves with the current Antigravity client; stops cascading 401/403 responses, hardens proxy/streaming/compat/telemetry paths, and resolves CodeQL sanitization and logging alerts. Thanks to [@javargasm](https://github.com/javargasm) for [PR #55](https://github.com/tuxevil/tuxevil-rotator/pull/55). ([Release notes](https://github.com/tuxevil/tuxevil-rotator/releases/tag/v4.5.0))
58
59
  - **v4.4.9: Claude paid-tier kickstart fallback, telemetry accuracy, and OpenCode recovery**: Use account-aware Claude Sonnet 5.5 kickstart candidates for paid tiers with safe model-specific fallbacks and backoff, without changing Gemini's primary or switching models on quota-exhaustion 429s. Correct paid-tier and install telemetry aggregation, and retry OpenCode model discovery after transient startup failures while retaining the last good catalog. ([Release notes](https://github.com/tuxevil/tuxevil-rotator/releases/tag/v4.4.9))
59
60
  - **v4.4.8: Invalid-provider flag loop fix & telemetry receiver overhaul**: Stop quota polling and auto-warmup kickstarts from looping every 5 minutes on already-invalidated or disabled providers (emitting flag telemetry only on transitions and clearing invalidation across all providers on re-auth). Overhaul the standalone telemetry receiver with a cyberpunk/retro-console UX across `/dashboard`, `/notifications`, and `/stats`, fix flag double-counting and request inflation, add 24h sliding-window flag-loop deduplication, and harden security (Stored XSS fix, prototype-safe pricing, constant-time auth + brute-force lockout, trusted-proxy rate limiting, CSP/SRI, scoped CORS, and HTTP timeouts). ([Release notes](https://github.com/tuxevil/tuxevil-rotator/releases/tag/v4.4.8))
60
61
  - **v4.4.7: Artificial Analysis scores, static specs, and dashboard colors**: Refresh the Artificial Analysis Intelligence Index routing-quality snapshot (`2026-11-23`) with exact per-effort scores for Gemini 4 (`neon`, `hydrogen`, `carbon`, `argon`), Gemini 3.8 Flash, Claude 5.5, and OpenAI `gpt-6.1`/`gpt-6.2`, and add static model specs, context windows, and distinct dashboard chart colors for Gemini 4, Claude 5.5, GPT-6.1/6.2, and newer Ollama Cloud models. ([Release notes](https://github.com/tuxevil/tuxevil-rotator/releases/tag/v4.4.7))
@@ -410,7 +411,7 @@ Thanks to these amazing people who have contributed to the project:
410
411
  - **[@josenicomaia](https://github.com/josenicomaia)** (José Nicodemos Maia Neto) — Modularized the compatibility layer architecture, added multimodal tool response support, fixed streaming pass-through for tool executions, and added PostgreSQL storage and weighted pool quota forecasting. ([PR #8](https://github.com/tuxevil/tuxevil-rotator/pull/8), [PR #9](https://github.com/tuxevil/tuxevil-rotator/pull/9), [PR #11](https://github.com/tuxevil/tuxevil-rotator/pull/11), [PR #13](https://github.com/tuxevil/tuxevil-rotator/pull/13), [PR #14](https://github.com/tuxevil/tuxevil-rotator/pull/14))
411
412
  - **[@yashyadav711](https://github.com/yashyadav711)** (Yash) — Fixed Draft-2020-12 inline JSON-Schema union type mapping for Gemini tools support. ([PR #10](https://github.com/tuxevil/tuxevil-rotator/pull/10))
412
413
  - **[@toRolex](https://github.com/toRolex)** (Rolex) — Added cached prompt-token extraction from Google Antigravity/Cloud Code usage and mapped it to OpenAI and Anthropic compatibility responses, with focused regression tests, plus transport-error retry recovery for single-account and exhausted-account pools. ([PR #34](https://github.com/tuxevil/tuxevil-rotator/pull/34), [PR #35](https://github.com/tuxevil/tuxevil-rotator/pull/35))
413
- - **[@javargasm](https://github.com/javargasm)** (Jeisson Alexander Vargas Marroquin) — Queued multi-request Antigravity account pooling (5×5 concurrent streams), strict FIFO overflow queue, dashboard concurrency metrics, canonical project ID resolution, account-scoped dynamic Antigravity discovery and routing, dynamic catalog and quota-safety hardening, persistent dynamic model ownership and validated catalog snapshots across restarts, exact upstream variant preservation, snapshot-based request admission, 429 quota resilience with account-scoped retry, synchronous leasing, snapshot-based token refresh with generation validation, provider-scoped token publication, spend-logger memory leak fix, atomic PostgreSQL CTE daily spend aggregation with idempotent retries, virtual-key cache bounding, Anthropic tool-use compatibility layer (`tool_use`/`tool_result` content block conversion), JSON schema round-trip fixes, compat test suite expansion, model-scoped cooldowns, explicit Antigravity reset-duration parsing, idle pool normalization, RAW POLL deadline reconciliation, serialized per-account quota polling, Ollama kickstart routing for multi-provider accounts, and OpenAI-compatible audio transcription plus bidirectional live WebSocket streaming through the local Antigravity observer model, with PR #36 adding rotator-backed transcription, Language Server fallback, model-scope checks, and live timeout/control-frame hardening. ([PR #3](https://github.com/tuxevil/tuxevil-rotator/pull/3), [PR #7](https://github.com/tuxevil/tuxevil-rotator/pull/7), [PR #22](https://github.com/tuxevil/tuxevil-rotator/pull/22), [PR #23](https://github.com/tuxevil/tuxevil-rotator/pull/23), [PR #24](https://github.com/tuxevil/tuxevil-rotator/pull/24), [PR #26](https://github.com/tuxevil/tuxevil-rotator/pull/26), [PR #29](https://github.com/tuxevil/tuxevil-rotator/pull/29), [PR #30](https://github.com/tuxevil/tuxevil-rotator/pull/30), [PR #31](https://github.com/tuxevil/tuxevil-rotator/pull/31), [PR #33](https://github.com/tuxevil/tuxevil-rotator/pull/33), [PR #36](https://github.com/tuxevil/tuxevil-rotator/pull/36), [PR #42](https://github.com/tuxevil/tuxevil-rotator/pull/42))
414
+ - **[@javargasm](https://github.com/javargasm)** (Jeisson Alexander Vargas Marroquin) — Queued multi-request Antigravity account pooling (5×5 concurrent streams), strict FIFO overflow queue, dashboard concurrency metrics, canonical project ID resolution, account-scoped dynamic Antigravity discovery and routing, dynamic catalog and quota-safety hardening, persistent dynamic model ownership and validated catalog snapshots across restarts, exact upstream variant preservation, snapshot-based request admission, 429 quota resilience with account-scoped retry, synchronous leasing, snapshot-based token refresh with generation validation, provider-scoped token publication, spend-logger memory leak fix, atomic PostgreSQL CTE daily spend aggregation with idempotent retries, virtual-key cache bounding, Anthropic tool-use compatibility layer (`tool_use`/`tool_result` content block conversion), JSON schema round-trip fixes, compat test suite expansion, model-scoped cooldowns, explicit Antigravity reset-duration parsing, idle pool normalization, RAW POLL deadline reconciliation, serialized per-account quota polling, Ollama kickstart routing for multi-provider accounts, and OpenAI-compatible audio transcription plus bidirectional live WebSocket streaming through the local Antigravity observer model, with PR #36 adding rotator-backed transcription, Language Server fallback, model-scope checks, and live timeout/control-frame hardening, plus Google AICode support (Phases 1–4), full Antigravity parity, `sticky-quota` sequential draining, dynamic quota groups/windows, and proxy/streaming/telemetry hardening. ([PR #3](https://github.com/tuxevil/tuxevil-rotator/pull/3), [PR #7](https://github.com/tuxevil/tuxevil-rotator/pull/7), [PR #22](https://github.com/tuxevil/tuxevil-rotator/pull/22), [PR #23](https://github.com/tuxevil/tuxevil-rotator/pull/23), [PR #24](https://github.com/tuxevil/tuxevil-rotator/pull/24), [PR #26](https://github.com/tuxevil/tuxevil-rotator/pull/26), [PR #29](https://github.com/tuxevil/tuxevil-rotator/pull/29), [PR #30](https://github.com/tuxevil/tuxevil-rotator/pull/30), [PR #31](https://github.com/tuxevil/tuxevil-rotator/pull/31), [PR #33](https://github.com/tuxevil/tuxevil-rotator/pull/33), [PR #36](https://github.com/tuxevil/tuxevil-rotator/pull/36), [PR #42](https://github.com/tuxevil/tuxevil-rotator/pull/42), [PR #54](https://github.com/tuxevil/tuxevil-rotator/pull/54), [PR #55](https://github.com/tuxevil/tuxevil-rotator/pull/55))
414
415
 
415
416
  ## Development
416
417
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tuxevil-rotator",
3
- "version": "4.4.9",
3
+ "version": "4.5.0",
4
4
  "description": "Multi-provider, multi-account AI proxy rotator with per-model routing, real-time quota tracking, and infringement detection (Google Antigravity, Ollama Cloud)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -63,7 +63,7 @@ export async function serveAccessProbe(req: IncomingMessage, res: ServerResponse
63
63
  controller.signal.throwIfAborted();
64
64
  if (rotator.getConfig().modelAccessShadow === true) logAccessPolicyShadow(account.config, provider, model, {});
65
65
  rotator.recordUpstreamAttempt(account);
66
- const forwarded = await adapter.forwardRequest(account, body, {}, controller.signal);
66
+ const forwarded = await adapter.forwardRequest(account, body, {}, controller.signal, { apiRetry: false });
67
67
  status = forwarded.response.status;
68
68
  const reader = forwarded.response.body?.getReader();
69
69
  if (reader) {
@@ -92,6 +92,16 @@ function validateCredentialLengths(
92
92
 
93
93
  export { validateAccountConfigLengths };
94
94
 
95
+ function stripUndefinedFields<T extends object>(obj: T): Partial<T> {
96
+ const clean: Partial<T> = {};
97
+ for (const [key, value] of Object.entries(obj)) {
98
+ if (value !== undefined) {
99
+ (clean as Record<string, unknown>)[key] = value;
100
+ }
101
+ }
102
+ return clean;
103
+ }
104
+
95
105
  export function mergeCredentials(
96
106
  existing: AccountConfig["credentials"] | undefined,
97
107
  incoming: AccountConfig["credentials"] | undefined,
@@ -103,10 +113,12 @@ export function mergeCredentials(
103
113
  if (seen.has(cred.provider)) continue;
104
114
  seen.add(cred.provider);
105
115
  const incomingCredential = incomingByProvider.get(cred.provider);
106
- out.push(incomingCredential ? { ...cred, ...incomingCredential } : cred);
116
+ out.push(incomingCredential ? { ...cred, ...stripUndefinedFields(incomingCredential) } : cred);
107
117
  incomingByProvider.delete(cred.provider);
108
118
  }
109
- for (const cred of incomingByProvider.values()) out.push(cred);
119
+ for (const cred of incomingByProvider.values()) {
120
+ out.push(stripUndefinedFields(cred) as NonNullable<AccountConfig["credentials"]>[number]);
121
+ }
110
122
  return sortAccountCredentials(out);
111
123
  }
112
124
 
@@ -278,6 +278,7 @@ export async function transcribeAudioWithRotator(
278
278
  model: targetModel,
279
279
  catalogModel: options.catalogModel,
280
280
  project: "",
281
+ preservePrompt: true,
281
282
  request: {
282
283
  contents: [
283
284
  {
@@ -1,5 +1,6 @@
1
1
  import { accessEvidenceStore, type AccessEvidenceStore } from "./access-evidence.js";
2
2
  import { evaluateModelAccess, MODEL_ACCESS_RULES } from "./model-access.js";
3
+ import { antigravityCatalogEvidence, catalogModelState, type CatalogModelState } from "./provider-catalog-evidence.js";
3
4
  import type { AccountConfig } from "./types.js";
4
5
 
5
6
  export interface AutoModelAccessDecision {
@@ -11,6 +12,8 @@ export interface AutoModelAccessDecision {
11
12
  | "account-tier"
12
13
  | "unknown";
13
14
  reason: string;
15
+ /** Present when the account's live Antigravity catalog decided eligibility. */
16
+ catalog?: Exclude<CatalogModelState, "unknown">;
14
17
  }
15
18
 
16
19
  export interface AutoAccountScope {
@@ -58,6 +61,7 @@ export function evaluateAutoModelAccess(
58
61
  model: string,
59
62
  store: AccessEvidenceStore = accessEvidenceStore(),
60
63
  now = Date.now(),
64
+ catalogPollIntervalMs?: number,
61
65
  ): AutoModelAccessDecision {
62
66
  const evidence = store.forAccount(account, now);
63
67
  const declared = evidence.plans
@@ -114,6 +118,24 @@ export function evaluateAutoModelAccess(
114
118
  };
115
119
  }
116
120
 
121
+ // The account catalog is the provider's own entitlement statement and
122
+ // outranks the static plan table. When a refresh fails, the last catalog
123
+ // captured for this credential stays authoritative; only with no catalog
124
+ // for the current credential do the plan rules apply.
125
+ if (provider === "google-antigravity") {
126
+ const evidence = antigravityCatalogEvidence(account, catalogPollIntervalMs, now);
127
+ const catalog = catalogModelState(evidence, model, true);
128
+ if (catalog !== "unknown") {
129
+ const reason = (catalog === "advertised"
130
+ ? "model is advertised in this account's catalog"
131
+ : catalog === "disabled"
132
+ ? "model is disabled in this account's catalog"
133
+ : "model is not in this account's catalog") +
134
+ (evidence.freshness === "stale" ? " (last known catalog)" : "");
135
+ return { eligible: catalog === "advertised", plan, planSource, reason, catalog };
136
+ }
137
+ }
138
+
117
139
  if (plan === "unknown") {
118
140
  // A verified Free-plan model is also safe to try when the Codex plan is
119
141
  // unknown; paid-only and unlisted models still require a known plan.
@@ -20,10 +20,15 @@ export const DEFAULT_MODEL_SPECS: Record<string, ModelSpec> = {
20
20
  "gemini-3.1-pro-high": { maxOutputTokens: 65535, thinkingBudget: 10001, isThinking: true, contextWindow: 1_000_000 },
21
21
  "gemini-3.1-pro-low": { maxOutputTokens: 65535, thinkingBudget: 1001, isThinking: true, contextWindow: 1_000_000 },
22
22
  "gemini-3.1-pro-preview": { maxOutputTokens: 65535, thinkingBudget: 10001, isThinking: true, contextWindow: 1_000_000 },
23
+ "gemini-3.1-pro-preview-customtools": { maxOutputTokens: 65535, thinkingBudget: 10001, isThinking: true, contextWindow: 1_000_000 },
23
24
  "gemini-3.6-flash-high": { maxOutputTokens: 65536, thinkingBudget: 10000, isThinking: true, contextWindow: 1_000_000 },
24
25
  "gemini-3.6-flash-medium": { maxOutputTokens: 65536, thinkingBudget: 4000, isThinking: true, contextWindow: 1_000_000 },
25
26
  "gemini-3.6-flash-low": { maxOutputTokens: 65536, thinkingBudget: 1000, isThinking: true, contextWindow: 1_000_000 },
26
27
  "gemini-3.6-flash-tiered": { maxOutputTokens: 65536, thinkingBudget: -1, isThinking: true, contextWindow: 1_000_000 },
28
+ "gemini-3.7-flash": { maxOutputTokens: 65536, thinkingBudget: -1, isThinking: true, contextWindow: 1_000_000 },
29
+ "gemini-3.7-flash-high": { maxOutputTokens: 65536, thinkingBudget: 10000, isThinking: true, contextWindow: 1_000_000 },
30
+ "gemini-3.7-flash-medium": { maxOutputTokens: 65536, thinkingBudget: 4000, isThinking: true, contextWindow: 1_000_000 },
31
+ "gemini-3.7-flash-low": { maxOutputTokens: 65536, thinkingBudget: 1000, isThinking: true, contextWindow: 1_000_000 },
27
32
  "gemini-3.7-flash-tiered": { maxOutputTokens: 65536, thinkingBudget: -1, isThinking: true, contextWindow: 1_000_000 },
28
33
  "gemini-3.8-flash": { maxOutputTokens: 65536, thinkingBudget: -1, isThinking: true, contextWindow: 1_000_000 },
29
34
  "gemini-3.8-flash-tiered": { maxOutputTokens: 65536, thinkingBudget: -1, isThinking: true, contextWindow: 1_000_000 },
@@ -61,10 +66,12 @@ export const DEFAULT_MODEL_SPECS: Record<string, ModelSpec> = {
61
66
  "gemini-2.5-flash": { maxOutputTokens: 65535, thinkingBudget: 24576, isThinking: true, contextWindow: 1_000_000 },
62
67
  "gemini-2.5-pro": { maxOutputTokens: 65535, thinkingBudget: 1024, isThinking: true, contextWindow: 1_000_000 },
63
68
  "claude-opus-5-5": { maxOutputTokens: 128000, thinkingBudget: 32768, isThinking: true, contextWindow: 1_000_000 },
69
+ "claude-opus-5-5-max": { maxOutputTokens: 128000, thinkingBudget: 32768, isThinking: true, contextWindow: 1_000_000 },
64
70
  "claude-opus-5-5-high": { maxOutputTokens: 128000, thinkingBudget: 32768, isThinking: true, contextWindow: 1_000_000 },
65
71
  "claude-opus-5-5-medium": { maxOutputTokens: 128000, thinkingBudget: 32768, isThinking: true, contextWindow: 1_000_000 },
66
72
  "claude-opus-5-5-low": { maxOutputTokens: 128000, thinkingBudget: 32768, isThinking: true, contextWindow: 1_000_000 },
67
73
  "claude-sonnet-5-5": { maxOutputTokens: 128000, thinkingBudget: 32768, isThinking: true, contextWindow: 1_000_000 },
74
+ "claude-sonnet-5-5-max": { maxOutputTokens: 128000, thinkingBudget: 32768, isThinking: true, contextWindow: 1_000_000 },
68
75
  "claude-sonnet-5-5-high": { maxOutputTokens: 128000, thinkingBudget: 32768, isThinking: true, contextWindow: 1_000_000 },
69
76
  "claude-sonnet-5-5-medium": { maxOutputTokens: 128000, thinkingBudget: 32768, isThinking: true, contextWindow: 1_000_000 },
70
77
  "claude-sonnet-5-5-low": { maxOutputTokens: 128000, thinkingBudget: 32768, isThinking: true, contextWindow: 1_000_000 },