@bitkyc08/opencodex 2.91.0 → 2.93.0-preview.20261027
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/bin/ocx.mjs +47 -8
- package/gui/dist/assets/App-CJZoq-uF.js +58 -0
- package/gui/dist/assets/{Tray-BuLy7hL1.js → Tray-BWQPcgZn.js} +1 -1
- package/gui/dist/assets/index-DRe8Hhfz.css +1 -0
- package/gui/dist/assets/index-Xfct8owH.js +94 -0
- package/gui/dist/assets/quota-summary-DxToX1rV.js +1 -0
- package/gui/dist/index.html +2 -2
- package/gui/dist/provider-icons/workbuddy-color.svg +29 -0
- package/package.json +8 -7
- package/src/adapters/anthropic.ts +28 -5
- package/src/adapters/coding-agent/batch-dispatcher.ts +122 -0
- package/src/adapters/coding-agent/profile.ts +54 -16
- package/src/adapters/coding-agent/turn.ts +30 -2
- package/src/adapters/command-code.ts +114 -7
- package/src/adapters/cursor/native-exec-fs.ts +11 -9
- package/src/adapters/devin/live-models.ts +4 -0
- package/src/adapters/google-vertex-endpoint.ts +9 -1
- package/src/adapters/google-vertex-key-project.ts +223 -0
- package/src/adapters/google-wire-compiler.ts +1 -2
- package/src/adapters/google.ts +13 -3
- package/src/adapters/kiro/reasoning.ts +2 -0
- package/src/adapters/kiro-refusal.ts +6 -1
- package/src/adapters/kiro-wire.ts +1 -1
- package/src/adapters/openai-chat/messages.ts +8 -2
- package/src/adapters/openai-chat/passthrough.ts +35 -14
- package/src/adapters/openai-chat/reasoning-replay.ts +27 -16
- package/src/adapters/openai-chat/reasoning-wire.ts +117 -8
- package/src/adapters/openai-chat/required-tool-result.ts +64 -0
- package/src/adapters/openai-chat/tool-name-registry.ts +3 -1
- package/src/adapters/openai-chat.ts +9 -10
- package/src/adapters/openai-responses/passthrough.ts +7 -4
- package/src/adapters/openai-responses/reasoning.ts +13 -0
- package/src/adapters/openai-responses/request-strips.ts +60 -0
- package/src/adapters/qoder/adapter.ts +129 -8
- package/src/adapters/qoder/scaffold-guard.ts +5 -0
- package/src/adapters/reasoning-controls.ts +16 -0
- package/src/adapters/registry.ts +5 -0
- package/src/adapters/tool-call-id.ts +1 -3
- package/src/adapters/workbuddy-schema.ts +61 -0
- package/src/adapters/workbuddy.ts +68 -0
- package/src/bridge/errors.ts +27 -0
- package/src/bridge/response-json.ts +1 -1
- package/src/bridge/sse.ts +1 -1
- package/src/bridge.ts +1 -1
- package/src/chat/inbound.ts +4 -1
- package/src/chat/outbound.ts +20 -6
- package/src/chat/reasoning-details.ts +28 -5
- package/src/claude/desktop-first-party.ts +54 -4
- package/src/claude/desktop-picker.ts +11 -8
- package/src/claude/first-party-settings.ts +3 -1
- package/src/claude/inbound.ts +2 -1
- package/src/claude/intercept/local-ca.ts +2 -1
- package/src/claude/intercept/picker-ca-cleanup.ts +4 -2
- package/src/claude/intercept/picker-ca-startup.ts +3 -1
- package/src/claude/intercept/picker-models.ts +6 -3
- package/src/claude/intercept/picker-runtime.ts +3 -2
- package/src/claude/intercept/runtime.ts +6 -3
- package/src/claude/model-info.ts +31 -8
- package/src/cli/account-api.ts +11 -0
- package/src/cli/capabilities-agents-routing.ts +3 -3
- package/src/cli/capabilities-base.ts +7 -1
- package/src/cli/capabilities-observe-system.ts +10 -0
- package/src/cli/claude-desktop.ts +9 -8
- package/src/cli/claude.ts +3 -2
- package/src/cli/codex-cli-update.ts +8 -0
- package/src/cli/codex-shim-autorestore.ts +9 -0
- package/src/cli/combo-result.ts +13 -0
- package/src/cli/combo-stats.ts +3 -0
- package/src/cli/combo.ts +83 -41
- package/src/cli/cross-home-owner.ts +13 -1
- package/src/cli/dispatch.ts +25 -6
- package/src/cli/ensure-desired-integrations.ts +8 -6
- package/src/cli/export-command.ts +4 -1
- package/src/cli/help.ts +2 -1
- package/src/cli/index.ts +45 -45
- package/src/cli/integration-plan-dto.ts +4 -0
- package/src/cli/launcher-context.ts +49 -2
- package/src/cli/link.ts +45 -32
- package/src/cli/opencode.ts +20 -9
- package/src/cli/provider.ts +2 -1
- package/src/cli/registry.ts +6 -4
- package/src/cli/root.ts +9 -0
- package/src/cli/status.ts +59 -1
- package/src/cli/stop-restore.ts +113 -0
- package/src/cli/sync-expectation.ts +60 -0
- package/src/cli/uninstall-integrations.ts +41 -7
- package/src/cli/usage-compare.ts +68 -12
- package/src/client/connect.ts +40 -3
- package/src/client/link-home.ts +10 -1
- package/src/client/link-ingress.ts +1 -1
- package/src/client/link-readiness.ts +97 -0
- package/src/client/link-relay-transport.ts +79 -11
- package/src/client/link-relay.ts +74 -15
- package/src/client/link-tunnel.ts +45 -18
- package/src/client/machine-api.ts +3 -1
- package/src/client/machine-listener.ts +20 -2
- package/src/client/runtime.ts +20 -2
- package/src/client/sync-expectation.ts +118 -0
- package/src/clients/config-export/agent-clients.ts +96 -0
- package/src/clients/config-export/contracts.ts +25 -7
- package/src/clients/config-export/qoder.ts +38 -23
- package/src/clients/config-export/reasoning-metadata.ts +55 -8
- package/src/clients/config-export.ts +12 -0
- package/src/clients/lazycodex.ts +7 -2
- package/src/clients/reasoning-controls.ts +49 -0
- package/src/codex/account-store.ts +17 -3
- package/src/codex/app-server-restart-service.ts +6 -5
- package/src/codex/auth-api/account-identity.ts +14 -0
- package/src/codex/auth-api/account-list.ts +29 -2
- package/src/codex/auth-api/http.ts +13 -0
- package/src/codex/auth-api/main-account-probe.ts +2 -2
- package/src/codex/auth-api/pool-mode-gate.ts +16 -3
- package/src/codex/auth-api/pool-quota-probe.ts +15 -0
- package/src/codex/auth-context.ts +15 -12
- package/src/codex/catalog/build-entries.ts +22 -0
- package/src/codex/catalog/configured-tiers.ts +70 -0
- package/src/codex/catalog/effort.ts +52 -11
- package/src/codex/catalog/gather-capture.ts +5 -2
- package/src/codex/catalog/heal-observation.ts +155 -13
- package/src/codex/catalog/metadata.ts +6 -0
- package/src/codex/catalog/model-hints.ts +60 -11
- package/src/codex/catalog/model-visibility.ts +3 -2
- package/src/codex/catalog/native-models.ts +18 -3
- package/src/codex/catalog/parsing.ts +10 -8
- package/src/codex/catalog/pinned-models.ts +2 -1
- package/src/codex/catalog/provider-models.ts +18 -13
- package/src/codex/catalog/retained-sync.ts +2 -1
- package/src/codex/catalog/routed-gather.ts +19 -20
- package/src/codex/catalog/write-audit.ts +3 -2
- package/src/codex/catalog-self-heal.ts +43 -23
- package/src/codex/chatgpt-refresh-failure.ts +6 -2
- package/src/codex/cli-install-provenance.ts +418 -0
- package/src/codex/cli-installation-targets.ts +5 -1
- package/src/codex/cli-update-plan.ts +43 -16
- package/src/codex/collision-identity.ts +30 -5
- package/src/codex/convergence.ts +4 -3
- package/src/codex/data/roster-pinned-models.json +177 -1
- package/src/codex/desired-state.ts +6 -1
- package/src/codex/desktop-app/picker-freshness.ts +10 -8
- package/src/codex/desktop-compatibility/installed-build.ts +88 -12
- package/src/codex/desktop-compatibility/runtime.ts +29 -5
- package/src/codex/desktop-compatibility/usage-activation.ts +2 -1
- package/src/codex/desktop-compatibility/usage-controller.ts +9 -1
- package/src/codex/desktop-compatibility/windows-certificate-trust.ts +46 -12
- package/src/codex/inject/config-toml.ts +0 -18
- package/src/codex/inject/plan.ts +18 -3
- package/src/codex/inject/remove.ts +6 -2
- package/src/codex/inject.ts +1 -1
- package/src/codex/journal.ts +61 -1
- package/src/codex/model-entitlements.ts +1 -1
- package/src/codex/native-main-owner.ts +27 -1
- package/src/codex/native-profile-store.ts +2 -1
- package/src/codex/pool-credit-policy.ts +35 -1
- package/src/codex/pool-refresh-backoff.ts +3 -1
- package/src/codex/quota-types.ts +3 -0
- package/src/codex/quota.ts +24 -4
- package/src/codex/role-auto-assign.ts +6 -2
- package/src/codex/subagent-defaults.ts +49 -4
- package/src/codex/user-identity.ts +35 -6
- package/src/codex/windows-current-sid.ts +162 -0
- package/src/combos/failover.ts +17 -2
- package/src/combos/jev-decision-contract.ts +22 -1
- package/src/combos/jev-quota-activation.ts +5 -1
- package/src/combos/jev-quota-route.ts +1 -1
- package/src/combos/jev-quota.ts +9 -1
- package/src/combos/jev-service-exchange.ts +3 -1
- package/src/combos/jev-session-pin-config.ts +51 -0
- package/src/combos/jev.ts +101 -9
- package/src/combos/resolve.ts +45 -1
- package/src/combos/types.ts +43 -0
- package/src/config/load-degrade.ts +5 -0
- package/src/config/paths.ts +19 -3
- package/src/config/pending-teardown.ts +22 -1
- package/src/config/provider-validation.ts +22 -4
- package/src/config/removed-opencode-free.ts +11 -0
- package/src/config/schema/leaf-validators.ts +6 -0
- package/src/generated/compatibility-version.json +467 -311
- package/src/generated/model-metadata.ts +5 -5
- package/src/images/loop.ts +16 -2
- package/src/integrations/catalog-refresh.ts +1 -1
- package/src/integrations/hermes-profiles.ts +251 -0
- package/src/integrations/merge.ts +8 -0
- package/src/integrations/mutation-plan.ts +19 -4
- package/src/integrations/registry.ts +5 -0
- package/src/integrations/state.ts +36 -1
- package/src/integrations/writer.ts +18 -4
- package/src/lib/bun-path-runtime.mjs +2 -1
- package/src/lib/decision-quota-sink.ts +10 -0
- package/src/lib/errors.ts +62 -0
- package/src/lib/eventstream-decoder.ts +81 -37
- package/src/lib/opaque-proxy-tunnel.ts +32 -8
- package/src/lib/pinned-http.ts +35 -2
- package/src/lib/process-control.ts +13 -1
- package/src/lib/socks5-fetch.ts +59 -64
- package/src/lib/socks5-upload-waiter.ts +50 -0
- package/src/lib/sse-decoder.ts +7 -2
- package/src/lib/state-store-sweeper.ts +40 -14
- package/src/lib/translator-budget.ts +4 -4
- package/src/lib/upstream-retry.ts +4 -1
- package/src/lib/windows-native-principal-worker.ts +14 -0
- package/src/lib/windows-native-principal.ts +188 -0
- package/src/lib/windows-secret-acl.ts +39 -3
- package/src/lib/windows-user-principal.ts +62 -18
- package/src/link/diagnostics.ts +193 -0
- package/src/link/relay-auth.ts +6 -0
- package/src/link/ssh-config.ts +35 -3
- package/src/link/status-projection.ts +39 -0
- package/src/link/supervisor.ts +45 -12
- package/src/link/tunnel-history.ts +109 -0
- package/src/link/tunnel-state.ts +80 -17
- package/src/messaging/remote-files.ts +24 -1
- package/src/oauth/generic-account-failover.ts +91 -7
- package/src/oauth/index.ts +15 -0
- package/src/oauth/model-discovery-auth.ts +5 -0
- package/src/oauth/store.ts +4 -1
- package/src/oauth/token-guardian.ts +7 -0
- package/src/oauth/types.ts +9 -0
- package/src/oauth/workbuddy.ts +139 -0
- package/src/providers/account-quota-disk.ts +12 -4
- package/src/providers/antigravity-quota-identity.ts +37 -0
- package/src/providers/base-url-choices.ts +8 -5
- package/src/providers/codebuddy-models.ts +6 -0
- package/src/providers/codex-capacity.ts +3 -1
- package/src/providers/derive.ts +51 -3
- package/src/providers/kiro-models.ts +3 -0
- package/src/providers/mimo-thinking.ts +12 -0
- package/src/providers/model-discovery.ts +2 -0
- package/src/providers/model-rename-fields.ts +2 -0
- package/src/providers/model-rename-migration.ts +10 -0
- package/src/providers/openai-sidecar-credit.ts +2 -2
- package/src/providers/quota/account-cache.ts +3 -2
- package/src/providers/quota/antigravity.ts +25 -14
- package/src/providers/quota/report-cache.ts +13 -4
- package/src/providers/quota/vendor-probes-key.ts +60 -0
- package/src/providers/quota/workbuddy.ts +83 -0
- package/src/providers/quota-decision-antigravity.ts +64 -0
- package/src/providers/quota-decision-publication.ts +11 -0
- package/src/providers/quota-decision-snapshot.ts +21 -4
- package/src/providers/quota-types.ts +2 -0
- package/src/providers/quota.ts +3 -1
- package/src/providers/reasoning-capabilities.ts +76 -0
- package/src/providers/registry/entries-core.ts +23 -12
- package/src/providers/registry/entries-extended.ts +83 -27
- package/src/providers/registry/model-ids.ts +5 -0
- package/src/providers/registry/model-seeds.ts +120 -56
- package/src/providers/registry/types.ts +29 -2
- package/src/providers/resolved-model-policy.ts +30 -10
- package/src/providers/routed-config.ts +24 -1
- package/src/providers/stale-model-roster-migration.ts +123 -18
- package/src/providers/workbuddy-credit-balance.ts +81 -0
- package/src/providers/workbuddy-models.ts +37 -0
- package/src/providers/workbuddy.ts +60 -0
- package/src/remote-control/workspace-pi-runtime.ts +11 -6
- package/src/responses/compaction-summary.ts +45 -0
- package/src/responses/muse-tool-name-alias.ts +1 -2
- package/src/responses/parser.ts +3 -2
- package/src/responses/reasoning-replay-cache.ts +18 -14
- package/src/responses/schema.ts +1 -0
- package/src/responses/thought-signature-replay.ts +10 -2
- package/src/router.ts +2 -0
- package/src/routing/analytics.ts +2 -3
- package/src/routing/capability.ts +8 -2
- package/src/routing/fallback-policy.ts +3 -3
- package/src/routing/history/ingest.ts +28 -3
- package/src/server/auth-cors.ts +4 -2
- package/src/server/chat-completions.ts +21 -1
- package/src/server/chat-native-eligibility.ts +7 -0
- package/src/server/chat-native-reasoning.ts +24 -7
- package/src/server/chat-native.ts +13 -2
- package/src/server/claude-messages.ts +3 -0
- package/src/server/direct-local-http.ts +5 -2
- package/src/server/effort-policy.ts +5 -1
- package/src/server/index/link-relay-sessions.ts +9 -5
- package/src/server/index/live-sideband.ts +18 -15
- package/src/server/index/optional-listeners.ts +4 -0
- package/src/server/index/serve-options.ts +5 -4
- package/src/server/local-management-read-client.ts +3 -1
- package/src/server/management/agent-settings-routes.ts +27 -15
- package/src/server/management/combo-routes.ts +14 -4
- package/src/server/management/config-routes.ts +2 -2
- package/src/server/management/decision-discovery.ts +12 -2
- package/src/server/management/hermes-profile-routes.ts +156 -0
- package/src/server/management/integration-routes.ts +85 -24
- package/src/server/management/link-routes.ts +5 -2
- package/src/server/management/model-routes.ts +2 -2
- package/src/server/management/model-row-export-metadata.ts +25 -6
- package/src/server/management/model-rows.ts +15 -20
- package/src/server/management/native-integration-routes.ts +11 -8
- package/src/server/management/provider-routes.ts +1 -1
- package/src/server/management/route-registry.ts +4 -0
- package/src/server/management-api.ts +5 -0
- package/src/server/models-capabilities.ts +21 -3
- package/src/server/port-reclaim.ts +51 -9
- package/src/server/request-log-conversation.ts +49 -0
- package/src/server/request-log.ts +2 -0
- package/src/server/responses/adapter-delivery.ts +11 -1
- package/src/server/responses/adapter-dispatch.ts +2 -2
- package/src/server/responses/anthropic-thinking-recovery.ts +1 -0
- package/src/server/responses/codex-ws-exchange.ts +39 -9
- package/src/server/responses/codex-ws-session.ts +38 -4
- package/src/server/responses/codex-ws-wire.ts +6 -1
- package/src/server/responses/combo-required-tool-contract.ts +103 -0
- package/src/server/responses/combo-stream-preflight.ts +8 -1
- package/src/server/responses/compact.ts +14 -5
- package/src/server/responses/context-overflow.ts +8 -1
- package/src/server/responses/core-combo-failure.ts +10 -0
- package/src/server/responses/core-combo.ts +74 -44
- package/src/server/responses/core-lifetime.ts +5 -2
- package/src/server/responses/core-normalize.ts +17 -4
- package/src/server/responses/core-opaque-recovery.ts +1 -0
- package/src/server/responses/core-options.ts +7 -0
- package/src/server/responses/core-replay.ts +2 -1
- package/src/server/responses/jev-combo-choice.ts +39 -0
- package/src/server/responses/jev-session-pin.ts +203 -0
- package/src/server/responses/main-hard-lock-routing.ts +60 -44
- package/src/server/responses/passthrough-delivery.ts +44 -2
- package/src/server/responses/policy-fallback.ts +6 -1
- package/src/server/responses/request-compression.ts +12 -7
- package/src/server/responses/request-prepare.ts +32 -7
- package/src/server/responses/request-sidecar-auth.ts +2 -0
- package/src/server/responses/request-transport.ts +25 -6
- package/src/server/responses/response-effects.ts +22 -10
- package/src/server/responses/run-turn-execution.ts +2 -4
- package/src/server/responses/sidecar-execution.ts +13 -7
- package/src/server/responses-phase-inference.ts +267 -0
- package/src/server/sse-payload-rewrite.ts +14 -1
- package/src/server/stop-teardown.ts +36 -1
- package/src/server/ws-bridge.ts +1 -1
- package/src/service/definition.ts +20 -8
- package/src/service/desktop-supervision.d.mts +7 -4
- package/src/service/desktop-supervision.mjs +90 -13
- package/src/service/ownership-mutation-lease.mjs +21 -7
- package/src/types/config.ts +14 -2
- package/src/types/provider.ts +29 -7
- package/src/types/request.ts +11 -0
- package/src/types/wire.ts +1 -0
- package/src/types.ts +1 -0
- package/src/update/bind-probe.ts +29 -0
- package/src/update/codex-cli-update-launch-policy.d.mts +9 -0
- package/src/update/codex-cli-update-launch-policy.mjs +30 -0
- package/src/update/job.ts +10 -29
- package/src/update/npm-install-job.ps1 +173 -0
- package/src/update/npm-install.mjs +70 -0
- package/src/update/stop-contract.d.mts +1 -0
- package/src/update/stop-contract.mjs +14 -0
- package/src/update/stop-decision.d.mts +1 -1
- package/src/update/stop-decision.mjs +13 -3
- package/src/update/teardown-handover.ts +166 -0
- package/src/update/transactional-install.d.mts +14 -3
- package/src/update/transactional-install.mjs +33 -7
- package/src/usage/expected-prices.ts +64 -31
- package/src/usage/jev-stats.ts +54 -14
- package/src/usage/timeline.ts +19 -9
- package/src/vision/eligibility.ts +15 -5
- package/src/vision/plan.ts +2 -2
- package/src/web-search/loop.ts +16 -2
- package/gui/dist/assets/App-nZ34cR5G.js +0 -58
- package/gui/dist/assets/index-DGXS51sp.js +0 -94
- package/gui/dist/assets/index-DPeB9HpV.css +0 -1
- package/gui/dist/assets/quota-summary-DO1Sx5TM.js +0 -1
|
@@ -29,6 +29,8 @@ const FILENAME = "provider-account-quota-cache.json";
|
|
|
29
29
|
*/
|
|
30
30
|
const DISK_MAX_AGE_MS = 6 * 60 * 60_000;
|
|
31
31
|
const PERSIST_DEBOUNCE_MS = 250;
|
|
32
|
+
/** Match the reset ledger's maximum deferral under sustained quota observations. */
|
|
33
|
+
const MAX_PERSIST_DEFERRAL_MS = 1_000;
|
|
32
34
|
|
|
33
35
|
type DiskFile = {
|
|
34
36
|
version: 1;
|
|
@@ -38,6 +40,7 @@ type DiskFile = {
|
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
let persistTimer: ReturnType<typeof setTimeout> | null = null;
|
|
43
|
+
let persistStartedAt: number | null = null;
|
|
41
44
|
|
|
42
45
|
/** Read the snapshot. Returns an empty map for a missing, corrupt or stale file. */
|
|
43
46
|
export function readPersistedAccountQuotas(now = Date.now()): Map<string, ProviderQuota> {
|
|
@@ -86,14 +89,19 @@ export function readPersistedKiroVerdicts(now = Date.now()): Map<string, KiroPer
|
|
|
86
89
|
return result;
|
|
87
90
|
}
|
|
88
91
|
|
|
89
|
-
/**
|
|
92
|
+
/** Debounce snapshots without starving writes under load. Failures remain best-effort. */
|
|
90
93
|
export function schedulePersistAccountQuotas(
|
|
91
94
|
rows: () => Iterable<[string, ProviderQuota | KiroPersistedQuota]>,
|
|
92
95
|
verdicts: () => Iterable<[string, KiroPersistedVerdict]> = () => [],
|
|
93
96
|
): void {
|
|
97
|
+
const now = performance.now();
|
|
98
|
+
persistStartedAt ??= now;
|
|
99
|
+
const delay = Math.max(0, Math.min(PERSIST_DEBOUNCE_MS,
|
|
100
|
+
MAX_PERSIST_DEFERRAL_MS - (now - persistStartedAt)));
|
|
94
101
|
if (persistTimer) clearTimeout(persistTimer);
|
|
95
102
|
persistTimer = setTimeout(() => {
|
|
96
103
|
persistTimer = null;
|
|
104
|
+
persistStartedAt = null;
|
|
97
105
|
try {
|
|
98
106
|
const out: Record<string, ProviderQuota> = {};
|
|
99
107
|
for (const [key, quota] of rows()) out[key] = quota;
|
|
@@ -106,12 +114,12 @@ export function schedulePersistAccountQuotas(
|
|
|
106
114
|
} catch {
|
|
107
115
|
// Best-effort persistence only.
|
|
108
116
|
}
|
|
109
|
-
},
|
|
117
|
+
}, delay);
|
|
110
118
|
}
|
|
111
119
|
|
|
112
120
|
/** Test seam: drop any pending write so a suite cannot leak one into the next file. */
|
|
113
121
|
export function cancelPendingAccountQuotaPersist(): void {
|
|
114
|
-
if (
|
|
115
|
-
clearTimeout(persistTimer);
|
|
122
|
+
if (persistTimer) clearTimeout(persistTimer);
|
|
116
123
|
persistTimer = null;
|
|
124
|
+
persistStartedAt = null;
|
|
117
125
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { effectiveGoogleMode, getProviderRegistryEntry } from "./registry";
|
|
3
|
+
import type { OAuthCredentials } from "../oauth/types";
|
|
4
|
+
import type { OcxProviderConfig } from "../types";
|
|
5
|
+
|
|
6
|
+
const ARGON_TOKEN = /(?:^|[^a-z0-9])argon(?:[^a-z0-9]|$)/i;
|
|
7
|
+
/** Argon has an independent quota pool, including its native effort-suffixed identities. */
|
|
8
|
+
export function isAntigravityArgonIdentity(identity: string): boolean { return ARGON_TOKEN.test(identity); }
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The OAuth store key whose account both inference and the quota probe resolve. Inference reads
|
|
12
|
+
* `store[route.providerName]` and refreshes through the OAuth definition registered under that same
|
|
13
|
+
* name, and `ocx login` only accepts registered names, so a renamed provider row never authenticates
|
|
14
|
+
* as this account. Evidence is bound to this key alone; a renamed row reads unknown.
|
|
15
|
+
*/
|
|
16
|
+
export const ANTIGRAVITY_OAUTH_STORE_KEY = "google-antigravity";
|
|
17
|
+
|
|
18
|
+
/** Accounting and inference must refer to the same OAuth store entry and the supported Antigravity destination. */
|
|
19
|
+
export function antigravityQuotaEligible(name: string, provider: OcxProviderConfig): boolean {
|
|
20
|
+
if (name !== ANTIGRAVITY_OAUTH_STORE_KEY || provider.disabled || provider.authMode !== "oauth"
|
|
21
|
+
|| effectiveGoogleMode(name, provider) !== "cloud-code-assist") return false;
|
|
22
|
+
try {
|
|
23
|
+
const url = new URL(provider.baseUrl);
|
|
24
|
+
const expected = new URL(getProviderRegistryEntry(ANTIGRAVITY_OAUTH_STORE_KEY)!.baseUrl);
|
|
25
|
+
return url.href.replace(/\/$/, "") === expected.href.replace(/\/$/, "");
|
|
26
|
+
} catch { return false; }
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Private generation includes the accounting project, not just the rotating bearer. */
|
|
30
|
+
export function antigravityQuotaCredentialGeneration(credential: OAuthCredentials): string {
|
|
31
|
+
return createHash("sha256").update(JSON.stringify([credential.refresh, credential.access, credential.expires, credential.projectId])).digest("hex");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Immutable instance/destination policy, never returned to decision services. */
|
|
35
|
+
export function antigravityQuotaPolicy(name: string, provider: OcxProviderConfig): string {
|
|
36
|
+
return createHash("sha256").update(JSON.stringify([name, provider])).digest("hex");
|
|
37
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Qwen Cloud OpenAI-compatible endpoint presets.
|
|
3
3
|
* Token plan is the GUI default; pay-as-you-go and custom are selectable.
|
|
4
|
+
* Token plan host per https://docs.qwencloud.com/token-plan/personal/token-plan-personal-quickstart
|
|
5
|
+
* (checked 2026-10-23); a saved older host stays usable as a custom URL.
|
|
4
6
|
*/
|
|
5
7
|
export const QWEN_CLOUD_TOKEN_PLAN_BASE_URL =
|
|
6
|
-
"https://token-plan.
|
|
8
|
+
"https://token-plan.maas.qwencloudapi.com/compatible-mode/v1";
|
|
7
9
|
export const QWEN_CLOUD_PAYG_BASE_URL =
|
|
8
10
|
"https://dashscope.aliyuncs.com/compatible-mode/v1";
|
|
9
11
|
|
|
@@ -23,10 +25,11 @@ export const QWEN_CLOUD_BASE_URL_CHOICES: readonly ProviderBaseUrlChoice[] = [
|
|
|
23
25
|
|
|
24
26
|
/**
|
|
25
27
|
* Alibaba Token Plan International (ap-southeast-1) endpoint presets.
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
28
|
+
* Separate regional account and billing destination; both regions offer both tiers.
|
|
29
|
+
* Alibaba Cloud's own quick start still documents this host (checked 2026-10-23):
|
|
30
|
+
* https://www.alibabacloud.com/help/en/model-studio/token-plan-personal-quick-start
|
|
31
|
+
* Qwen Cloud documents a different Token Plan host, so the two constants are
|
|
32
|
+
* independent and must not be assumed equal.
|
|
30
33
|
*/
|
|
31
34
|
export const ALIBABA_INTL_TOKEN_PLAN_BASE_URL =
|
|
32
35
|
"https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1";
|
|
@@ -30,6 +30,8 @@ export const CODEBUDDY_GLOBAL_MODELS = [
|
|
|
30
30
|
"gpt-6-luna",
|
|
31
31
|
// 260930 preemptive: GPT-6.1 Sol (OpenAI announced 2026-09-29); mirrors the GPT-6 Sol row.
|
|
32
32
|
"gpt-6.1-sol",
|
|
33
|
+
// 261027 preemptive: GPT-6.1 Terra (mirrors CodeBuddy's GPT-6.1 Sol seed; provider listing unverified).
|
|
34
|
+
"gpt-6.1-terra",
|
|
33
35
|
"gpt-5.5",
|
|
34
36
|
"gpt-5.4",
|
|
35
37
|
"gpt-5.3-codex",
|
|
@@ -82,6 +84,7 @@ export const CODEBUDDY_GLOBAL_MODEL_CONTEXT_WINDOWS: Record<string, number> = {
|
|
|
82
84
|
"gpt-6-sol": 1_000_000,
|
|
83
85
|
"gpt-6-luna": 1_000_000,
|
|
84
86
|
"gpt-6.1-sol": 1_000_000,
|
|
87
|
+
"gpt-6.1-terra": 1_000_000,
|
|
85
88
|
"gpt-5.5": 1_000_000,
|
|
86
89
|
"gpt-5.4": 272_000,
|
|
87
90
|
"gpt-5.3-codex": 272_000,
|
|
@@ -105,6 +108,7 @@ export const CODEBUDDY_GLOBAL_MODEL_MAX_OUTPUT_TOKENS: Record<string, number> =
|
|
|
105
108
|
"gpt-6-sol": 128_000,
|
|
106
109
|
"gpt-6-luna": 128_000,
|
|
107
110
|
"gpt-6.1-sol": 128_000,
|
|
111
|
+
"gpt-6.1-terra": 128_000,
|
|
108
112
|
"gpt-5.5": 72_000,
|
|
109
113
|
"gpt-5.4": 128_000,
|
|
110
114
|
"gpt-5.3-codex": 128_000,
|
|
@@ -124,6 +128,7 @@ export const CODEBUDDY_GLOBAL_MODEL_REASONING_EFFORTS: Record<string, string[]>
|
|
|
124
128
|
"gpt-6-sol": ["low", "medium", "high", "xhigh"],
|
|
125
129
|
"gpt-6-luna": ["low", "medium", "high", "xhigh"],
|
|
126
130
|
"gpt-6.1-sol": ["low", "medium", "high", "xhigh"],
|
|
131
|
+
"gpt-6.1-terra": ["low", "medium", "high", "xhigh"],
|
|
127
132
|
"glm-5.3": ["low", "high", "max"],
|
|
128
133
|
"glm-5.2": ["high", "xhigh"],
|
|
129
134
|
};
|
|
@@ -135,6 +140,7 @@ export const CODEBUDDY_GLOBAL_MODEL_DEFAULT_REASONING_EFFORTS: Record<string, st
|
|
|
135
140
|
"gpt-6-sol": "high",
|
|
136
141
|
"gpt-6-luna": "high",
|
|
137
142
|
"gpt-6.1-sol": "high",
|
|
143
|
+
"gpt-6.1-terra": "high",
|
|
138
144
|
"glm-5.3": "high",
|
|
139
145
|
"glm-5.2": "high",
|
|
140
146
|
};
|
|
@@ -5,6 +5,8 @@ export const CODEX_CONFIGURED_CAPACITY_WEIGHTS = {
|
|
|
5
5
|
team: 1,
|
|
6
6
|
business: 1,
|
|
7
7
|
prolite: 5,
|
|
8
|
+
// Business Premium has 5x Standard included usage; this is display calibration only (#7440).
|
|
9
|
+
self_serve_business_prolite: 5,
|
|
8
10
|
pro: 20,
|
|
9
11
|
} as const;
|
|
10
12
|
|
|
@@ -13,7 +15,7 @@ export const CODEX_CONFIGURED_CAPACITY_WEIGHTS = {
|
|
|
13
15
|
*
|
|
14
16
|
* `CodexAccount.plan` is an unrestricted upstream string and cannot be enumerated: the
|
|
15
17
|
* bundled model snapshot alone carries 21 distinct plan names (`edu_plus`, `finserv`,
|
|
16
|
-
* `k12`, `quorum`, `self_serve_business_usage_based`, …) against the
|
|
18
|
+
* `k12`, `quorum`, `self_serve_business_usage_based`, …) against the calibrated entries above.
|
|
17
19
|
* Treating an unlisted plan as unknown dropped the account from the estimate entirely and
|
|
18
20
|
* reported "incomplete coverage" — which is how a Business seat upgraded to Premium
|
|
19
21
|
* disappeared from its own capacity report (#3155), and it was already happening to the
|
package/src/providers/derive.ts
CHANGED
|
@@ -3,8 +3,11 @@ import { COST_VENDOR_PRIORITY, getModelMetadata, getModelMetadataCaseInsensitive
|
|
|
3
3
|
import { cloneFastWire } from "./fastwire";
|
|
4
4
|
import { isAzureModelMetadataDestination, publishedAzureModelMetadata, type AzureModelMetadata } from "./azure-model-metadata";
|
|
5
5
|
import { resolveModelPolicy } from "./resolved-model-policy";
|
|
6
|
+
import { mapFill, nestedMapFill, stableUnion } from "./resolved-model-policy-merge";
|
|
7
|
+
import { mergeReasoningModelCapabilities } from "./reasoning-capabilities";
|
|
6
8
|
import {
|
|
7
9
|
PROVIDER_REGISTRY,
|
|
10
|
+
normalizedProviderEndpoint,
|
|
8
11
|
registryEntryForProviderDestination,
|
|
9
12
|
registryModelServiceTierCapabilityApplies,
|
|
10
13
|
type ProviderRegistryEntry,
|
|
@@ -30,6 +33,7 @@ export interface DerivedKeyLoginProvider {
|
|
|
30
33
|
contextWindow?: number;
|
|
31
34
|
modelContextWindows?: Record<string, number>;
|
|
32
35
|
modelInputModalities?: Record<string, string[]>;
|
|
36
|
+
modelCapabilities?: OcxProviderConfig["modelCapabilities"];
|
|
33
37
|
modelMaxInputTokens?: Record<string, number>;
|
|
34
38
|
defaultMaxOutputTokens?: number;
|
|
35
39
|
modelMaxOutputTokens?: Record<string, number>;
|
|
@@ -56,6 +60,7 @@ export interface DerivedKeyLoginProvider {
|
|
|
56
60
|
thinkingBudgetModels?: string[];
|
|
57
61
|
escapeBuiltinToolNames?: boolean;
|
|
58
62
|
openaiChatEofTolerance?: boolean;
|
|
63
|
+
foldDeveloperRoleToSystem?: boolean;
|
|
59
64
|
googleMode?: "ai-studio" | "vertex" | "cloud-code-assist";
|
|
60
65
|
project?: string;
|
|
61
66
|
location?: string;
|
|
@@ -261,6 +266,7 @@ export function providerConfigSeed(entry: ProviderRegistryEntry): OcxProviderCon
|
|
|
261
266
|
...(staticPolicy.modelContextWindows ? { modelContextWindows: { ...staticPolicy.modelContextWindows } } : {}),
|
|
262
267
|
...(staticPolicy.modelDisplayNames ? { modelDisplayNames: { ...staticPolicy.modelDisplayNames } } : {}),
|
|
263
268
|
...(staticPolicy.modelInputModalities ? { modelInputModalities: cloneRecordOfArrays(staticPolicy.modelInputModalities) } : {}),
|
|
269
|
+
...(staticPolicy.modelCapabilities ? { modelCapabilities: structuredClone(staticPolicy.modelCapabilities) } : {}),
|
|
264
270
|
...(staticPolicy.modelMaxInputTokens ? { modelMaxInputTokens: { ...staticPolicy.modelMaxInputTokens } } : {}),
|
|
265
271
|
...(entry.defaultMaxOutputTokens !== undefined ? { defaultMaxOutputTokens: entry.defaultMaxOutputTokens } : {}),
|
|
266
272
|
...(staticPolicy.modelMaxOutputTokens ? { modelMaxOutputTokens: { ...staticPolicy.modelMaxOutputTokens } } : {}),
|
|
@@ -280,6 +286,7 @@ export function providerConfigSeed(entry: ProviderRegistryEntry): OcxProviderCon
|
|
|
280
286
|
...(entry.promptCacheKey !== undefined ? { promptCacheKey: entry.promptCacheKey } : {}),
|
|
281
287
|
...(entry.chatServiceTier !== undefined ? { chatServiceTier: entry.chatServiceTier } : {}),
|
|
282
288
|
...(entry.openaiChatEofTolerance !== undefined ? { openaiChatEofTolerance: entry.openaiChatEofTolerance } : {}),
|
|
289
|
+
...(entry.foldDeveloperRoleToSystem !== undefined ? { foldDeveloperRoleToSystem: entry.foldDeveloperRoleToSystem } : {}),
|
|
283
290
|
...(entry.responsesPath !== undefined ? { responsesPath: entry.responsesPath } : {}),
|
|
284
291
|
...(entry.chatCompletionsPath !== undefined ? { chatCompletionsPath: entry.chatCompletionsPath } : {}),
|
|
285
292
|
...(entry.statelessResponses !== undefined ? { statelessResponses: entry.statelessResponses } : {}),
|
|
@@ -312,6 +319,9 @@ export function deriveKeyLoginMap(): Record<string, DerivedKeyLoginProvider> {
|
|
|
312
319
|
const out: Record<string, DerivedKeyLoginProvider> = {};
|
|
313
320
|
for (const entry of PROVIDER_REGISTRY) {
|
|
314
321
|
if (entry.authKind !== "key") continue;
|
|
322
|
+
// A deprecated route cannot complete a login, but its entry must stay resolvable for
|
|
323
|
+
// configs saved while it still worked.
|
|
324
|
+
if (entry.deprecated) continue;
|
|
315
325
|
if (!entry.dashboardUrl) throw new Error(`Registry key provider missing dashboardUrl: ${entry.id}`);
|
|
316
326
|
const liveModels = registryEntrySupportsLiveModelDiscovery(entry) ? entry.liveModels : false;
|
|
317
327
|
out[entry.id] = {
|
|
@@ -334,6 +344,7 @@ export function deriveKeyLoginMap(): Record<string, DerivedKeyLoginProvider> {
|
|
|
334
344
|
...(entry.modelMaxOutputTokens ? { modelMaxOutputTokens: { ...entry.modelMaxOutputTokens } } : {}),
|
|
335
345
|
...(entry.reasoningEfforts ? { reasoningEfforts: [...entry.reasoningEfforts] } : {}),
|
|
336
346
|
...(entry.modelReasoningEfforts ? { modelReasoningEfforts: cloneRecordOfArrays(entry.modelReasoningEfforts) } : {}),
|
|
347
|
+
...(entry.modelCapabilities ? { modelCapabilities: structuredClone(entry.modelCapabilities) } : {}),
|
|
337
348
|
...(entry.modelDefaultReasoningEfforts ? { modelDefaultReasoningEfforts: { ...entry.modelDefaultReasoningEfforts } } : {}),
|
|
338
349
|
...(entry.reasoningEffortMap ? { reasoningEffortMap: { ...entry.reasoningEffortMap } } : {}),
|
|
339
350
|
...(entry.modelReasoningEffortMap ? { modelReasoningEffortMap: cloneNestedRecord(entry.modelReasoningEffortMap) } : {}),
|
|
@@ -355,6 +366,7 @@ export function deriveKeyLoginMap(): Record<string, DerivedKeyLoginProvider> {
|
|
|
355
366
|
...(entry.thinkingBudgetModels ? { thinkingBudgetModels: [...entry.thinkingBudgetModels] } : {}),
|
|
356
367
|
...(entry.escapeBuiltinToolNames !== undefined ? { escapeBuiltinToolNames: entry.escapeBuiltinToolNames } : {}),
|
|
357
368
|
...(entry.openaiChatEofTolerance !== undefined ? { openaiChatEofTolerance: entry.openaiChatEofTolerance } : {}),
|
|
369
|
+
...(entry.foldDeveloperRoleToSystem !== undefined ? { foldDeveloperRoleToSystem: entry.foldDeveloperRoleToSystem } : {}),
|
|
358
370
|
...(entry.googleMode ? { googleMode: entry.googleMode } : {}),
|
|
359
371
|
...(entry.project ? { project: entry.project } : {}),
|
|
360
372
|
...(entry.location ? { location: entry.location } : {}),
|
|
@@ -364,7 +376,7 @@ export function deriveKeyLoginMap(): Record<string, DerivedKeyLoginProvider> {
|
|
|
364
376
|
}
|
|
365
377
|
|
|
366
378
|
export function deriveInitProviders(): DerivedInitProvider[] {
|
|
367
|
-
return PROVIDER_REGISTRY.map(entry => ({
|
|
379
|
+
return PROVIDER_REGISTRY.filter(entry => !entry.deprecated).map(entry => ({
|
|
368
380
|
id: entry.id,
|
|
369
381
|
label: formatInitLabel(entry),
|
|
370
382
|
adapter: entry.adapter,
|
|
@@ -391,6 +403,7 @@ export function deriveOAuthIds(): string[] {
|
|
|
391
403
|
|
|
392
404
|
export function deriveProviderPresets(): DerivedProviderPreset[] {
|
|
393
405
|
const presets = PROVIDER_REGISTRY
|
|
406
|
+
.filter(entry => !entry.deprecated)
|
|
394
407
|
.filter(entry => entry.featured || entry.authKind === "key" || entry.dashboardPreset)
|
|
395
408
|
.map(entryToPreset);
|
|
396
409
|
return [...dedupePresets(presets), customPreset()];
|
|
@@ -470,19 +483,33 @@ function applyVerbosityDefaults(prov: OcxProviderConfig, entry: ProviderRegistry
|
|
|
470
483
|
* was skipped and the reasoning ladder was advertised without summary support — exactly the
|
|
471
484
|
* inconsistency that makes Codex drop the inbound reasoning object.
|
|
472
485
|
*
|
|
473
|
-
* Deliberately narrow: reasoning-summary, effort, and replay-compatibility metadata only, via
|
|
486
|
+
* Deliberately narrow: reasoning-summary, effort, structured-output, and replay-compatibility metadata only, via
|
|
474
487
|
* `registryEntryForProviderDestination`, which matches fixed key destinations and refuses
|
|
475
488
|
* templated or overridable base URLs. A custom row keeps its own identity for everything else.
|
|
476
489
|
*/
|
|
477
490
|
function enrichReasoningMetadataByDestination(prov: OcxProviderConfig): void {
|
|
478
491
|
const destination = registryEntryForProviderDestination(prov);
|
|
492
|
+
const capabilities = mergeReasoningModelCapabilities(destination?.modelCapabilities, prov.modelCapabilities);
|
|
493
|
+
if (capabilities) prov.modelCapabilities = capabilities;
|
|
479
494
|
applyReasoningSummaryDefaults(prov, destination?.modelSupportsReasoningSummaries);
|
|
495
|
+
if (destination?.modelDefaultReasoningEfforts) {
|
|
496
|
+
prov.modelDefaultReasoningEfforts = mapFill(destination.modelDefaultReasoningEfforts, prov.modelDefaultReasoningEfforts)[0];
|
|
497
|
+
}
|
|
498
|
+
if (destination?.modelReasoningEffortMap) {
|
|
499
|
+
prov.modelReasoningEffortMap = nestedMapFill(destination.modelReasoningEffortMap, prov.modelReasoningEffortMap)[0];
|
|
500
|
+
}
|
|
501
|
+
if (destination?.noStructuredOutputModels?.length) {
|
|
502
|
+
prov.noStructuredOutputModels = stableUnion(destination.noStructuredOutputModels, prov.noStructuredOutputModels)[0];
|
|
503
|
+
}
|
|
480
504
|
if (prov.dropResponsesReasoningItems === undefined && destination?.dropResponsesReasoningItems !== undefined) {
|
|
481
505
|
prov.dropResponsesReasoningItems = destination.dropResponsesReasoningItems;
|
|
482
506
|
}
|
|
483
507
|
if (destination?.modelReasoningEfforts) {
|
|
484
508
|
prov.modelReasoningEfforts = fillRecordOfArrays(destination.modelReasoningEfforts, prov.modelReasoningEfforts);
|
|
485
509
|
}
|
|
510
|
+
if (destination?.modelDefaultReasoningEfforts) {
|
|
511
|
+
[prov.modelDefaultReasoningEfforts] = mapFill(destination.modelDefaultReasoningEfforts, prov.modelDefaultReasoningEfforts);
|
|
512
|
+
}
|
|
486
513
|
if (prov.reasoningEfforts === undefined && destination?.reasoningEfforts !== undefined) {
|
|
487
514
|
prov.reasoningEfforts = [...destination.reasoningEfforts];
|
|
488
515
|
}
|
|
@@ -496,6 +523,23 @@ export function hasLegacyClinePassReasoningEfforts(name: string, prov: OcxProvid
|
|
|
496
523
|
&& prov.reasoningEfforts[0] === "low";
|
|
497
524
|
}
|
|
498
525
|
|
|
526
|
+
/**
|
|
527
|
+
* The registry's provider-wide `inputModalities` for a row that still points at that entry's
|
|
528
|
+
* destination. Runtime-only: callers apply it to a private copy (vision eligibility) or to the
|
|
529
|
+
* routed provider. Enrichment does not copy it, because init and management writes persist the
|
|
530
|
+
* enriched object, and a saved copy would follow the row to another URL.
|
|
531
|
+
*/
|
|
532
|
+
export function registryInputModalitiesForDestination(name: string, prov: OcxProviderConfig): string[] | undefined {
|
|
533
|
+
let entry = PROVIDER_REGISTRY.find(row => row.id === name);
|
|
534
|
+
if (!entry || !providerMatchesRegistryTransportWithStaticGuards(name, prov)) {
|
|
535
|
+
entry = registryEntryForProviderDestination(prov);
|
|
536
|
+
// Runtime modality authority follows only the canonical fixed-key destination, not aliases.
|
|
537
|
+
if (entry && (entry.adapter !== prov.adapter
|
|
538
|
+
|| normalizedProviderEndpoint(entry.baseUrl) !== normalizedProviderEndpoint(prov.baseUrl))) return undefined;
|
|
539
|
+
}
|
|
540
|
+
return entry?.inputModalities ? [...entry.inputModalities] : undefined;
|
|
541
|
+
}
|
|
542
|
+
|
|
499
543
|
export function enrichProviderFromRegistry(name: string, prov: OcxProviderConfig): void {
|
|
500
544
|
const entry = PROVIDER_REGISTRY.find(row => row.id === name);
|
|
501
545
|
if (!entry || !providerMatchesRegistryTransportWithStaticGuards(name, prov)) {
|
|
@@ -551,6 +595,7 @@ export function enrichProviderFromRegistry(name: string, prov: OcxProviderConfig
|
|
|
551
595
|
// (mapFill in src/providers/resolved-model-policy-merge.ts), so the wire honored the effort while /v1/models and
|
|
552
596
|
// every client export showed no effort control at all.
|
|
553
597
|
if (resolvedStatic.modelReasoningEfforts) prov.modelReasoningEfforts = cloneRecordOfArrays(resolvedStatic.modelReasoningEfforts);
|
|
598
|
+
if (resolvedStatic.modelCapabilities) prov.modelCapabilities = structuredClone(resolvedStatic.modelCapabilities);
|
|
554
599
|
if (!prov.modelDefaultReasoningEfforts && seed.modelDefaultReasoningEfforts) prov.modelDefaultReasoningEfforts = { ...seed.modelDefaultReasoningEfforts };
|
|
555
600
|
if (!prov.reasoningEffortMap && seed.reasoningEffortMap) prov.reasoningEffortMap = { ...seed.reasoningEffortMap };
|
|
556
601
|
if (!prov.modelReasoningEffortMap && seed.modelReasoningEffortMap) prov.modelReasoningEffortMap = cloneNestedRecord(seed.modelReasoningEffortMap);
|
|
@@ -567,6 +612,9 @@ export function enrichProviderFromRegistry(name: string, prov: OcxProviderConfig
|
|
|
567
612
|
if (prov.openaiChatEofTolerance === undefined && seed.openaiChatEofTolerance !== undefined) {
|
|
568
613
|
prov.openaiChatEofTolerance = seed.openaiChatEofTolerance;
|
|
569
614
|
}
|
|
615
|
+
if (prov.foldDeveloperRoleToSystem === undefined && seed.foldDeveloperRoleToSystem !== undefined) {
|
|
616
|
+
prov.foldDeveloperRoleToSystem = seed.foldDeveloperRoleToSystem;
|
|
617
|
+
}
|
|
570
618
|
// Fill-only: a hand-edited path must survive, and a config saved before the registry
|
|
571
619
|
// learned this route still gets backfilled.
|
|
572
620
|
if (prov.responsesPath === undefined && seed.responsesPath !== undefined) prov.responsesPath = seed.responsesPath;
|
|
@@ -633,7 +681,7 @@ export function enrichProviderFromRegistry(name: string, prov: OcxProviderConfig
|
|
|
633
681
|
}
|
|
634
682
|
|
|
635
683
|
export function deriveFeaturedProviderIds(): string[] {
|
|
636
|
-
return PROVIDER_REGISTRY.filter(entry => entry.featured).map(entry => entry.id);
|
|
684
|
+
return PROVIDER_REGISTRY.filter(entry => entry.featured && !entry.deprecated).map(entry => entry.id);
|
|
637
685
|
}
|
|
638
686
|
|
|
639
687
|
export function deriveJawcodeAliases(): Record<string, string> {
|
|
@@ -10,6 +10,8 @@ export const KIRO_MODELS = [
|
|
|
10
10
|
// 260930 preemptive: GPT-6.1 Sol (OpenAI announced 2026-09-29; kiro.dev did not list it on 2026-09-30).
|
|
11
11
|
// Mirrors gpt-6-sol; calls fail upstream until Kiro ships the model.
|
|
12
12
|
"gpt-6.1-sol",
|
|
13
|
+
// 261027 preemptive: GPT-6.1 Terra (mirrors Kiro's GPT-6.1 Sol seed; provider listing unverified).
|
|
14
|
+
"gpt-6.1-terra",
|
|
13
15
|
// 260929 preemptive: Claude Sonnet 5.5 added ahead of Kiro's catalog (kiro.dev did not list it on
|
|
14
16
|
// 2026-09-29). Mirrors claude-sonnet-5; calls fail upstream until Kiro ships the model.
|
|
15
17
|
"claude-sonnet-5.5",
|
|
@@ -46,6 +48,7 @@ export const KIRO_MODEL_CONTEXT_WINDOWS: Record<string, number> = {
|
|
|
46
48
|
"gpt-6-sol": 272_000,
|
|
47
49
|
"gpt-6-luna": 272_000,
|
|
48
50
|
"gpt-6.1-sol": 272_000,
|
|
51
|
+
"gpt-6.1-terra": 272_000,
|
|
49
52
|
"claude-sonnet-5.5": 1_000_000,
|
|
50
53
|
"claude-sonnet-5": 1_000_000,
|
|
51
54
|
"claude-opus-5.5": 1_000_000,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ModelCapabilities } from "../types";
|
|
2
|
+
|
|
3
|
+
// Public MiMo V2.6 exposes an on/off switch, not distinct reasoning strengths.
|
|
4
|
+
export const MIMO_THINKING_MODELS = ["mimo-v2.6-pro", "mimo-v2.6-flash", "mimo-v2.6-pro-ultraspeed"] as const;
|
|
5
|
+
export const MIMO_THINKING_CAPABILITIES: Record<string, ModelCapabilities> = Object.fromEntries(
|
|
6
|
+
MIMO_THINKING_MODELS.map(id => [id, {
|
|
7
|
+
supportsReasoning: true,
|
|
8
|
+
supportsThinkingToggle: true,
|
|
9
|
+
supportsReasoningEffort: false,
|
|
10
|
+
defaultThinkingEnabled: true,
|
|
11
|
+
}]),
|
|
12
|
+
);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { extractWorkBuddyModels } from "./workbuddy-models";
|
|
1
2
|
import type { OcxProviderConfig } from "../types";
|
|
2
3
|
import {
|
|
3
4
|
isValidModelDiscoveryModelId,
|
|
@@ -513,6 +514,7 @@ export function extractProviderModelItems(
|
|
|
513
514
|
discovery: ResolvedProviderModelDiscovery,
|
|
514
515
|
): ProviderModelItemsResult {
|
|
515
516
|
const limit = positiveIntegerAtMost(discovery.maxModels, MODEL_DISCOVERY_MAX_MODELS);
|
|
517
|
+
if (discovery.spec?.format === "workbuddy") return extractWorkBuddyModels(value, limit);
|
|
516
518
|
let data: unknown[];
|
|
517
519
|
let siblings: SiblingIndex | null = null;
|
|
518
520
|
if (Array.isArray(value)) {
|
|
@@ -67,6 +67,7 @@ export const PROVIDER_MODEL_RENAME_ROLES = {
|
|
|
67
67
|
modelContextWindows: "record",
|
|
68
68
|
modelContextTiers: "record",
|
|
69
69
|
modelInputModalities: "record",
|
|
70
|
+
inputModalities: "none",
|
|
70
71
|
modelCapabilities: "record",
|
|
71
72
|
modelMaxInputTokens: "record",
|
|
72
73
|
modelAutoCompactTokenLimits: "record",
|
|
@@ -153,6 +154,7 @@ export const PROVIDER_MODEL_RENAME_ROLES = {
|
|
|
153
154
|
desktopExecutor: "none",
|
|
154
155
|
unsafeAllowNativeLocalExec: "none",
|
|
155
156
|
nativeLocalExec: "none",
|
|
157
|
+
messagePhaseInference: "none",
|
|
156
158
|
tlsProfile: "none",
|
|
157
159
|
} as const satisfies Record<keyof OcxProviderConfig, ModelRenameRole>;
|
|
158
160
|
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
// Everything else in the row is left alone.
|
|
20
20
|
|
|
21
21
|
import { PROVIDER_REGISTRY, normalizedProviderEndpoint } from "./registry";
|
|
22
|
+
import { MINIMAX_M31_FLASH, MINIMAX_M31_FLASH_PREVIEW_RETIRED } from "./registry/model-seeds";
|
|
22
23
|
import { MODEL_KEYED_RECORDS, MODEL_ID_LISTS, MODEL_ID_SCALARS, MODEL_NESTED_RECORDS } from "./model-rename-fields";
|
|
23
24
|
import { providerConfigSeed } from "./derive";
|
|
24
25
|
import type { OcxConfig, OcxProviderConfig } from "../types";
|
|
@@ -138,6 +139,15 @@ export const MODEL_RENAMES: readonly ModelRename[] = [
|
|
|
138
139
|
// may also hold one as a value. 3.8 resolves tiers from its own suffix ladder instead.
|
|
139
140
|
dropReasoningEffortMap: true,
|
|
140
141
|
})),
|
|
142
|
+
// MiniMax shipped M3.1-Flash as generally available on 2026-10-19 and retired the preview
|
|
143
|
+
// id, so a saved MiniMax-M3.1-Flash-Preview selection would answer model-not-found. The
|
|
144
|
+
// stale-roster refresh only matches exact old seeds; this repairs the preview id itself.
|
|
145
|
+
...(["minimax", "minimax-cn"] as const).map(provider => ({
|
|
146
|
+
provider,
|
|
147
|
+
from: MINIMAX_M31_FLASH_PREVIEW_RETIRED,
|
|
148
|
+
to: MINIMAX_M31_FLASH,
|
|
149
|
+
reason: "MiniMax shipped M3.1-Flash as generally available and retired the preview id",
|
|
150
|
+
})),
|
|
141
151
|
];
|
|
142
152
|
|
|
143
153
|
function renameInList(value: unknown, from: string, to: string): string[] | null {
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
type CodexAuthContext,
|
|
6
6
|
type CodexAuthPolicyConfig,
|
|
7
7
|
} from "../codex/auth-context";
|
|
8
|
-
import { poolContextCreditHoldResetAt } from "../codex/pool-credit-policy";
|
|
8
|
+
import { poolContextCreditHoldResetAt, poolContextCreditRecoveryNeeded } from "../codex/pool-credit-policy";
|
|
9
9
|
|
|
10
10
|
export function createOpenAiSidecarCreditGuard(
|
|
11
11
|
context: CodexAuthContext,
|
|
@@ -16,7 +16,7 @@ export function createOpenAiSidecarCreditGuard(
|
|
|
16
16
|
const resetAt = poolContextCreditHoldResetAt(context, policy);
|
|
17
17
|
if (resetAt === undefined) return;
|
|
18
18
|
releaseCodexAuthContextProbeLease(context);
|
|
19
|
-
throw new CodexPoolAccountCreditsOffError(context.accountId, resetAt);
|
|
19
|
+
throw new CodexPoolAccountCreditsOffError(context.accountId, resetAt, poolContextCreditRecoveryNeeded(context, policy), context.quotaScope);
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -203,7 +203,7 @@ export function supportsPerAccountQuota(provider: string): boolean {
|
|
|
203
203
|
|
|
204
204
|
export function explicitAccountReader(provider: string): boolean {
|
|
205
205
|
return provider === "xai" || provider === "cursor" || provider === "kimi" || provider === "command-code"
|
|
206
|
-
|| provider === "devin" || provider === "dsh-account";
|
|
206
|
+
|| provider === "devin" || provider === "workbuddy-ai" || provider === "dsh-account";
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
export function providerOAuthAccountQuotaMode(provider: string): AccountQuotaMode {
|
|
@@ -558,6 +558,7 @@ export function quotaCredentialIdentity(provider: string, accountId: string, cre
|
|
|
558
558
|
// Only credentials that carry their own endpoint (Devin tenants) extend the identity, so
|
|
559
559
|
// every other provider's existing cache keys stay valid.
|
|
560
560
|
...(provider === "devin" && credential.apiBaseUrl ? [credential.apiBaseUrl] : []),
|
|
561
|
+
...(provider === "workbuddy-ai" ? [credential.workbuddy] : []),
|
|
561
562
|
])).digest("hex");
|
|
562
563
|
}
|
|
563
564
|
|
|
@@ -567,5 +568,5 @@ export function explicitQuotaDestination(provider: string, config: OcxProviderCo
|
|
|
567
568
|
if (provider === "command-code") return isCanonicalCommandCodeBaseUrl(config.baseUrl);
|
|
568
569
|
// These readers use fixed canonical billing origins, never config.baseUrl. Devin reads
|
|
569
570
|
// the credential's own allowlisted api-server host instead (fetchDevinQuota revalidates it).
|
|
570
|
-
return provider === "xai" || provider === "cursor" || provider === "devin" || provider === "dsh-account";
|
|
571
|
+
return provider === "xai" || provider === "cursor" || provider === "devin" || provider === "workbuddy-ai" || provider === "dsh-account";
|
|
571
572
|
}
|
|
@@ -3,9 +3,13 @@ import { DestinationDnsResolutionError } from "../../lib/destination-policy";
|
|
|
3
3
|
import { PinnedHttpError, type PinnedHttpErrorCode } from "../../lib/pinned-http";
|
|
4
4
|
import { ProviderOutboundPolicyError, providerOutboundPost, providerRedirectError, type ProviderOutboundDependencies } from "../../lib/provider-outbound";
|
|
5
5
|
import { getValidAccessToken } from "../../oauth";
|
|
6
|
-
import { getAccountCredential, getCredential } from "../../oauth/store";
|
|
6
|
+
import { getAccountCredential, getAccountSet, getCredential } from "../../oauth/store";
|
|
7
7
|
import { asRecord, normalizePercent, normalizeResetAt, readQuotaJson, REQUEST_TIMEOUT_MS, toFiniteNumber } from "../quota-wire";
|
|
8
|
-
import { report, type ProviderQuotaReport } from "./report-cache";
|
|
8
|
+
import { antigravityEvidence, report, type ProviderQuotaReport } from "./report-cache";
|
|
9
|
+
import { captureAntigravityQuotaReceipt, decisionQuotaSinkActive } from "../../lib/decision-quota-sink";
|
|
10
|
+
import { antigravityDecisionWindows } from "../quota-decision-publication";
|
|
11
|
+
import { antigravityQuotaCredentialGeneration, isAntigravityArgonIdentity } from "../antigravity-quota-identity";
|
|
12
|
+
import type { OcxProviderConfig } from "../../types";
|
|
9
13
|
import { quotaCredentialIdentity } from "./account-cache";
|
|
10
14
|
import type { ProviderQuota, ProviderQuotaWindow, QuotaFailureCode } from "../quota-types";
|
|
11
15
|
import { httpQuotaFailure } from "./failure-codes";
|
|
@@ -46,11 +50,6 @@ function quotaInfoEntries(modelInfo: Record<string, unknown>): Record<string, un
|
|
|
46
50
|
return entries;
|
|
47
51
|
}
|
|
48
52
|
|
|
49
|
-
/**
|
|
50
|
-
* Gemini 4 Argon has its own quota pool. Its names also contain "gemini", so every family
|
|
51
|
-
* decision below checks Argon first; otherwise Argon readings fill or replace the Gem family.
|
|
52
|
-
*/
|
|
53
|
-
const ARGON_TOKEN = /(?:^|[^a-z0-9])argon(?:[^a-z0-9]|$)/i;
|
|
54
53
|
const GEMINI_TOKEN = /(?:^|[^a-z0-9])gemini(?:[^a-z0-9]|$)/i;
|
|
55
54
|
const CLAUDE_FAMILY_TOKEN = /(?:^|[^a-z0-9])(?:claude|3p|gpt|opus|sonnet)(?:[^a-z0-9]|$)/i;
|
|
56
55
|
/** Canonical model of the Argon summary pool; tagging keeps the window out of routing. */
|
|
@@ -61,7 +60,7 @@ type AntigravitySummaryFamily = "argon" | "gem" | "cla";
|
|
|
61
60
|
/** A bucket's own id and name decide its family when they name one; the group decides otherwise. */
|
|
62
61
|
function antigravitySummaryBucketFamily(bucket: Record<string, unknown>): AntigravitySummaryFamily | undefined {
|
|
63
62
|
const identity = `${typeof bucket.bucketId === "string" ? bucket.bucketId : ""} ${typeof bucket.displayName === "string" ? bucket.displayName : ""}`;
|
|
64
|
-
if (
|
|
63
|
+
if (isAntigravityArgonIdentity(identity)) return "argon";
|
|
65
64
|
if (GEMINI_TOKEN.test(identity)) return "gem";
|
|
66
65
|
if (CLAUDE_FAMILY_TOKEN.test(identity)) return "cla";
|
|
67
66
|
return undefined;
|
|
@@ -70,7 +69,7 @@ function antigravitySummaryBucketFamily(bucket: Record<string, unknown>): Antigr
|
|
|
70
69
|
function classifyAntigravityFamily(modelId: string, modelInfo: Record<string, unknown>, quotaInfo: Record<string, unknown>): "Gem" | "Cla" | null {
|
|
71
70
|
const displayName = typeof modelInfo.displayName === "string" ? modelInfo.displayName : "";
|
|
72
71
|
// Argon models keep their exact model rows but never seed the shared Gem family bar.
|
|
73
|
-
if (
|
|
72
|
+
if (isAntigravityArgonIdentity(`${modelId} ${displayName}`)) return null;
|
|
74
73
|
const tier = typeof quotaInfo.tier === "string" ? quotaInfo.tier : "";
|
|
75
74
|
const haystack = `${modelId} ${displayName} ${tier}`.toLowerCase();
|
|
76
75
|
if (haystack.includes("gemini")) return "Gem";
|
|
@@ -155,7 +154,7 @@ function parseAntigravityQuotaSummary(body: Record<string, unknown> | null): Pro
|
|
|
155
154
|
const groupDisplayName = typeof group.displayName === "string" ? group.displayName : "";
|
|
156
155
|
const groupName = `${groupDisplayName} ${typeof group.description === "string" ? group.description : ""}`.toLowerCase();
|
|
157
156
|
// A description that merely mentions Argon must not move a whole Gemini group.
|
|
158
|
-
const groupFamily: AntigravitySummaryFamily | undefined =
|
|
157
|
+
const groupFamily: AntigravitySummaryFamily | undefined = isAntigravityArgonIdentity(groupDisplayName) ? "argon"
|
|
159
158
|
: groupName.includes("gemini") ? "gem"
|
|
160
159
|
: groupName.includes("claude") || groupName.includes("3p") || groupName.includes("gpt") ? "cla"
|
|
161
160
|
: undefined;
|
|
@@ -360,13 +359,25 @@ export async function fetchAntigravityUsageQuota(accessToken: string, projectId:
|
|
|
360
359
|
return null;
|
|
361
360
|
}
|
|
362
361
|
|
|
363
|
-
|
|
364
|
-
|
|
362
|
+
/** Every store read uses `provider`, the same key inference resolves, so a row never probes another row's account. */
|
|
363
|
+
export async function fetchAntigravityQuota(provider: string, config: OcxProviderConfig): Promise<ProviderQuotaReport | null> {
|
|
364
|
+
const credential = getCredential(provider);
|
|
365
365
|
if (!credential?.projectId) return null;
|
|
366
366
|
let accessToken: string;
|
|
367
|
-
try { accessToken = await getValidAccessToken(
|
|
367
|
+
try { accessToken = await getValidAccessToken(provider); } catch { return null; }
|
|
368
|
+
const set = decisionQuotaSinkActive() ? getAccountSet(provider) : undefined;
|
|
369
|
+
const account = set?.accounts.find(row => row.id === set.activeAccountId);
|
|
370
|
+
const probed = account?.credential.access === accessToken && account.credential.projectId === credential.projectId ? account : undefined;
|
|
371
|
+
const receipt = probed ? captureAntigravityQuotaReceipt(provider, config, probed.id, antigravityQuotaCredentialGeneration(probed.credential)) : undefined;
|
|
368
372
|
const result = await probeAntigravityUsageQuota(accessToken, credential.projectId);
|
|
369
|
-
if (result.kind === "available")
|
|
373
|
+
if (result.kind === "available") {
|
|
374
|
+
const value = report(provider, result.source, result.quota);
|
|
375
|
+
// Only the summary endpoint reports real family buckets. The models fallback labels one model's
|
|
376
|
+
// counter Gem/Cla, so it stays display-only: no windows, and retained summary clocks survive.
|
|
377
|
+
const windows = result.source === "google-antigravity:retrieveUserQuotaSummary" ? antigravityDecisionWindows(result.quota) : [];
|
|
378
|
+
if (value && receipt) antigravityEvidence.set(value, { receipt, windows: Object.freeze(windows.map(row => Object.freeze(row))) });
|
|
379
|
+
return value;
|
|
380
|
+
}
|
|
370
381
|
if (result.legacy.kind === "throw") throw result.legacy.error;
|
|
371
382
|
return null;
|
|
372
383
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { decisionQuotaSinkActive, invalidateDecisionKeyQuotas,
|
|
1
|
+
import { decisionQuotaSinkActive, invalidateDecisionKeyQuotas, replaceCollectedDecisionQuotas, type AntigravityQuotaObservation, type AntigravityQuotaReceipt, type DecisionKeyObservation } from "../../lib/decision-quota-sink";
|
|
2
2
|
import { providerDecisionWindows } from "../quota-decision-publication";
|
|
3
|
+
import type { DecisionQuotaWindow } from "../quota-decision-snapshot";
|
|
3
4
|
import { createHash } from "node:crypto";
|
|
4
5
|
import { effectiveCodexAuthAccountId, listCodexAuthAccountsSnapshot } from "../../codex/auth-api";
|
|
5
6
|
import { withoutRetiredCodexQuota, type StoredAccountQuota } from "../../codex/quota";
|
|
@@ -21,6 +22,8 @@ export const LAST_GOOD_MAX_AGE_MS = CODEX_CAPACITY_MAX_QUOTA_AGE_MS;
|
|
|
21
22
|
const nativeMainReportGenerations = new WeakMap<ProviderQuotaReport, number>();
|
|
22
23
|
export const accountReportCurrent = new WeakMap<ProviderQuotaReport, () => boolean>();
|
|
23
24
|
export const routingEvidence = new WeakMap<ProviderQuotaReport, ProviderQuotaRoutingEvidence>();
|
|
25
|
+
/** Only the live Antigravity probe binds this projection; display/last-good rows cannot create it. */
|
|
26
|
+
export const antigravityEvidence = new WeakMap<ProviderQuotaReport, { receipt: AntigravityQuotaReceipt; windows: readonly DecisionQuotaWindow[] }>();
|
|
24
27
|
export let providerQuotaBeforePublishForTests: (() => void | Promise<void>) | null = null;
|
|
25
28
|
|
|
26
29
|
/** Test-only seam for identity/config invalidation after probes but before publication. */
|
|
@@ -100,6 +103,7 @@ export function clearProviderQuotaCache(): void {
|
|
|
100
103
|
cache = null;
|
|
101
104
|
clearCachedProviderQuotas();
|
|
102
105
|
clearProviderApiKeyQuotaCache();
|
|
106
|
+
invalidateDecisionKeyQuotas();
|
|
103
107
|
invalidationEpoch += 1;
|
|
104
108
|
}
|
|
105
109
|
|
|
@@ -350,13 +354,18 @@ export function isProviderQuotaReportCurrent(value: ProviderQuotaReport): boolea
|
|
|
350
354
|
/** Called only by an accepted collector/cache publication, never the JEV read path. */
|
|
351
355
|
export function publishCollectedDecisionQuota(reports: ProviderQuotaReport[], config: OcxConfig): void {
|
|
352
356
|
if (!decisionQuotaSinkActive()) return;
|
|
353
|
-
|
|
357
|
+
const keys: DecisionKeyObservation[] = [];
|
|
358
|
+
const oauth: AntigravityQuotaObservation[] = [];
|
|
354
359
|
for (const report of reports) {
|
|
355
360
|
const provider = config.providers[report.provider];
|
|
361
|
+
if (!provider || !isProviderQuotaReportCurrent(report)) continue;
|
|
362
|
+
const observation = antigravityEvidence.get(report);
|
|
363
|
+
if (observation) oauth.push({ name: report.provider, provider, ...observation });
|
|
356
364
|
const evidence = routingEvidence.get(report);
|
|
357
|
-
if (
|
|
358
|
-
|
|
365
|
+
if (evidence && evidence.binding === providerQuotaRoutingBinding(report.provider, provider))
|
|
366
|
+
keys.push({ name: report.provider, provider, windows: providerDecisionWindows(evidence.quota) });
|
|
359
367
|
}
|
|
368
|
+
replaceCollectedDecisionQuotas(keys, oauth);
|
|
360
369
|
}
|
|
361
370
|
|
|
362
371
|
/**
|