@bitkyc08/opencodex 2.7.36 → 2.7.38-preview.20260724
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/{index-ZmFopEYw.js → index-CprFnVjr.js} +8 -8
- package/gui/dist/index.html +1 -1
- package/package.json +1 -1
- package/src/cli/doctor.ts +197 -2
- package/src/cli/index.ts +11 -1
- package/src/cli/status.ts +80 -0
- package/src/cli/v2.ts +14 -2
- package/src/codex/catalog/bundled.ts +83 -27
- package/src/codex/catalog/effort.ts +95 -3
- package/src/codex/catalog/parsing.ts +17 -0
- package/src/codex/exec-invocation.ts +22 -0
- package/src/codex/runtime.ts +513 -0
- package/src/config.ts +21 -1
- package/src/lib/bun-stream-caps.ts +88 -0
- package/src/lib/crash-guard.ts +3 -1
- package/src/responses/parser.ts +1 -0
- package/src/server/index.ts +9 -1
- package/src/server/management/config-routes.ts +79 -3
- package/src/server/management/shared.ts +6 -6
- package/src/server/management/system-routes.ts +65 -0
- package/src/server/management-api.ts +3 -1
- package/src/server/memory-watchdog.ts +112 -0
- package/src/server/relay-eager.ts +199 -0
- package/src/server/relay.ts +131 -81
- package/src/server/responses/collaboration.ts +20 -3
- package/src/server/responses/core.ts +52 -1
- package/src/types.ts +11 -0
- package/src/usage/cost.ts +0 -0
- package/src/usage/expected-prices.ts +19 -0
- package/src/usage/summary.ts +11 -8
package/src/usage/summary.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { baseProviderLabel } from "../providers/label";
|
|
|
2
2
|
import { canonicalAntigravityUsageModel } from "../providers/antigravity-models";
|
|
3
3
|
import { usageDisplayTotalTokens } from "./totals";
|
|
4
4
|
import type { PersistedUsageEntry, UsageStatus } from "./log";
|
|
5
|
-
import { estimateComboCost, estimateRequestCost } from "./cost";
|
|
5
|
+
import { estimateComboCost, estimateRequestCost, effectiveServiceTier } from "./cost";
|
|
6
6
|
|
|
7
7
|
export type UsageRange = "7d" | "30d" | "all";
|
|
8
8
|
export type UsageSurface = "all" | "codex" | "claude";
|
|
@@ -268,16 +268,17 @@ function finalizeCoverage(totals: UsageSummaryTotals): void {
|
|
|
268
268
|
|
|
269
269
|
function addEstimatedCost(
|
|
270
270
|
totals: UsageSummaryTotals,
|
|
271
|
-
entry: Pick<PersistedUsageEntry, "provider" | "model" | "usageStatus" | "usage" | "attempts">,
|
|
271
|
+
entry: Pick<PersistedUsageEntry, "provider" | "model" | "usageStatus" | "usage" | "attempts" | "responseServiceTier" | "requestedServiceTier" | "configuredServiceTier">,
|
|
272
272
|
): void {
|
|
273
273
|
if (entry.usageStatus === "unreported" || entry.usageStatus === "unsupported"
|
|
274
274
|
|| (!entry.usage && !entry.attempts?.length)) {
|
|
275
275
|
totals.unmeteredRequests += 1;
|
|
276
276
|
return;
|
|
277
277
|
}
|
|
278
|
+
const tier = effectiveServiceTier(entry);
|
|
278
279
|
const estimate = entry.attempts?.length
|
|
279
|
-
? estimateComboCost(entry.attempts)
|
|
280
|
-
: estimateRequestCost({ provider: entry.provider, model: entry.model, usage: entry.usage, usageStatus: entry.usageStatus });
|
|
280
|
+
? estimateComboCost(entry.attempts, undefined, tier)
|
|
281
|
+
: estimateRequestCost({ provider: entry.provider, model: entry.model, usage: entry.usage, usageStatus: entry.usageStatus, serviceTier: tier });
|
|
281
282
|
if (!estimate) {
|
|
282
283
|
totals.unpricedRequests += 1;
|
|
283
284
|
return;
|
|
@@ -389,9 +390,10 @@ function buildModels(entries: PersistedUsageEntry[], totalTokens: number): Usage
|
|
|
389
390
|
}
|
|
390
391
|
// Accumulate per-model estimated cost
|
|
391
392
|
for (const entry of entries) {
|
|
393
|
+
const tier = effectiveServiceTier(entry);
|
|
392
394
|
const estimate = entry.attempts?.length
|
|
393
|
-
? estimateComboCost(entry.attempts)
|
|
394
|
-
: estimateRequestCost({ provider: entry.provider, model: entry.model, usage: entry.usage, usageStatus: entry.usageStatus });
|
|
395
|
+
? estimateComboCost(entry.attempts, undefined, tier)
|
|
396
|
+
: estimateRequestCost({ provider: entry.provider, model: entry.model, usage: entry.usage, usageStatus: entry.usageStatus, serviceTier: tier });
|
|
395
397
|
if (!estimate) continue;
|
|
396
398
|
|
|
397
399
|
if (entry.attempts?.length && estimate.attempts) {
|
|
@@ -457,9 +459,10 @@ function buildProviders(entries: PersistedUsageEntry[], totalTokens: number): Us
|
|
|
457
459
|
}
|
|
458
460
|
}
|
|
459
461
|
for (const entry of entries) {
|
|
462
|
+
const tier = effectiveServiceTier(entry);
|
|
460
463
|
const estimate = entry.attempts?.length
|
|
461
|
-
? estimateComboCost(entry.attempts)
|
|
462
|
-
: estimateRequestCost({ provider: entry.provider, model: entry.model, usage: entry.usage, usageStatus: entry.usageStatus });
|
|
464
|
+
? estimateComboCost(entry.attempts, undefined, tier)
|
|
465
|
+
: estimateRequestCost({ provider: entry.provider, model: entry.model, usage: entry.usage, usageStatus: entry.usageStatus, serviceTier: tier });
|
|
463
466
|
if (!estimate) continue;
|
|
464
467
|
|
|
465
468
|
if (entry.attempts?.length && estimate.attempts) {
|