@bitkyc08/opencodex 2.100.1 → 2.100.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/gui/dist/assets/App-BpJOzw4F.js +59 -0
- package/gui/dist/assets/Tray-BcaI-VCr.js +1 -0
- package/gui/dist/assets/{brand-mark-nr3ziR-T.js → brand-mark-DU-0Vdkr.js} +1 -1
- package/gui/dist/assets/index-Bbor_y80.js +94 -0
- package/gui/dist/assets/index-DJEkIDAi.css +2 -0
- package/gui/dist/assets/{segment-thumb-features-DKCVUUTi.js → segment-thumb-features-e9A_FogJ.js} +1 -1
- package/gui/dist/classic/assets/{App-CgPBKUP-.js → App-BrIlUiLc.js} +18 -18
- package/gui/dist/classic/assets/{Tray-BedmOsE7.js → Tray-DT146AhS.js} +1 -1
- package/gui/dist/classic/assets/index-DyJHagvT.js +94 -0
- package/gui/dist/classic/assets/quota-summary-CakPe9Ni.js +1 -0
- package/gui/dist/classic/index.html +1 -1
- package/gui/dist/index.html +2 -2
- package/package.json +2 -2
- package/src/adapters/client-fingerprint.ts +5 -3
- package/src/adapters/cursor/native-exec.ts +3 -2
- package/src/adapters/cursor/tool-guidance.ts +3 -3
- package/src/adapters/cursor/tool-wording.ts +10 -1
- package/src/adapters/devin/cloud-direct/tool-schema.ts +20 -2
- package/src/adapters/google-antigravity-wire.ts +13 -6
- package/src/adapters/google-truncation.ts +4 -2
- package/src/adapters/google.ts +8 -2
- package/src/adapters/openai-chat/tool-schema.ts +9 -0
- package/src/adapters/openai-responses/tool-schema.ts +18 -4
- package/src/adapters/run-turn-queue.ts +139 -5
- package/src/adapters/upstream-http-error.ts +4 -2
- package/src/bridge/sse.ts +8 -1
- package/src/claude/chat-tool-dispatch.ts +233 -0
- package/src/claude/inbound-tool-loading.ts +42 -17
- package/src/cli/account-api.ts +6 -0
- package/src/cli/account-extended.ts +60 -6
- package/src/cli/account-key-quota.ts +22 -2
- package/src/cli/account.ts +1 -1
- package/src/cli/capabilities-access-remote.ts +10 -0
- package/src/cli/capabilities-agents-routing.ts +2 -2
- package/src/cli/capabilities-base.ts +2 -2
- package/src/cli/claude.ts +19 -14
- package/src/cli/config-command.ts +24 -1
- package/src/cli/connect.ts +36 -3
- package/src/cli/gui-pair-client.ts +23 -2
- package/src/cli/help.ts +1 -1
- package/src/cli/hub.ts +18 -1
- package/src/cli/link-child-ops.ts +136 -0
- package/src/cli/link-status-child.ts +94 -0
- package/src/cli/link.ts +22 -9
- package/src/cli/registry.ts +3 -2
- package/src/cli/sync-command.ts +3 -1
- package/src/cli/sync-fanout.ts +8 -81
- package/src/client/link-readiness.ts +16 -6
- package/src/client/link-tunnel-status.ts +76 -0
- package/src/clients/config-export.ts +14 -1
- package/src/codex/account-resume-health.ts +41 -0
- package/src/codex/auth-api/login-flow.ts +6 -0
- package/src/codex/auth-api/routes.ts +35 -2
- package/src/codex/catalog/gather-capture.ts +2 -0
- package/src/codex/catalog/provider-models.ts +13 -8
- package/src/codex/convergence-types.ts +2 -0
- package/src/codex/quota.ts +111 -6
- package/src/combos/cooldown-store.ts +208 -0
- package/src/combos/failover.ts +432 -35
- package/src/config/salvage.ts +1 -0
- package/src/config/schema/config-schema.ts +6 -3
- package/src/config/schema/leaf-validators.ts +34 -12
- package/src/generated/compatibility-version.json +213 -121
- package/src/lib/catalog-etag.ts +10 -0
- package/src/lib/client-error-body.ts +15 -0
- package/src/lib/context-overflow-verdict.ts +266 -9
- package/src/lib/failure-detail.ts +72 -3
- package/src/lib/hard-refusal.ts +259 -0
- package/src/link/child-activity.ts +57 -0
- package/src/link/child-catalog-freshness.ts +149 -0
- package/src/link/child-gated-ocx.ts +117 -0
- package/src/link/child-observations.ts +205 -0
- package/src/link/child-observe.ts +121 -0
- package/src/link/child-ops-engine.ts +162 -0
- package/src/link/child-update-contract.ts +165 -0
- package/src/link/paths.ts +5 -0
- package/src/link/remote-windows.ts +42 -6
- package/src/link/ssh-argv.ts +126 -32
- package/src/link/status-projection.ts +73 -0
- package/src/link/sync-fanout-classify.ts +98 -0
- package/src/link/tunnel-state.ts +10 -4
- package/src/messaging/mcp-queue-rpc.ts +2 -1
- package/src/messaging/mcp-queue-server.ts +5 -0
- package/src/messaging/mcp-reply-tools.ts +24 -9
- package/src/messaging/mcp-reply-wait.ts +70 -0
- package/src/oauth/account-resume-health.ts +60 -0
- package/src/oauth/index.ts +1 -0
- package/src/oauth/store.ts +44 -1
- package/src/providers/api-key-pause-state.ts +23 -0
- package/src/providers/api-key-pause.ts +68 -10
- package/src/providers/api-key-selection-capture.ts +3 -1
- package/src/providers/api-key-selection.ts +3 -2
- package/src/providers/api-keys.ts +18 -5
- package/src/providers/claude-cli-usage-state.ts +11 -6
- package/src/providers/claude-cli-usage.ts +27 -9
- package/src/providers/codex-capacity.ts +11 -2
- package/src/providers/key-failover.ts +13 -6
- package/src/providers/model-discovery-config.ts +31 -0
- package/src/providers/model-discovery-diagnostic.ts +34 -3
- package/src/providers/model-discovery.ts +43 -7
- package/src/providers/model-rename-fields.ts +2 -0
- package/src/providers/openai-sidecar.ts +15 -2
- package/src/providers/provider-id-rewrite.ts +3 -0
- package/src/providers/quota/account-cache.ts +52 -34
- package/src/providers/quota/anthropic-usage-windows.ts +19 -9
- package/src/providers/quota/report-cache.ts +53 -5
- package/src/providers/quota/vendor-probes-key.ts +73 -0
- package/src/providers/quota/vendor-probes-oauth.ts +57 -3
- package/src/providers/quota-key-accounts.ts +12 -5
- package/src/providers/quota-mistral-budget.ts +18 -0
- package/src/providers/quota-types.ts +25 -0
- package/src/providers/quota.ts +22 -22
- package/src/providers/reasoning-metadata.ts +1051 -12
- package/src/quota/reset-observer.ts +4 -2
- package/src/quota/reset-seen-store.ts +9 -0
- package/src/quota/window-mapping.ts +1 -0
- package/src/quota-pool/assemble.ts +4 -1
- package/src/responses/hosted-tool-policy.ts +56 -12
- package/src/router.ts +2 -0
- package/src/server/auth-cors.ts +11 -8
- package/src/server/catalog-download.ts +3 -5
- package/src/server/chat-native.ts +11 -2
- package/src/server/claude-messages.ts +2 -1
- package/src/server/images.ts +41 -13
- package/src/server/index/link-listener.ts +16 -2
- package/src/server/index/link-relay-sessions.ts +43 -2
- package/src/server/index/optional-listeners.ts +18 -0
- package/src/server/management/config-routes.ts +7 -1
- package/src/server/management/context.ts +1 -1
- package/src/server/management/link-child-ops-routes.ts +116 -0
- package/src/server/management/link-route-state.ts +10 -0
- package/src/server/management/link-routes.ts +10 -0
- package/src/server/management/oauth-account-routes.ts +33 -4
- package/src/server/management/provider-overwrite-carry.ts +28 -3
- package/src/server/management/provider-routes.ts +16 -11
- package/src/server/management/route-registry.ts +3 -0
- package/src/server/messages-native.ts +5 -0
- package/src/server/request-log-failure-detail.ts +59 -1
- package/src/server/responses/adapter-dispatch.ts +35 -44
- package/src/server/responses/combo-stream-preflight.ts +146 -29
- package/src/server/responses/compact.ts +16 -5
- package/src/server/responses/context-overflow.ts +58 -2
- package/src/server/responses/core-combo-failure.ts +29 -4
- package/src/server/responses/core-combo-native.ts +3 -1
- package/src/server/responses/core-combo.ts +30 -3
- package/src/server/responses/core-errors.ts +3 -1
- package/src/server/responses/core-opaque-recovery.ts +45 -2
- package/src/server/responses/core-options.ts +12 -0
- package/src/server/responses/passthrough-dispatch.ts +30 -38
- package/src/server/responses/request-transport.ts +43 -14
- package/src/server/responses/reset-replay.ts +58 -2
- package/src/server/responses/run-turn-execution.ts +56 -30
- package/src/types/claude-tool-loading.ts +48 -0
- package/src/types/config.ts +5 -35
- package/src/types/provider.ts +21 -0
- package/src/types.ts +1 -0
- package/src/web-search/parse.ts +21 -2
- package/gui/dist/assets/App-g3Cm2xhZ.js +0 -59
- package/gui/dist/assets/Tray-BMDkAiXy.js +0 -1
- package/gui/dist/assets/index-Bziu8gTy.css +0 -2
- package/gui/dist/assets/index-OYzhQUNP.js +0 -94
- package/gui/dist/classic/assets/index-BR-HhNrp.js +0 -94
- package/gui/dist/classic/assets/quota-summary-CXKhvSmQ.js +0 -1
package/src/providers/quota.ts
CHANGED
|
@@ -16,11 +16,12 @@ import {
|
|
|
16
16
|
kiroUsageContextForAccount,
|
|
17
17
|
} from "./kiro-usage";
|
|
18
18
|
import { mapQuotaRoster, readProviderApiKeyQuotas, type ProviderApiKeyQuota } from "./quota-key-accounts";
|
|
19
|
+
import { mistralUnknownBudgetWindows } from "./quota-mistral-budget";
|
|
19
20
|
import type { OcxConfig, OcxProviderConfig } from "../types";
|
|
20
21
|
import { isPassiveRead } from "../lib/passive-read";
|
|
21
22
|
import type { ProviderQuota, QuotaFailureCode } from "./quota-types";
|
|
22
23
|
import {
|
|
23
|
-
accountReportCurrent,
|
|
24
|
+
accountReportCurrent, observedQuotaFor,
|
|
24
25
|
AUTHORITATIVE_EMPTY_QUOTA,
|
|
25
26
|
bumpProviderQuotaInvalidationEpoch,
|
|
26
27
|
captureProviderReportEpochs, providerReportEpochChanged,
|
|
@@ -33,7 +34,7 @@ import {
|
|
|
33
34
|
isProviderQuotaReportCurrent,
|
|
34
35
|
LAST_GOOD_MAX_AGE_MS,
|
|
35
36
|
providerQuotaBeforePublishForTests,
|
|
36
|
-
routingEvidence, publishCollectedDecisionQuota,
|
|
37
|
+
routingEvidence, publishCollectedDecisionQuota, keyReportCredentialIds, keyReportCredentialCurrent, validateJoinedReports,
|
|
37
38
|
setProviderQuotaReportCache,
|
|
38
39
|
TERMINAL_QUOTA_FAILURE,
|
|
39
40
|
type CodexAuthAccountsSnapshotPromise,
|
|
@@ -175,15 +176,17 @@ let pendingProviderObservation: Promise<void> = Promise.resolve();
|
|
|
175
176
|
/**
|
|
176
177
|
* Stable per-account observation key for one provider report.
|
|
177
178
|
*
|
|
178
|
-
* OAuth providers key by active account id.
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
179
|
+
* OAuth providers key by active account id. A probe-bound key report instead carries the
|
|
180
|
+
* full digest of the credential it actually sent (report-cache), because the 8-character
|
|
181
|
+
* apiKeyPoolEntryId is a cache discriminator, not an identity: two distinct keys can share
|
|
182
|
+
* it, and that collision must not hand one key's baseline to another. Providers without
|
|
183
|
+
* that binding keep the legacy id byte for byte, so their persisted baselines survive.
|
|
183
184
|
*/
|
|
184
|
-
function providerObservationAccountKey(provider: string, config: OcxConfig): string {
|
|
185
|
+
function providerObservationAccountKey(provider: string, config: OcxConfig, report?: ProviderQuotaReport): string {
|
|
185
186
|
const oauthAccountId = getAccountSet(provider)?.activeAccountId;
|
|
186
187
|
if (oauthAccountId !== undefined) return `${provider}\u0000${oauthAccountId}`;
|
|
188
|
+
const probed = report && keyReportCredentialIds.get(report);
|
|
189
|
+
if (probed) return `${provider}\u0000key:${probed}`;
|
|
187
190
|
const providerConfig = config.providers[provider];
|
|
188
191
|
const resolvedKey = typeof providerConfig?.apiKey === "string"
|
|
189
192
|
? resolveEnvValue(providerConfig.apiKey)?.trim()
|
|
@@ -207,8 +210,9 @@ function notifyProviderQuotaSnapshot(
|
|
|
207
210
|
// Claude CLI rows are display-only: one reset key would span every account that signs in.
|
|
208
211
|
const observations = reports.filter(report => config.providers[report.provider]?.adapter !== "claude-cli").map(report => ({
|
|
209
212
|
scope: report.provider,
|
|
210
|
-
accountKey: providerObservationAccountKey(report.provider, config),
|
|
211
|
-
quota: report.quota,
|
|
213
|
+
accountKey: providerObservationAccountKey(report.provider, config, report),
|
|
214
|
+
quota: observedQuotaFor.get(report) ?? report.quota,
|
|
215
|
+
...(report.source === "mistral:budget" ? { retainUnknownWindows: mistralUnknownBudgetWindows(report.quota) } : {}),
|
|
212
216
|
}));
|
|
213
217
|
if (observations.length === 0) return;
|
|
214
218
|
pendingProviderObservation = pendingProviderObservation
|
|
@@ -216,13 +220,7 @@ function notifyProviderQuotaSnapshot(
|
|
|
216
220
|
const observer = await import("../quota/reset-observer");
|
|
217
221
|
if (!observer.hasQuotaResetSink()) return;
|
|
218
222
|
const { providerWindowObservations } = await import("../quota/window-mapping");
|
|
219
|
-
for (const observation of observations) {
|
|
220
|
-
observer.observeQuotaSnapshot({
|
|
221
|
-
scope: observation.scope,
|
|
222
|
-
accountKey: observation.accountKey,
|
|
223
|
-
windows: providerWindowObservations(observation.quota),
|
|
224
|
-
});
|
|
225
|
-
}
|
|
223
|
+
for (const observation of observations) observer.observeQuotaSnapshot({ scope: observation.scope, accountKey: observation.accountKey, windows: providerWindowObservations(observation.quota), ...(observation.retainUnknownWindows ? { retainUnknownWindows: observation.retainUnknownWindows } : {}) });
|
|
226
224
|
})
|
|
227
225
|
.catch(() => {
|
|
228
226
|
// Detection is best-effort: a quota refresh must never fail because of it. Swallowing
|
|
@@ -238,7 +236,7 @@ export function flushProviderQuotaObservationsForTests(): Promise<void> {
|
|
|
238
236
|
/** Collect provider quota reports, using the cache unless refresh is forced, and publish the secret-free decision evidence from the collected reports. */
|
|
239
237
|
export async function fetchProviderQuotaReports(config: OcxConfig, forceRefresh = false): Promise<ProviderQuotaResponse> {
|
|
240
238
|
// A passive read (a Remote Link Child's, #6959) shows the held reports and starts nothing.
|
|
241
|
-
if (isPassiveRead()) { const held = heldProviderQuotaReports(
|
|
239
|
+
if (isPassiveRead()) { const held = heldProviderQuotaReports(config); return { ...held, reports: refreshHeldClaudeCliReports(config, held.reports) }; }
|
|
242
240
|
// A Pool report's cache signature and provider fetch must share one account snapshot.
|
|
243
241
|
// Preserve force semantics when deciding whether that snapshot refreshes upstream data.
|
|
244
242
|
const prefetchedCodexSnapshot = hasCodexPoolProvider(config)
|
|
@@ -258,16 +256,18 @@ export async function fetchProviderQuotaReports(config: OcxConfig, forceRefresh
|
|
|
258
256
|
// configured passive provider makes this predicate permanently false, so every dashboard
|
|
259
257
|
// poll re-probes every OTHER provider upstream instead of serving the 5-minute cache.
|
|
260
258
|
const currentCache = getProviderQuotaReportCache();
|
|
259
|
+
// The cache key is a cheap discriminator, not an identity: the stored response is
|
|
260
|
+
// re-validated against this caller's configuration before it is served.
|
|
261
261
|
const cacheFresh = currentCache && currentCache.key === key && now - currentCache.ts < CACHE_TTL_MS
|
|
262
262
|
&& currentCache.response.reports.every(item =>
|
|
263
263
|
(item.observed === true || now - item.updatedAt < LAST_GOOD_MAX_AGE_MS)
|
|
264
|
-
&& (config.providers[item.provider]?.adapter === "claude-cli" || isProviderQuotaReportCurrent(item)));
|
|
264
|
+
&& (config.providers[item.provider]?.adapter === "claude-cli" || isProviderQuotaReportCurrent(item)) && keyReportCredentialCurrent(item, config.providers[item.provider]));
|
|
265
265
|
if (!forceRefresh && cacheFresh) {
|
|
266
266
|
const response = currentCache!.response, reports = refreshHeldClaudeCliReports(config, response.reports);
|
|
267
267
|
return reports === response.reports ? response : { ...response, reports };
|
|
268
268
|
}
|
|
269
269
|
const joinable = inflight.get(key);
|
|
270
|
-
if (!forceRefresh && joinable && joinable.epoch === invalidationEpoch) return joinable.promise;
|
|
270
|
+
if (!forceRefresh && joinable && joinable.epoch === invalidationEpoch) return validateJoinedReports(await joinable.promise, config);
|
|
271
271
|
// A forced probe takes commit authority: older in-flight probes must not overwrite its result.
|
|
272
272
|
if (forceRefresh) bumpProviderQuotaInvalidationEpoch();
|
|
273
273
|
const epoch = invalidationEpoch;
|
|
@@ -309,11 +309,11 @@ export async function fetchProviderQuotaReports(config: OcxConfig, forceRefresh
|
|
|
309
309
|
// Same exemption as the fast path. A passive row reaching `previous` is not a probe
|
|
310
310
|
// that went quiet — there is no probe — so age cannot condemn it.
|
|
311
311
|
if (item.observed !== true && item.updatedAt < cutoff) continue;
|
|
312
|
-
if (isProviderQuotaReportCurrent(item)) byProvider.set(item.provider, item);
|
|
312
|
+
if (isProviderQuotaReportCurrent(item) && keyReportCredentialCurrent(item, config.providers[item.provider])) byProvider.set(item.provider, item);
|
|
313
313
|
else generationMismatchedProviders.add(item.provider);
|
|
314
314
|
}
|
|
315
315
|
for (const item of fresh) {
|
|
316
|
-
if (isProviderQuotaReportCurrent(item)) {
|
|
316
|
+
if (isProviderQuotaReportCurrent(item) && keyReportCredentialCurrent(item, config.providers[item.provider])) {
|
|
317
317
|
byProvider.set(item.provider, item);
|
|
318
318
|
generationMismatchedProviders.delete(item.provider);
|
|
319
319
|
} else {
|