@bitkyc08/opencodex 2.100.0 → 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-DU-0Vdkr.js +1 -0
- 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-CcxZBnxv.js → segment-thumb-features-e9A_FogJ.js} +1 -1
- package/gui/dist/classic/assets/{App-aYgIQMxI.js → App-BrIlUiLc.js} +18 -18
- package/gui/dist/classic/assets/{Tray-D8jfUXpQ.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/anthropic-image-normalize.ts +1 -1
- package/src/adapters/client-fingerprint.ts +6 -4
- 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/mistral-image-limit.ts +28 -15
- package/src/adapters/openai-chat/tool-schema.ts +9 -0
- package/src/adapters/openai-chat-images.ts +100 -0
- package/src/adapters/openai-chat.ts +6 -9
- 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 +227 -135
- package/src/lib/catalog-etag.ts +10 -0
- package/src/lib/client-error-body.ts +15 -0
- package/src/lib/config-ownership.ts +9 -2
- 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/anthropic-model-quota.ts +12 -0
- package/src/oauth/anthropic-routing.ts +11 -4
- package/src/oauth/index.ts +1 -0
- package/src/oauth/kiro-iam-identity-center.ts +4 -1
- 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-identity.ts +9 -3
- package/src/providers/claude-cli-usage-state.ts +11 -6
- package/src/providers/claude-cli-usage.ts +27 -8
- 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-family-headers.ts +8 -1
- package/src/providers/quota/anthropic-usage-windows.ts +66 -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 +32 -0
- package/src/providers/quota.ts +22 -22
- package/src/providers/reasoning-metadata.ts +1051 -12
- package/src/providers/registry/entries-extended.ts +3 -1
- package/src/providers/registry/model-ids.ts +1 -0
- package/src/providers/registry/types.ts +6 -0
- 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/responses/retained-compaction.ts +31 -5
- 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 +27 -4
- 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 +44 -4
- package/gui/dist/assets/App-CitvEefy.js +0 -59
- package/gui/dist/assets/Tray-CeKVWQyB.js +0 -1
- package/gui/dist/assets/brand-mark-M92UnxX2.js +0 -1
- package/gui/dist/assets/index-BP47do6-.js +0 -94
- package/gui/dist/assets/index-DmDooSAG.css +0 -2
- package/gui/dist/classic/assets/index-CfGqHooN.js +0 -94
- package/gui/dist/classic/assets/quota-summary-R-ih7OlS.js +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mistral budget windows the reset detector may keep while their percent is unknown.
|
|
3
|
+
*
|
|
4
|
+
* This lives beside the provider quota seam rather than in src/quota/: src/providers/quota.ts is
|
|
5
|
+
* statically reachable from the core request path, and tests/usage/quota-reset-core-boundary.test.ts
|
|
6
|
+
* keeps every src/quota module off that path. The seam calls this on every Mistral report, so it
|
|
7
|
+
* must stay a plain import with no dependency on the reset subsystem.
|
|
8
|
+
*/
|
|
9
|
+
export function mistralUnknownBudgetWindows(
|
|
10
|
+
quota: { unknownBudgetWindows?: ReadonlyArray<{ label: string; resetAt?: number }> },
|
|
11
|
+
): { window: string; resetAt: number }[] {
|
|
12
|
+
return (quota.unknownBudgetWindows ?? []).flatMap(entry => {
|
|
13
|
+
const match = /^(API budget|Vibe budget)(?: \((?:FREE|INDIVIDUAL|EDU|TEAM)\))?$/.exec(entry.label);
|
|
14
|
+
return match && typeof entry.resetAt === "number" && Number.isFinite(entry.resetAt) && entry.resetAt > 0
|
|
15
|
+
? [{ window: `custom:${match[1]}`, resetAt: entry.resetAt }]
|
|
16
|
+
: [];
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
|
|
11
11
|
export const PROVIDER_QUOTA_MAX_AGE_MS = 30 * 60_000;
|
|
12
12
|
|
|
13
|
+
// Process-local authority: display readings must not acquire key-selection authority.
|
|
14
|
+
const displayOnlyQuotas = new WeakSet<ProviderQuota>();
|
|
15
|
+
export function markDisplayOnlyQuota(quota: ProviderQuota): ProviderQuota {
|
|
16
|
+
displayOnlyQuotas.add(quota);
|
|
17
|
+
return quota;
|
|
18
|
+
}
|
|
19
|
+
export function isDisplayOnlyQuota(quota: ProviderQuota): boolean {
|
|
20
|
+
return displayOnlyQuotas.has(quota);
|
|
21
|
+
}
|
|
22
|
+
|
|
13
23
|
/** Management-only eligibility evidence; private credential binding never leaves the server. */
|
|
14
24
|
export type ProviderRoutingQuota =
|
|
15
25
|
| { state: "unknown" }
|
|
@@ -17,6 +27,8 @@ export type ProviderRoutingQuota =
|
|
|
17
27
|
|
|
18
28
|
export interface ProviderQuotaWindow {
|
|
19
29
|
label: string;
|
|
30
|
+
/** Presentation text only; identity and routing use label and structured fields. */
|
|
31
|
+
displayLabel?: string;
|
|
20
32
|
percent: number;
|
|
21
33
|
resetAt?: number;
|
|
22
34
|
/**
|
|
@@ -37,6 +49,13 @@ export interface ProviderQuotaWindow {
|
|
|
37
49
|
* provider-wide group named "Opus" there would otherwise be mistaken for a per-model window.
|
|
38
50
|
*/
|
|
39
51
|
scope?: "model";
|
|
52
|
+
/**
|
|
53
|
+
* Share of the provider-wide weekly limit a model-scoped window may consume, in percent:
|
|
54
|
+
* Anthropic's `weekly_scoped_shares[].allowance_percent_of_weekly` (Fable is "up to 50% of
|
|
55
|
+
* your weekly limit"). `percent` stays relative to this allowance. Read from upstream, never
|
|
56
|
+
* inferred from a plan; ranking restates family usage on the weekly scale with it.
|
|
57
|
+
*/
|
|
58
|
+
weeklyAllowancePercent?: number;
|
|
40
59
|
/** Passive family readings have their own freshness clock, independent of active probes. */
|
|
41
60
|
passiveObservedAt?: number;
|
|
42
61
|
/** Upstream refusal evidence, distinct from a measured utilization counter. */
|
|
@@ -53,6 +72,8 @@ export interface ProviderQuotaCreditsUsd {
|
|
|
53
72
|
}
|
|
54
73
|
|
|
55
74
|
export interface ProviderQuota {
|
|
75
|
+
/** Display-only budget windows for which the upstream did not provide a usable entitlement. */
|
|
76
|
+
unknownBudgetWindows?: { label: string; resetAt?: number }[];
|
|
56
77
|
/** Display-only subscription credits; not a routing or exhaustion window. */
|
|
57
78
|
workbuddyCredits?: import("./workbuddy-credit-balance").WorkBuddyCreditBalance;
|
|
58
79
|
fiveHourPercent?: number;
|
|
@@ -65,6 +86,12 @@ export interface ProviderQuota {
|
|
|
65
86
|
kiroCreditsUsed?: number;
|
|
66
87
|
kiroCreditsLimit?: number;
|
|
67
88
|
customWindows?: ProviderQuotaWindow[];
|
|
89
|
+
/**
|
|
90
|
+
* Display-only measurements the producer withheld from routing: Anthropic model-scoped rows
|
|
91
|
+
* that upstream reports with `is_active: false`. Routing, exhaustion, cooldown recovery and
|
|
92
|
+
* reset ordering read only `customWindows`; nothing but quota display reads this field.
|
|
93
|
+
*/
|
|
94
|
+
displayWindows?: ProviderQuotaWindow[];
|
|
68
95
|
creditsUsd?: ProviderQuotaCreditsUsd;
|
|
69
96
|
updatedAt: number;
|
|
70
97
|
}
|
|
@@ -89,3 +116,8 @@ export type QuotaFailureCode = typeof QUOTA_FAILURE_CODES[number];
|
|
|
89
116
|
export function parseQuotaFailureCode(value: unknown): QuotaFailureCode | undefined {
|
|
90
117
|
return QUOTA_FAILURE_CODES.find(code => code === value);
|
|
91
118
|
}
|
|
119
|
+
|
|
120
|
+
/** A model family's share of the weekly limit is meaningful only as a finite percent in (0, 100]. */
|
|
121
|
+
export function isWeeklyAllowancePercent(value: unknown): value is number {
|
|
122
|
+
return typeof value === "number" && Number.isFinite(value) && value > 0 && value <= 100;
|
|
123
|
+
}
|
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 {
|