@vtxmacro/cli 2026.9.21 → 2026.9.23
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 +155 -93
- 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.23",
|
|
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.23",
|
|
73
73
|
codex_package_name: "@openai/codex",
|
|
74
74
|
codex_version: "0.153.3",
|
|
75
75
|
copilot_sdk_package_name: "@github/copilot-sdk",
|
|
@@ -36139,6 +36139,8 @@ var init_runner = __esm({
|
|
|
36139
36139
|
let providerDispatchWatchdogDrainRequested = false;
|
|
36140
36140
|
const agentAbort = new AbortController();
|
|
36141
36141
|
let agentLoop = Promise.resolve();
|
|
36142
|
+
let modelCatalogRefresh = null;
|
|
36143
|
+
let providerRateLimitRefresh = null;
|
|
36142
36144
|
let wakeDrain;
|
|
36143
36145
|
const drainSignal = new Promise((resolve10) => {
|
|
36144
36146
|
wakeDrain = resolve10;
|
|
@@ -36561,6 +36563,7 @@ var init_runner = __esm({
|
|
|
36561
36563
|
}
|
|
36562
36564
|
};
|
|
36563
36565
|
let advertisementHandoff = null;
|
|
36566
|
+
const claimPreparation = { unsent: null };
|
|
36564
36567
|
const publishAdvertisement = async (health, forceAdvance, retryRemote = true, allowDefinitiveReseed = true) => {
|
|
36565
36568
|
let advertisement = receipt.pending_advertisement;
|
|
36566
36569
|
if (!advertisement) {
|
|
@@ -36778,6 +36781,45 @@ var init_runner = __esm({
|
|
|
36778
36781
|
return gapMs;
|
|
36779
36782
|
};
|
|
36780
36783
|
let nextAdvertisementAttemptAt = 0;
|
|
36784
|
+
let renewalYieldedToClaim = false;
|
|
36785
|
+
let catalogRefreshGeneration = null;
|
|
36786
|
+
const refreshModelCatalog = () => {
|
|
36787
|
+
if (modelCatalogRefresh || !this.dependencies.codexAdapter.readModelCapabilities || receipt.pending_advertisement || catalogRefreshGeneration === receipt.advertisement_generation) return;
|
|
36788
|
+
catalogRefreshGeneration = receipt.advertisement_generation;
|
|
36789
|
+
modelCatalogRefresh = (async () => {
|
|
36790
|
+
try {
|
|
36791
|
+
const capabilities = await this.dependencies.codexAdapter.readModelCapabilities(
|
|
36792
|
+
Date.now() + Math.max(1, Math.floor(settings.advertisementRefreshLeadMs / 2)),
|
|
36793
|
+
agentAbort.signal
|
|
36794
|
+
);
|
|
36795
|
+
if (agentAbort.signal.aborted) return;
|
|
36796
|
+
const refreshedModels = buildInferenceAdvertisedModels(
|
|
36797
|
+
capabilities,
|
|
36798
|
+
this.options.adapterRuntimeVersion,
|
|
36799
|
+
settings.adapterId,
|
|
36800
|
+
this.options.structuredOutput ?? settings.adapterId === "codex",
|
|
36801
|
+
settings.sameAttemptRecovery,
|
|
36802
|
+
settings.agentRuntime ? ["provider", "agent"] : ["provider"]
|
|
36803
|
+
);
|
|
36804
|
+
const changed = !exactJson2(settings.advertisedModels, refreshedModels);
|
|
36805
|
+
settings.advertisedModels = refreshedModels;
|
|
36806
|
+
emitDiagnostic("model_catalog_refreshed", {
|
|
36807
|
+
model_count: refreshedModels.length,
|
|
36808
|
+
changed,
|
|
36809
|
+
active_attempts: active.size
|
|
36810
|
+
});
|
|
36811
|
+
} catch (error48) {
|
|
36812
|
+
if (agentAbort.signal.aborted) return;
|
|
36813
|
+
emitDiagnostic("model_catalog_refresh_failed", {
|
|
36814
|
+
failure_category: error48 instanceof CodexAppServerError ? error48.category : "adapter",
|
|
36815
|
+
failure_code: error48 instanceof CodexAppServerError ? error48.code : "model_catalog_refresh_failed",
|
|
36816
|
+
retained_model_count: settings.advertisedModels.length
|
|
36817
|
+
});
|
|
36818
|
+
} finally {
|
|
36819
|
+
modelCatalogRefresh = null;
|
|
36820
|
+
}
|
|
36821
|
+
})();
|
|
36822
|
+
};
|
|
36781
36823
|
let nextProviderRateLimitRefreshAt = now() + settings.providerRateLimitRefreshMs;
|
|
36782
36824
|
let nextClaimAt = now();
|
|
36783
36825
|
let pendingClaimPromotions = 0;
|
|
@@ -36819,6 +36861,7 @@ var init_runner = __esm({
|
|
|
36819
36861
|
schema_version: "external_inference_job_claim_v1",
|
|
36820
36862
|
...claimRequestBase
|
|
36821
36863
|
};
|
|
36864
|
+
claimPreparation.unsent = pendingClaimRequest;
|
|
36822
36865
|
return {
|
|
36823
36866
|
...current,
|
|
36824
36867
|
claim_sequence: claimSequence,
|
|
@@ -37230,103 +37273,88 @@ var init_runner = __esm({
|
|
|
37230
37273
|
providerCooldownReason = null;
|
|
37231
37274
|
providerQuotaSnapshot = null;
|
|
37232
37275
|
}
|
|
37233
|
-
if (this.dependencies.codexAdapter.readAccountRateLimits && currentTime >= nextProviderRateLimitRefreshAt) {
|
|
37234
|
-
|
|
37235
|
-
|
|
37236
|
-
|
|
37237
|
-
|
|
37238
|
-
|
|
37239
|
-
this.
|
|
37240
|
-
|
|
37241
|
-
|
|
37242
|
-
|
|
37243
|
-
|
|
37244
|
-
|
|
37245
|
-
|
|
37246
|
-
|
|
37247
|
-
|
|
37248
|
-
|
|
37249
|
-
|
|
37250
|
-
|
|
37251
|
-
|
|
37252
|
-
|
|
37253
|
-
|
|
37254
|
-
|
|
37255
|
-
|
|
37256
|
-
|
|
37257
|
-
|
|
37258
|
-
|
|
37259
|
-
|
|
37260
|
-
|
|
37261
|
-
|
|
37276
|
+
if (this.dependencies.codexAdapter.readAccountRateLimits && currentTime >= nextProviderRateLimitRefreshAt && !providerRateLimitRefresh) {
|
|
37277
|
+
nextProviderRateLimitRefreshAt = Infinity;
|
|
37278
|
+
providerRateLimitRefresh = Promise.resolve().then(async () => {
|
|
37279
|
+
try {
|
|
37280
|
+
const refreshVersion = providerCooldownVersion;
|
|
37281
|
+
const refreshStartedAt = now();
|
|
37282
|
+
const refreshedRateLimits = await this.dependencies.codexAdapter.readAccountRateLimits(
|
|
37283
|
+
Date.now() + Math.min(2e3, settings.hostHeartbeatMs),
|
|
37284
|
+
agentAbort.signal
|
|
37285
|
+
);
|
|
37286
|
+
if (agentAbort.signal.aborted || refreshVersion !== providerCooldownVersion) return;
|
|
37287
|
+
providerRateLimits = refreshedRateLimits;
|
|
37288
|
+
providerRateLimitsObservedAtMs = now();
|
|
37289
|
+
const refreshedAt = now();
|
|
37290
|
+
const usableSnapshot = usableProviderQuotaSnapshot(
|
|
37291
|
+
providerRateLimits,
|
|
37292
|
+
knownProviderQuotaSnapshot,
|
|
37293
|
+
refreshedAt
|
|
37294
|
+
);
|
|
37295
|
+
providerQuotaRecoveryObservedAtMs = usableSnapshot ? refreshStartedAt : null;
|
|
37296
|
+
retainKnownQuotaWindows(providerRateLimits.rateLimits);
|
|
37297
|
+
const refreshedRetryAt = codexAccountRateLimitReached(providerRateLimits) ? codexRateLimitRetryAtMs(providerRateLimits) ?? refreshedAt + DEFAULT_CODEX_ACCOUNT_COOLDOWN_MS : null;
|
|
37298
|
+
if (refreshedRetryAt !== null && refreshedRetryAt > refreshedAt) {
|
|
37299
|
+
providerRetryAtMs = Math.max(providerRetryAtMs ?? 0, refreshedRetryAt);
|
|
37300
|
+
providerCooldownReason = "provider_limit_snapshot";
|
|
37301
|
+
retainQuotaSnapshot(providerRateLimits);
|
|
37302
|
+
} 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) => {
|
|
37303
|
+
const window2 = refreshedRateLimits.rateLimits[key];
|
|
37304
|
+
const previous = providerQuotaSnapshot?.[key];
|
|
37305
|
+
if (previous && (!window2 || window2.windowDurationMins !== previous.windowDurationMins)) {
|
|
37306
|
+
return false;
|
|
37307
|
+
}
|
|
37308
|
+
return window2 === null || window2.resetsAt !== null && window2.resetsAt * 1e3 > refreshedAt && window2.usedPercent < 100;
|
|
37309
|
+
})) {
|
|
37310
|
+
emitDiagnostic("provider_cooldown_cleared", {
|
|
37311
|
+
reason: providerCooldownReason,
|
|
37312
|
+
recovery: "provider_quota_restored",
|
|
37313
|
+
active_attempts: active.size,
|
|
37314
|
+
provider_weekly_quota: providerWeeklyQuotaFromRateLimits(
|
|
37315
|
+
providerRateLimits,
|
|
37316
|
+
providerRateLimitsObservedAtMs,
|
|
37317
|
+
refreshedAt
|
|
37318
|
+
)
|
|
37319
|
+
});
|
|
37320
|
+
providerRetryAtMs = null;
|
|
37321
|
+
providerCooldownReason = null;
|
|
37322
|
+
providerQuotaSnapshot = null;
|
|
37262
37323
|
}
|
|
37263
|
-
|
|
37264
|
-
})) {
|
|
37265
|
-
emitDiagnostic("provider_cooldown_cleared", {
|
|
37266
|
-
reason: providerCooldownReason,
|
|
37267
|
-
recovery: "provider_quota_restored",
|
|
37268
|
-
active_attempts: active.size,
|
|
37324
|
+
emitDiagnostic("provider_rate_limits_refreshed", {
|
|
37269
37325
|
provider_weekly_quota: providerWeeklyQuotaFromRateLimits(
|
|
37270
37326
|
providerRateLimits,
|
|
37271
37327
|
providerRateLimitsObservedAtMs,
|
|
37272
|
-
|
|
37273
|
-
)
|
|
37328
|
+
now()
|
|
37329
|
+
),
|
|
37330
|
+
active_attempts: active.size
|
|
37274
37331
|
});
|
|
37275
|
-
|
|
37276
|
-
|
|
37277
|
-
|
|
37332
|
+
} catch (error48) {
|
|
37333
|
+
emitDiagnostic("provider_rate_limits_refresh_failed", {
|
|
37334
|
+
failure_category: error48 instanceof CodexAppServerError ? error48.category : "adapter",
|
|
37335
|
+
failure_code: error48 instanceof CodexAppServerError ? error48.code : "provider_rate_limits_refresh_failed"
|
|
37336
|
+
});
|
|
37337
|
+
} finally {
|
|
37338
|
+
nextProviderRateLimitRefreshAt = now() + settings.providerRateLimitRefreshMs;
|
|
37339
|
+
providerRateLimitRefresh = null;
|
|
37278
37340
|
}
|
|
37279
|
-
|
|
37280
|
-
provider_weekly_quota: providerWeeklyQuotaFromRateLimits(
|
|
37281
|
-
providerRateLimits,
|
|
37282
|
-
providerRateLimitsObservedAtMs,
|
|
37283
|
-
now()
|
|
37284
|
-
),
|
|
37285
|
-
active_attempts: active.size
|
|
37286
|
-
});
|
|
37287
|
-
} catch (error48) {
|
|
37288
|
-
emitDiagnostic("provider_rate_limits_refresh_failed", {
|
|
37289
|
-
failure_category: error48 instanceof CodexAppServerError ? error48.category : "adapter",
|
|
37290
|
-
failure_code: error48 instanceof CodexAppServerError ? error48.code : "provider_rate_limits_refresh_failed"
|
|
37291
|
-
});
|
|
37292
|
-
} finally {
|
|
37293
|
-
nextProviderRateLimitRefreshAt = now() + settings.providerRateLimitRefreshMs;
|
|
37294
|
-
}
|
|
37341
|
+
});
|
|
37295
37342
|
}
|
|
37296
37343
|
const expiresAt = receipt.advertisement_expires_at ? Date.parse(receipt.advertisement_expires_at) : 0;
|
|
37297
|
-
|
|
37344
|
+
const renewalDue = currentTime >= nextAdvertisementAttemptAt && expiresAt - currentTime <= settings.advertisementRefreshLeadMs;
|
|
37345
|
+
if (renewalDue) refreshModelCatalog();
|
|
37346
|
+
const yieldRenewalToClaim = renewalDue && !renewalYieldedToClaim && !receipt.pending_advertisement && expiresAt > now() && recoveryQueue.length === 0 && (!this.options.once || !onceClaimed) && (settings.maxConcurrency === null || active.size < settings.maxConcurrency) && pendingClaimPromotions === 0 && now() >= Math.max(
|
|
37347
|
+
nextClaimAt,
|
|
37348
|
+
claimAvailabilityBackoff?.untilMs ?? 0,
|
|
37349
|
+
providerRetryAtMs ?? 0,
|
|
37350
|
+
providerFailureRetryAtMs
|
|
37351
|
+
);
|
|
37352
|
+
if (yieldRenewalToClaim) renewalYieldedToClaim = true;
|
|
37353
|
+
if (renewalDue && !yieldRenewalToClaim) {
|
|
37298
37354
|
try {
|
|
37299
|
-
if (!receipt.pending_advertisement && this.dependencies.codexAdapter.readModelCapabilities) {
|
|
37300
|
-
try {
|
|
37301
|
-
const capabilities = await this.dependencies.codexAdapter.readModelCapabilities(
|
|
37302
|
-
Date.now() + Math.max(1, Math.floor(settings.advertisementRefreshLeadMs / 2)),
|
|
37303
|
-
this.options.signal
|
|
37304
|
-
);
|
|
37305
|
-
const refreshedModels = buildInferenceAdvertisedModels(
|
|
37306
|
-
capabilities,
|
|
37307
|
-
this.options.adapterRuntimeVersion,
|
|
37308
|
-
settings.adapterId,
|
|
37309
|
-
this.options.structuredOutput ?? settings.adapterId === "codex",
|
|
37310
|
-
settings.sameAttemptRecovery,
|
|
37311
|
-
settings.agentRuntime ? ["provider", "agent"] : ["provider"]
|
|
37312
|
-
);
|
|
37313
|
-
const changed = !exactJson2(settings.advertisedModels, refreshedModels);
|
|
37314
|
-
settings.advertisedModels = refreshedModels;
|
|
37315
|
-
emitDiagnostic("model_catalog_refreshed", {
|
|
37316
|
-
model_count: refreshedModels.length,
|
|
37317
|
-
changed,
|
|
37318
|
-
active_attempts: active.size
|
|
37319
|
-
});
|
|
37320
|
-
} catch (error48) {
|
|
37321
|
-
emitDiagnostic("model_catalog_refresh_failed", {
|
|
37322
|
-
failure_category: error48 instanceof CodexAppServerError ? error48.category : "adapter",
|
|
37323
|
-
failure_code: error48 instanceof CodexAppServerError ? error48.code : "model_catalog_refresh_failed",
|
|
37324
|
-
retained_model_count: settings.advertisedModels.length
|
|
37325
|
-
});
|
|
37326
|
-
}
|
|
37327
|
-
}
|
|
37328
37355
|
await publishAdvertisement("healthy", true, false);
|
|
37329
37356
|
nextAdvertisementAttemptAt = 0;
|
|
37357
|
+
renewalYieldedToClaim = false;
|
|
37330
37358
|
} catch (error48) {
|
|
37331
37359
|
if (controlPlaneFatal(error48)) {
|
|
37332
37360
|
requestDrain("authority_lost");
|
|
@@ -37344,23 +37372,38 @@ var init_runner = __esm({
|
|
|
37344
37372
|
const recovery = recoveryQueue.shift();
|
|
37345
37373
|
launchClaim(recovery.claim, recovery);
|
|
37346
37374
|
}
|
|
37347
|
-
|
|
37375
|
+
let claimOpportunities = 0;
|
|
37376
|
+
while (!drainRequested && (!yieldRenewalToClaim || claimOpportunities === 0) && recoveryQueue.length === 0 && (!this.options.once || !onceClaimed) && (settings.maxConcurrency === null || active.size < settings.maxConcurrency) && pendingClaimPromotions === 0 && now() >= Math.max(
|
|
37348
37377
|
nextClaimAt,
|
|
37349
37378
|
claimAvailabilityBackoff?.untilMs ?? 0,
|
|
37350
37379
|
providerRetryAtMs ?? 0,
|
|
37351
37380
|
providerFailureRetryAtMs
|
|
37352
37381
|
)) {
|
|
37382
|
+
if (receipt.pending_claim_request === claimPreparation.unsent && claimPreparation.unsent !== null && claimPreparation.unsent.advertisement_generation !== receipt.advertisement_generation) {
|
|
37383
|
+
await mutateReceipt((current) => preparePendingClaim({
|
|
37384
|
+
...current,
|
|
37385
|
+
pending_claim_request: null
|
|
37386
|
+
}));
|
|
37387
|
+
}
|
|
37388
|
+
const knownUnsent = receipt.pending_claim_request === null || receipt.pending_claim_request === claimPreparation.unsent;
|
|
37389
|
+
if (knownUnsent && Date.parse(receipt.advertisement_expires_at ?? "") <= now()) break;
|
|
37353
37390
|
if (!receipt.pending_claim_request) {
|
|
37354
37391
|
await mutateReceipt(preparePendingClaim);
|
|
37355
37392
|
}
|
|
37356
37393
|
const request = receipt.pending_claim_request;
|
|
37394
|
+
if (request === claimPreparation.unsent && Date.parse(receipt.advertisement_expires_at ?? "") <= now()) break;
|
|
37357
37395
|
let claim;
|
|
37358
37396
|
const claimCallStartedAtMs = now();
|
|
37359
37397
|
try {
|
|
37398
|
+
claimOpportunities += 1;
|
|
37399
|
+
if (claimPreparation.unsent === request) claimPreparation.unsent = null;
|
|
37360
37400
|
claim = await mcp.callTool(
|
|
37361
37401
|
"inference.job.claim",
|
|
37362
37402
|
request,
|
|
37363
|
-
{
|
|
37403
|
+
{
|
|
37404
|
+
signal: this.options.signal,
|
|
37405
|
+
...yieldRenewalToClaim ? { deadlineAtMs: expiresAt } : {}
|
|
37406
|
+
}
|
|
37364
37407
|
);
|
|
37365
37408
|
assertClaimResult(request, claim);
|
|
37366
37409
|
} catch (error48) {
|
|
@@ -37459,6 +37502,14 @@ var init_runner = __esm({
|
|
|
37459
37502
|
0,
|
|
37460
37503
|
claimCallRoundTripMs - (claim.schema_version === "external_inference_job_claim_result_v3" ? claim.server_processing_ms : 0)
|
|
37461
37504
|
);
|
|
37505
|
+
emitDiagnostic("claim_batch_received", {
|
|
37506
|
+
claim_count: claim.claims.length,
|
|
37507
|
+
round_trip_ms: claimCallRoundTripMs,
|
|
37508
|
+
server_processing_ms: claim.schema_version === "external_inference_job_claim_result_v3" ? claim.server_processing_ms : null,
|
|
37509
|
+
transport_residual_ms: claimTransportResidualMs,
|
|
37510
|
+
minimum_freshness_remaining_ms: claim.claims.length ? Math.min(...claim.claims.map((item) => item.provider_dispatch_freshness_remaining_ms)) : null,
|
|
37511
|
+
active_attempts: active.size
|
|
37512
|
+
});
|
|
37462
37513
|
if (claim.claims.length === 0) {
|
|
37463
37514
|
await mutateReceipt((current) => ({
|
|
37464
37515
|
...current,
|
|
@@ -37585,6 +37636,7 @@ var init_runner = __esm({
|
|
|
37585
37636
|
now() + settings.hostHeartbeatMs,
|
|
37586
37637
|
Math.max(now() + MIN_SLEEP_MS, advertisementDueAt)
|
|
37587
37638
|
);
|
|
37639
|
+
if (yieldRenewalToClaim) continue;
|
|
37588
37640
|
await Promise.race([
|
|
37589
37641
|
sleep4(Math.max(MIN_SLEEP_MS, wakeAt - now())),
|
|
37590
37642
|
drainSignal,
|
|
@@ -37634,6 +37686,8 @@ var init_runner = __esm({
|
|
|
37634
37686
|
agentAbort.abort();
|
|
37635
37687
|
const agentCleanup = Promise.allSettled([
|
|
37636
37688
|
agentLoop,
|
|
37689
|
+
modelCatalogRefresh,
|
|
37690
|
+
providerRateLimitRefresh,
|
|
37637
37691
|
Promise.resolve().then(async () => {
|
|
37638
37692
|
await settings.agentRuntime?.adapter.close();
|
|
37639
37693
|
})
|
|
@@ -48099,6 +48153,7 @@ async function postClientRuntime(path, profileId, body, options) {
|
|
|
48099
48153
|
let lastNetworkError = null;
|
|
48100
48154
|
let missingRuntimeLeaseRecoveryAttempted = false;
|
|
48101
48155
|
let replacementLeaseRetryUsed = false;
|
|
48156
|
+
let lastRequestId = null;
|
|
48102
48157
|
const deadlineError = (attempt, cause) => annotateRuntimeRequestError(
|
|
48103
48158
|
Object.assign(
|
|
48104
48159
|
new Error("Client runtime decision persistence deadline exceeded after the AI run completed."),
|
|
@@ -48113,7 +48168,8 @@ async function postClientRuntime(path, profileId, body, options) {
|
|
|
48113
48168
|
keepalive,
|
|
48114
48169
|
hadRuntimeLeaseToken: Boolean(resolvedRuntimeLeaseToken),
|
|
48115
48170
|
deadlineAtMs,
|
|
48116
|
-
deadlineExceeded: true
|
|
48171
|
+
deadlineExceeded: true,
|
|
48172
|
+
requestId: lastRequestId
|
|
48117
48173
|
}
|
|
48118
48174
|
);
|
|
48119
48175
|
const waitBeforeRetry = async (delayMs, attempt, cause) => {
|
|
@@ -48152,12 +48208,13 @@ async function postClientRuntime(path, profileId, body, options) {
|
|
|
48152
48208
|
}, Math.max(1, attemptTimeoutMs));
|
|
48153
48209
|
requestSignal = timeoutController.signal;
|
|
48154
48210
|
}
|
|
48211
|
+
lastRequestId = path === "/runtime/decision" ? createIdempotencyKey("runtime-request") : null;
|
|
48155
48212
|
const trace = startRuntimeNetworkDebugTrace({
|
|
48156
48213
|
kind: "runtime",
|
|
48157
48214
|
label: "client_runtime_api",
|
|
48158
48215
|
method: "POST",
|
|
48159
48216
|
url: requestUrl,
|
|
48160
|
-
note: `path=${path} attempt=${attempt}/${maxAttempts}`
|
|
48217
|
+
note: `path=${path} attempt=${attempt}/${maxAttempts}${lastRequestId ? ` reconcile_only=${options?.reconcileOnly === true} request_id=${lastRequestId}` : ""}`
|
|
48161
48218
|
});
|
|
48162
48219
|
try {
|
|
48163
48220
|
response = await fetch(requestUrl, {
|
|
@@ -48165,7 +48222,10 @@ async function postClientRuntime(path, profileId, body, options) {
|
|
|
48165
48222
|
credentials: "include",
|
|
48166
48223
|
keepalive,
|
|
48167
48224
|
signal: requestSignal,
|
|
48168
|
-
headers: {
|
|
48225
|
+
headers: {
|
|
48226
|
+
...requestHeaders,
|
|
48227
|
+
...lastRequestId ? { "X-Request-ID": lastRequestId } : {}
|
|
48228
|
+
},
|
|
48169
48229
|
body
|
|
48170
48230
|
});
|
|
48171
48231
|
if (!response.ok) {
|
|
@@ -48246,7 +48306,8 @@ async function postClientRuntime(path, profileId, body, options) {
|
|
|
48246
48306
|
status: response?.status ?? null,
|
|
48247
48307
|
keepalive,
|
|
48248
48308
|
hadRuntimeLeaseToken: Boolean(resolvedRuntimeLeaseToken),
|
|
48249
|
-
deadlineAtMs
|
|
48309
|
+
deadlineAtMs,
|
|
48310
|
+
requestId: lastRequestId
|
|
48250
48311
|
});
|
|
48251
48312
|
}
|
|
48252
48313
|
await waitBeforeRetry(
|
|
@@ -48687,6 +48748,7 @@ var init_api2 = __esm({
|
|
|
48687
48748
|
target.runtimeRequestTransientNetwork = isTransientNetworkFetchError(error48);
|
|
48688
48749
|
target.runtimeRequestKeepalive = metadata.keepalive;
|
|
48689
48750
|
target.runtimeRequestHadLeaseToken = metadata.hadRuntimeLeaseToken;
|
|
48751
|
+
if (metadata.requestId !== void 0) target.runtimeRequestId = metadata.requestId;
|
|
48690
48752
|
if (metadata.deadlineAtMs !== void 0) {
|
|
48691
48753
|
target.runtimeRequestDeadlineAtMs = metadata.deadlineAtMs;
|
|
48692
48754
|
}
|