@vtxmacro/cli 2026.9.22 → 2026.9.24
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/vtx-service-bootstrap.js +1 -1
- package/bin/vtx.js +79 -62
- package/package.json +1 -1
|
@@ -16,7 +16,7 @@ import { fileURLToPath } from "node:url";
|
|
|
16
16
|
// agent-cli-release.json
|
|
17
17
|
var agent_cli_release_default = {
|
|
18
18
|
package_name: "@vtxmacro/cli",
|
|
19
|
-
package_version: "2026.9.
|
|
19
|
+
package_version: "2026.9.24",
|
|
20
20
|
codex_package_name: "@openai/codex",
|
|
21
21
|
codex_version: "0.153.3",
|
|
22
22
|
copilot_sdk_package_name: "@github/copilot-sdk",
|
package/bin/vtx.js
CHANGED
|
@@ -69,7 +69,7 @@ var init_agent_cli_release = __esm({
|
|
|
69
69
|
"agent-cli-release.json"() {
|
|
70
70
|
agent_cli_release_default = {
|
|
71
71
|
package_name: "@vtxmacro/cli",
|
|
72
|
-
package_version: "2026.9.
|
|
72
|
+
package_version: "2026.9.24",
|
|
73
73
|
codex_package_name: "@openai/codex",
|
|
74
74
|
codex_version: "0.153.3",
|
|
75
75
|
copilot_sdk_package_name: "@github/copilot-sdk",
|
|
@@ -22390,8 +22390,9 @@ child.once('close', async (code, signal) => {
|
|
|
22390
22390
|
throw new CodexAppServerError({
|
|
22391
22391
|
message: "Codex request was cancelled before dispatch.",
|
|
22392
22392
|
category: "cancelled",
|
|
22393
|
-
code: "
|
|
22394
|
-
retryable: false
|
|
22393
|
+
code: "rpc_cancelled_before_write",
|
|
22394
|
+
retryable: false,
|
|
22395
|
+
dispatchOutcome: "not_dispatched"
|
|
22395
22396
|
});
|
|
22396
22397
|
}
|
|
22397
22398
|
const id2 = this.nextRequestId++;
|
|
@@ -22400,8 +22401,9 @@ child.once('close', async (code, signal) => {
|
|
|
22400
22401
|
throw new CodexAppServerError({
|
|
22401
22402
|
message: "Codex request was cancelled before dispatch.",
|
|
22402
22403
|
category: "cancelled",
|
|
22403
|
-
code: "
|
|
22404
|
-
retryable: false
|
|
22404
|
+
code: "rpc_cancelled_before_write",
|
|
22405
|
+
retryable: false,
|
|
22406
|
+
dispatchOutcome: "not_dispatched"
|
|
22405
22407
|
});
|
|
22406
22408
|
}
|
|
22407
22409
|
if (options.notAfterMs !== void 0 && Date.now() > options.notAfterMs) {
|
|
@@ -25080,7 +25082,8 @@ var init_codex_adapter = __esm({
|
|
|
25080
25082
|
}
|
|
25081
25083
|
}
|
|
25082
25084
|
if (error48 instanceof CodexAppServerError) {
|
|
25083
|
-
const
|
|
25085
|
+
const provenBeforeWrite = error48.code === "rpc_cancelled_before_write" && error48.dispatchOutcome === "not_dispatched";
|
|
25086
|
+
const dispatchOutcome = provenBeforeWrite || error48.code === "server_account_context_expired_before_provider_dispatch" ? "not_dispatched" : error48.dispatchOutcome === "not_dispatched" ? currentDispatchOutcome : error48.dispatchOutcome;
|
|
25084
25087
|
input.onTerminalDispatchOutcome?.(dispatchOutcome);
|
|
25085
25088
|
if (baseCheckpoint && !completedResult) {
|
|
25086
25089
|
latestCheckpoint = {
|
|
@@ -36140,6 +36143,7 @@ var init_runner = __esm({
|
|
|
36140
36143
|
const agentAbort = new AbortController();
|
|
36141
36144
|
let agentLoop = Promise.resolve();
|
|
36142
36145
|
let modelCatalogRefresh = null;
|
|
36146
|
+
let providerRateLimitRefresh = null;
|
|
36143
36147
|
let wakeDrain;
|
|
36144
36148
|
const drainSignal = new Promise((resolve10) => {
|
|
36145
36149
|
wakeDrain = resolve10;
|
|
@@ -37272,68 +37276,72 @@ var init_runner = __esm({
|
|
|
37272
37276
|
providerCooldownReason = null;
|
|
37273
37277
|
providerQuotaSnapshot = null;
|
|
37274
37278
|
}
|
|
37275
|
-
if (this.dependencies.codexAdapter.readAccountRateLimits && currentTime >= nextProviderRateLimitRefreshAt) {
|
|
37276
|
-
|
|
37277
|
-
|
|
37278
|
-
|
|
37279
|
-
|
|
37280
|
-
|
|
37281
|
-
this.
|
|
37282
|
-
|
|
37283
|
-
|
|
37284
|
-
|
|
37285
|
-
|
|
37286
|
-
|
|
37287
|
-
|
|
37288
|
-
|
|
37289
|
-
|
|
37290
|
-
|
|
37291
|
-
|
|
37292
|
-
|
|
37293
|
-
|
|
37294
|
-
|
|
37295
|
-
|
|
37296
|
-
|
|
37297
|
-
|
|
37298
|
-
|
|
37299
|
-
|
|
37300
|
-
|
|
37301
|
-
|
|
37302
|
-
|
|
37303
|
-
|
|
37279
|
+
if (this.dependencies.codexAdapter.readAccountRateLimits && currentTime >= nextProviderRateLimitRefreshAt && !providerRateLimitRefresh) {
|
|
37280
|
+
nextProviderRateLimitRefreshAt = Infinity;
|
|
37281
|
+
providerRateLimitRefresh = Promise.resolve().then(async () => {
|
|
37282
|
+
try {
|
|
37283
|
+
const refreshVersion = providerCooldownVersion;
|
|
37284
|
+
const refreshStartedAt = now();
|
|
37285
|
+
const refreshedRateLimits = await this.dependencies.codexAdapter.readAccountRateLimits(
|
|
37286
|
+
Date.now() + Math.min(2e3, settings.hostHeartbeatMs),
|
|
37287
|
+
agentAbort.signal
|
|
37288
|
+
);
|
|
37289
|
+
if (agentAbort.signal.aborted || refreshVersion !== providerCooldownVersion) return;
|
|
37290
|
+
providerRateLimits = refreshedRateLimits;
|
|
37291
|
+
providerRateLimitsObservedAtMs = now();
|
|
37292
|
+
const refreshedAt = now();
|
|
37293
|
+
const usableSnapshot = usableProviderQuotaSnapshot(
|
|
37294
|
+
providerRateLimits,
|
|
37295
|
+
knownProviderQuotaSnapshot,
|
|
37296
|
+
refreshedAt
|
|
37297
|
+
);
|
|
37298
|
+
providerQuotaRecoveryObservedAtMs = usableSnapshot ? refreshStartedAt : null;
|
|
37299
|
+
retainKnownQuotaWindows(providerRateLimits.rateLimits);
|
|
37300
|
+
const refreshedRetryAt = codexAccountRateLimitReached(providerRateLimits) ? codexRateLimitRetryAtMs(providerRateLimits) ?? refreshedAt + DEFAULT_CODEX_ACCOUNT_COOLDOWN_MS : null;
|
|
37301
|
+
if (refreshedRetryAt !== null && refreshedRetryAt > refreshedAt) {
|
|
37302
|
+
providerRetryAtMs = Math.max(providerRetryAtMs ?? 0, refreshedRetryAt);
|
|
37303
|
+
providerCooldownReason = "provider_limit_snapshot";
|
|
37304
|
+
retainQuotaSnapshot(providerRateLimits);
|
|
37305
|
+
} else if (providerRetryAtMs !== null && !codexAccountRateLimitReached(providerRateLimits) && providerRateLimits.rateLimits.limitId === providerQuotaSnapshot?.limitId && [providerRateLimits.rateLimits.primary, providerRateLimits.rateLimits.secondary].some((window2) => window2 !== null) && ["primary", "secondary"].every((key) => {
|
|
37306
|
+
const window2 = refreshedRateLimits.rateLimits[key];
|
|
37307
|
+
const previous = providerQuotaSnapshot?.[key];
|
|
37308
|
+
if (previous && (!window2 || window2.windowDurationMins !== previous.windowDurationMins)) {
|
|
37309
|
+
return false;
|
|
37310
|
+
}
|
|
37311
|
+
return window2 === null || window2.resetsAt !== null && window2.resetsAt * 1e3 > refreshedAt && window2.usedPercent < 100;
|
|
37312
|
+
})) {
|
|
37313
|
+
emitDiagnostic("provider_cooldown_cleared", {
|
|
37314
|
+
reason: providerCooldownReason,
|
|
37315
|
+
recovery: "provider_quota_restored",
|
|
37316
|
+
active_attempts: active.size,
|
|
37317
|
+
provider_weekly_quota: providerWeeklyQuotaFromRateLimits(
|
|
37318
|
+
providerRateLimits,
|
|
37319
|
+
providerRateLimitsObservedAtMs,
|
|
37320
|
+
refreshedAt
|
|
37321
|
+
)
|
|
37322
|
+
});
|
|
37323
|
+
providerRetryAtMs = null;
|
|
37324
|
+
providerCooldownReason = null;
|
|
37325
|
+
providerQuotaSnapshot = null;
|
|
37304
37326
|
}
|
|
37305
|
-
|
|
37306
|
-
})) {
|
|
37307
|
-
emitDiagnostic("provider_cooldown_cleared", {
|
|
37308
|
-
reason: providerCooldownReason,
|
|
37309
|
-
recovery: "provider_quota_restored",
|
|
37310
|
-
active_attempts: active.size,
|
|
37327
|
+
emitDiagnostic("provider_rate_limits_refreshed", {
|
|
37311
37328
|
provider_weekly_quota: providerWeeklyQuotaFromRateLimits(
|
|
37312
37329
|
providerRateLimits,
|
|
37313
37330
|
providerRateLimitsObservedAtMs,
|
|
37314
|
-
|
|
37315
|
-
)
|
|
37331
|
+
now()
|
|
37332
|
+
),
|
|
37333
|
+
active_attempts: active.size
|
|
37316
37334
|
});
|
|
37317
|
-
|
|
37318
|
-
|
|
37319
|
-
|
|
37335
|
+
} catch (error48) {
|
|
37336
|
+
emitDiagnostic("provider_rate_limits_refresh_failed", {
|
|
37337
|
+
failure_category: error48 instanceof CodexAppServerError ? error48.category : "adapter",
|
|
37338
|
+
failure_code: error48 instanceof CodexAppServerError ? error48.code : "provider_rate_limits_refresh_failed"
|
|
37339
|
+
});
|
|
37340
|
+
} finally {
|
|
37341
|
+
nextProviderRateLimitRefreshAt = now() + settings.providerRateLimitRefreshMs;
|
|
37342
|
+
providerRateLimitRefresh = null;
|
|
37320
37343
|
}
|
|
37321
|
-
|
|
37322
|
-
provider_weekly_quota: providerWeeklyQuotaFromRateLimits(
|
|
37323
|
-
providerRateLimits,
|
|
37324
|
-
providerRateLimitsObservedAtMs,
|
|
37325
|
-
now()
|
|
37326
|
-
),
|
|
37327
|
-
active_attempts: active.size
|
|
37328
|
-
});
|
|
37329
|
-
} catch (error48) {
|
|
37330
|
-
emitDiagnostic("provider_rate_limits_refresh_failed", {
|
|
37331
|
-
failure_category: error48 instanceof CodexAppServerError ? error48.category : "adapter",
|
|
37332
|
-
failure_code: error48 instanceof CodexAppServerError ? error48.code : "provider_rate_limits_refresh_failed"
|
|
37333
|
-
});
|
|
37334
|
-
} finally {
|
|
37335
|
-
nextProviderRateLimitRefreshAt = now() + settings.providerRateLimitRefreshMs;
|
|
37336
|
-
}
|
|
37344
|
+
});
|
|
37337
37345
|
}
|
|
37338
37346
|
const expiresAt = receipt.advertisement_expires_at ? Date.parse(receipt.advertisement_expires_at) : 0;
|
|
37339
37347
|
const renewalDue = currentTime >= nextAdvertisementAttemptAt && expiresAt - currentTime <= settings.advertisementRefreshLeadMs;
|
|
@@ -37497,6 +37505,14 @@ var init_runner = __esm({
|
|
|
37497
37505
|
0,
|
|
37498
37506
|
claimCallRoundTripMs - (claim.schema_version === "external_inference_job_claim_result_v3" ? claim.server_processing_ms : 0)
|
|
37499
37507
|
);
|
|
37508
|
+
emitDiagnostic("claim_batch_received", {
|
|
37509
|
+
claim_count: claim.claims.length,
|
|
37510
|
+
round_trip_ms: claimCallRoundTripMs,
|
|
37511
|
+
server_processing_ms: claim.schema_version === "external_inference_job_claim_result_v3" ? claim.server_processing_ms : null,
|
|
37512
|
+
transport_residual_ms: claimTransportResidualMs,
|
|
37513
|
+
minimum_freshness_remaining_ms: claim.claims.length ? Math.min(...claim.claims.map((item) => item.provider_dispatch_freshness_remaining_ms)) : null,
|
|
37514
|
+
active_attempts: active.size
|
|
37515
|
+
});
|
|
37500
37516
|
if (claim.claims.length === 0) {
|
|
37501
37517
|
await mutateReceipt((current) => ({
|
|
37502
37518
|
...current,
|
|
@@ -37674,6 +37690,7 @@ var init_runner = __esm({
|
|
|
37674
37690
|
const agentCleanup = Promise.allSettled([
|
|
37675
37691
|
agentLoop,
|
|
37676
37692
|
modelCatalogRefresh,
|
|
37693
|
+
providerRateLimitRefresh,
|
|
37677
37694
|
Promise.resolve().then(async () => {
|
|
37678
37695
|
await settings.agentRuntime?.adapter.close();
|
|
37679
37696
|
})
|