@vtxmacro/cli 2026.9.17 → 2026.9.19

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.
@@ -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.17",
19
+ package_version: "2026.9.19",
20
20
  codex_package_name: "@openai/codex",
21
21
  codex_version: "0.153.3",
22
22
  copilot_sdk_package_name: "@github/copilot-sdk",
@@ -144,6 +144,7 @@ while(($line=[Console]::In.ReadLine()) -ne $null) {
144
144
  if($mode -eq 'harden') {
145
145
  $failureStage='acl_read'
146
146
  $acl=Get-Acl -LiteralPath $path
147
+ $originalAccess=$acl.GetSecurityDescriptorSddlForm([Security.AccessControl.AccessControlSections]::Access)
147
148
  $failureStage='owner_validation'
148
149
  $existingOwner=(New-Object Security.Principal.NTAccount($acl.Owner)).Translate([Security.Principal.SecurityIdentifier]).Value
149
150
  if($existingOwner -ne $current.Value -and ($existingOwner -ne $admins.Value -or -not $currentIsAdmin)) { throw 'private ACL owner is invalid' }
@@ -164,7 +165,9 @@ while(($line=[Console]::In.ReadLine()) -ne $null) {
164
165
  [void]$acl.AddAccessRule($rule)
165
166
  }
166
167
  $failureStage='acl_write'
167
- (Get-Item -LiteralPath $path).SetAccessControl($acl)
168
+ if($originalAccess -ne $acl.GetSecurityDescriptorSddlForm([Security.AccessControl.AccessControlSections]::Access)) {
169
+ (Get-Item -LiteralPath $path).SetAccessControl($acl)
170
+ }
168
171
  }
169
172
  $failureStage='acl_readback'
170
173
  $actual=Get-Acl -LiteralPath $path
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.17",
72
+ package_version: "2026.9.19",
73
73
  codex_package_name: "@openai/codex",
74
74
  codex_version: "0.153.3",
75
75
  copilot_sdk_package_name: "@github/copilot-sdk",
@@ -17994,6 +17994,7 @@ while(($line=[Console]::In.ReadLine()) -ne $null) {
17994
17994
  if($mode -eq 'harden') {
17995
17995
  $failureStage='acl_read'
17996
17996
  $acl=Get-Acl -LiteralPath $path
17997
+ $originalAccess=$acl.GetSecurityDescriptorSddlForm([Security.AccessControl.AccessControlSections]::Access)
17997
17998
  $failureStage='owner_validation'
17998
17999
  $existingOwner=(New-Object Security.Principal.NTAccount($acl.Owner)).Translate([Security.Principal.SecurityIdentifier]).Value
17999
18000
  if($existingOwner -ne $current.Value -and ($existingOwner -ne $admins.Value -or -not $currentIsAdmin)) { throw 'private ACL owner is invalid' }
@@ -18014,7 +18015,9 @@ while(($line=[Console]::In.ReadLine()) -ne $null) {
18014
18015
  [void]$acl.AddAccessRule($rule)
18015
18016
  }
18016
18017
  $failureStage='acl_write'
18017
- (Get-Item -LiteralPath $path).SetAccessControl($acl)
18018
+ if($originalAccess -ne $acl.GetSecurityDescriptorSddlForm([Security.AccessControl.AccessControlSections]::Access)) {
18019
+ (Get-Item -LiteralPath $path).SetAccessControl($acl)
18020
+ }
18018
18021
  }
18019
18022
  $failureStage='acl_readback'
18020
18023
  $actual=Get-Acl -LiteralPath $path
@@ -19254,7 +19257,8 @@ var init_mcp_client = __esm({
19254
19257
  failure_code: publicFailureCodeSchema,
19255
19258
  phase: safeCodeSchema2,
19256
19259
  retryable: external_exports.boolean(),
19257
- terminal_before_execution: external_exports.boolean()
19260
+ terminal_before_execution: external_exports.boolean(),
19261
+ retry_after_ms: external_exports.number().int().nonnegative().max(MAX_RETRY_AFTER_MS).optional()
19258
19262
  }).passthrough();
19259
19263
  structuredPublicToolErrorSchema = publicToolErrorSchema.extend({
19260
19264
  schema_version: external_exports.literal("vtx_insights_tool_error_v1")
@@ -19845,11 +19849,12 @@ var init_mcp_client = __esm({
19845
19849
  const publicToolError = structuredPublicToolError.success ? structuredPublicToolError.data : hasStructuredPublicToolErrorMarker ? null : parsePublicToolError(errorText);
19846
19850
  const hasPublicToolErrorMarker = hasStructuredPublicToolErrorMarker || errorText.includes(PUBLIC_TOOL_ERROR_PREFIX);
19847
19851
  const completionEvidenceExpired = name === "inference.job.complete" && (publicToolError ? publicToolError.failure_code === "completion_evidence_expired" && publicToolError.phase === "validation" && publicToolError.retryable === false && publicToolError.terminal_before_execution === true : !hasPublicToolErrorMarker && errorText.includes("External inference completion evidence window expired"));
19852
+ const hostNotClaimable = name === "inference.job.claim" && publicToolError?.failure_code === "host_not_claimable" && publicToolError.phase === "admission" && publicToolError.retryable === true && publicToolError.terminal_before_execution === true;
19848
19853
  const definitivelyNotApplied = (name === "inference.host.register" || name === "inference.host.advertise") && (errorText.includes("Advertisement time is outside the allowed clock skew.") || errorText.includes("Advertisement is already expired.")) || (name === "inference.agent.next" || name === "inference.agent.heartbeat") && (errorText.includes("Advertisement time is outside the allowed clock skew.") || errorText.includes("Advertisement is already expired.") || errorText.includes("Heartbeat time is outside the allowed clock skew.")) || name === "inference.host.heartbeat" && errorText.includes("Heartbeat time is outside the allowed clock skew.") || name === "inference.job.claim" && (errorText.includes(
19849
19854
  "External inference claim request was not applied before its generation became stale"
19850
19855
  ) || errorText.includes("External inference host advertisement is expired or superseded")) || name === "inference.job.complete" && completionEvidenceExpired;
19851
19856
  const retryableInfrastructureRejection = EXTERNAL_INFERENCE_AUTOMATED_HOST_TOOLS.includes(name) && (errorText.includes("External inference polling is at its configured concurrency limit") || errorText.includes("The Insights action reached the response timeout") || errorText.includes("Insights capability failed without exposing private runtime details"));
19852
- const retryableClaimRejection = name === "inference.job.claim" && !definitivelyNotApplied && (retryableInfrastructureRejection || errorText.includes("External inference host is not live enough to claim work") || errorText.includes("External inference host request generation is stale") || errorText.includes("External inference claim runtime fence is stale"));
19857
+ const retryableClaimRejection = name === "inference.job.claim" && !definitivelyNotApplied && (retryableInfrastructureRejection || hostNotClaimable || errorText.includes("External inference host is not live enough to claim work") || errorText.includes("External inference host request generation is stale") || errorText.includes("External inference claim runtime fence is stale"));
19853
19858
  const retryableHeartbeatClockSkew = name === "inference.host.heartbeat" && definitivelyNotApplied;
19854
19859
  const retryableAdvertisementClockSkew = (name === "inference.host.register" || name === "inference.host.advertise") && definitivelyNotApplied;
19855
19860
  const staleHostHeartbeatGeneration = name === "inference.host.heartbeat" && errorText.includes("Heartbeat generations do not match the current host authority.");
@@ -19866,7 +19871,8 @@ var init_mcp_client = __esm({
19866
19871
  // request reached the application boundary, so retain and replay
19867
19872
  // the exact request unless the server proves it was not applied.
19868
19873
  retryable: retryableInfrastructureRejection || retryableClaimRejection || retryableHeartbeatClockSkew || retryableAdvertisementClockSkew,
19869
- serverFailureCode: publicToolError?.failure_code ?? null
19874
+ serverFailureCode: publicToolError?.failure_code ?? null,
19875
+ retryAfterMs: hostNotClaimable ? publicToolError?.retry_after_ms ?? null : null
19870
19876
  }
19871
19877
  );
19872
19878
  }
@@ -24692,6 +24698,7 @@ var init_codex_adapter = __esm({
24692
24698
  const promise2 = this.executeAttempt(input);
24693
24699
  this.inFlightAttempts.set(input.attemptId, {
24694
24700
  inputSha256: input.inputSha256,
24701
+ deadlineAtMs: input.deadlineAtMs,
24695
24702
  promise: promise2
24696
24703
  });
24697
24704
  void promise2.then(async () => {
@@ -24715,6 +24722,25 @@ var init_codex_adapter = __esm({
24715
24722
  retryable: false
24716
24723
  });
24717
24724
  }
24725
+ const activeAttempt = this.inFlightAttempts.get(attemptId);
24726
+ if (activeAttempt) {
24727
+ let timer;
24728
+ try {
24729
+ await Promise.race([
24730
+ activeAttempt.promise.catch(() => void 0),
24731
+ new Promise((_resolve, reject) => {
24732
+ timer = setTimeout(() => reject(new CodexAppServerError({
24733
+ message: "Codex cancelled setup did not settle before its immutable deadline.",
24734
+ category: "adapter",
24735
+ code: "attempt_cleanup_unconfirmed",
24736
+ retryable: false
24737
+ })), Math.max(1, Math.min(2147483647, activeAttempt.deadlineAtMs - Date.now())));
24738
+ })
24739
+ ]);
24740
+ } finally {
24741
+ if (timer !== void 0) clearTimeout(timer);
24742
+ }
24743
+ }
24718
24744
  const activeCleanup = this.attemptCleanups.get(attemptId);
24719
24745
  if (activeCleanup) {
24720
24746
  try {
@@ -24886,6 +24912,12 @@ var init_codex_adapter = __esm({
24886
24912
  let completedResult = null;
24887
24913
  let caughtError = null;
24888
24914
  let sessionInvalidationError = null;
24915
+ let turnEntered = false;
24916
+ const reportSetupCancellation = () => {
24917
+ if (!turnEntered) input.onTerminalDispatchOutcome?.("not_dispatched");
24918
+ };
24919
+ input.signal?.addEventListener("abort", reportSetupCancellation, { once: true });
24920
+ if (input.signal?.aborted) reportSetupCancellation();
24889
24921
  try {
24890
24922
  resources = await (this.dependencies.createAttemptResources ?? ((attemptId) => createIsolatedCodexAttemptResources(
24891
24923
  attemptId,
@@ -24946,6 +24978,8 @@ var init_codex_adapter = __esm({
24946
24978
  };
24947
24979
  latestCheckpoint = baseCheckpoint;
24948
24980
  await recoveryHooks?.save(baseCheckpoint);
24981
+ assertAttemptActive(input.deadlineAtMs, input.signal);
24982
+ turnEntered = true;
24949
24983
  const result2 = await session.executeTurn({
24950
24984
  thread,
24951
24985
  workspacePath: resources.workspacePath,
@@ -25063,6 +25097,7 @@ var init_codex_adapter = __esm({
25063
25097
  }
25064
25098
  throw classified;
25065
25099
  } finally {
25100
+ input.signal?.removeEventListener("abort", reportSetupCancellation);
25066
25101
  sessionLease?.activeAttemptIds.delete(input.attemptId);
25067
25102
  const cleanup = async () => {
25068
25103
  let cleanupError = sessionInvalidationError;
@@ -36370,6 +36405,7 @@ var init_runner = __esm({
36370
36405
  const scheduleReceiptWriter = () => {
36371
36406
  if (receiptWriter || receiptWriterFailed) return;
36372
36407
  receiptWriter = (async () => {
36408
+ await Promise.resolve();
36373
36409
  try {
36374
36410
  while (persistedReceiptRevision < receiptRevision) {
36375
36411
  const targetRevision = receiptRevision;
@@ -36595,6 +36631,7 @@ var init_runner = __esm({
36595
36631
  };
36596
36632
  }
36597
36633
  };
36634
+ let claimAvailabilityBackoff = null;
36598
36635
  const hostHeartbeat = async (status, requestOptions = {
36599
36636
  signal: this.options.signal
36600
36637
  }, retryRemote = true, allowOfflineProjection = false, definitiveReseedAttempt = 0, advertisementGeneration = receipt.advertisement_generation) => {
@@ -36659,6 +36696,9 @@ var init_runner = __esm({
36659
36696
  );
36660
36697
  throw error48;
36661
36698
  }
36699
+ if (claimAvailabilityBackoff !== null && result2.host.status === "online" && request.provider_quota_recovery != null && Date.parse(request.provider_quota_recovery.observed_at) >= claimAvailabilityBackoff.rejectedAtMs) {
36700
+ claimAvailabilityBackoff = null;
36701
+ }
36662
36702
  };
36663
36703
  await hostHeartbeat("healthy");
36664
36704
  let lastHostHeartbeatSucceededAt = now();
@@ -36951,13 +36991,15 @@ var init_runner = __esm({
36951
36991
  });
36952
36992
  },
36953
36993
  onProviderDispatchWatchdog: (observation) => {
36954
- providerDispatchWatchdogDrainRequested = true;
36955
36994
  emitDiagnostic("provider_dispatch_watchdog_expired", {
36956
36995
  ...observation,
36957
36996
  job_id: claim.job_id,
36958
36997
  attempt_id: attemptId,
36959
36998
  active_attempts: active.size
36960
36999
  });
37000
+ },
37001
+ onProviderDispatchRecoveryRequired: () => {
37002
+ providerDispatchWatchdogDrainRequested = true;
36961
37003
  requestDrain("provider_dispatch_watchdog_expired");
36962
37004
  },
36963
37005
  startRetryCount: nextStartRetryCount,
@@ -37245,7 +37287,12 @@ var init_runner = __esm({
37245
37287
  const recovery = recoveryQueue.shift();
37246
37288
  launchClaim(recovery.claim, recovery);
37247
37289
  }
37248
- while (!drainRequested && recoveryQueue.length === 0 && (!this.options.once || !onceClaimed) && (settings.maxConcurrency === null || active.size < settings.maxConcurrency) && pendingClaimPromotions === 0 && now() >= Math.max(nextClaimAt, providerRetryAtMs ?? 0, providerFailureRetryAtMs)) {
37290
+ while (!drainRequested && recoveryQueue.length === 0 && (!this.options.once || !onceClaimed) && (settings.maxConcurrency === null || active.size < settings.maxConcurrency) && pendingClaimPromotions === 0 && now() >= Math.max(
37291
+ nextClaimAt,
37292
+ claimAvailabilityBackoff?.untilMs ?? 0,
37293
+ providerRetryAtMs ?? 0,
37294
+ providerFailureRetryAtMs
37295
+ )) {
37249
37296
  if (!receipt.pending_claim_request) {
37250
37297
  await mutateReceipt(preparePendingClaim);
37251
37298
  }
@@ -37327,7 +37374,13 @@ var init_runner = __esm({
37327
37374
  requestDrain("claim_failed");
37328
37375
  }
37329
37376
  } else if (!this.options.signal?.aborted && retryableRemoteError(error48)) {
37330
- nextClaimAt = now() + remoteRetryAfterMs(error48, 1e3);
37377
+ const rejectedAtMs = now();
37378
+ const retryAtMs = rejectedAtMs + remoteRetryAfterMs(error48, 1e3);
37379
+ if (error48 instanceof ExternalInferenceMcpError && error48.serverFailureCode === "host_not_claimable") {
37380
+ claimAvailabilityBackoff = { untilMs: retryAtMs, rejectedAtMs };
37381
+ } else {
37382
+ nextClaimAt = retryAtMs;
37383
+ }
37331
37384
  } else if (!this.options.signal?.aborted) {
37332
37385
  requestDrain("claim_failed");
37333
37386
  }
@@ -37465,7 +37518,12 @@ var init_runner = __esm({
37465
37518
  if (drainRequested) break;
37466
37519
  const advertisementDueAt = nextAdvertisementAttemptAt > now() ? nextAdvertisementAttemptAt : receipt.advertisement_expires_at ? Date.parse(receipt.advertisement_expires_at) - settings.advertisementRefreshLeadMs : now() + MIN_SLEEP_MS;
37467
37520
  const wakeAt = Math.min(
37468
- Math.max(nextClaimAt, providerRetryAtMs ?? 0, providerFailureRetryAtMs),
37521
+ Math.max(
37522
+ nextClaimAt,
37523
+ claimAvailabilityBackoff?.untilMs ?? 0,
37524
+ providerRetryAtMs ?? 0,
37525
+ providerFailureRetryAtMs
37526
+ ),
37469
37527
  nextProviderRateLimitRefreshAt,
37470
37528
  now() + settings.hostHeartbeatMs,
37471
37529
  Math.max(now() + MIN_SLEEP_MS, advertisementDueAt)
@@ -37846,10 +37904,6 @@ var init_runner = __esm({
37846
37904
  options.prestarted.claimResponseReceivedAtMs,
37847
37905
  options.prestarted.roundTripMs
37848
37906
  );
37849
- if (options.prestarted.receiptDurability) {
37850
- reportPreProviderStage("receipt_persistence");
37851
- await awaitPreProviderDurability(options.prestarted.receiptDurability);
37852
- }
37853
37907
  } else {
37854
37908
  reportPreProviderStage("receipt_persistence");
37855
37909
  const claimPromotionPromise = options.resumeReceipt ? Promise.resolve() : awaitPreProviderDurability(
@@ -37933,10 +37987,13 @@ var init_runner = __esm({
37933
37987
  const providerDispatchable = inputValidationError === void 0 && outputContract !== null;
37934
37988
  reportPreProviderStage("receipt_persistence");
37935
37989
  await awaitPreProviderDurability(
37936
- persistAttempt({
37937
- phase: providerDispatchable ? "dispatched" : "started",
37938
- dispatch_outcome: providerDispatchable ? "outcome_unknown" : "not_dispatched"
37939
- })
37990
+ Promise.all([
37991
+ persistAttempt({
37992
+ phase: providerDispatchable ? "dispatched" : "started",
37993
+ dispatch_outcome: providerDispatchable ? "outcome_unknown" : "not_dispatched"
37994
+ }),
37995
+ options.prestarted?.receiptDurability
37996
+ ])
37940
37997
  );
37941
37998
  }
37942
37999
  reportPreProviderStage("thread_setup");
@@ -37944,6 +38001,7 @@ var init_runner = __esm({
37944
38001
  clearProviderDispatchWatchdog();
37945
38002
  signal.removeEventListener("abort", relayAbort);
37946
38003
  if (providerDispatchWatchdogExpired) {
38004
+ options.onProviderDispatchRecoveryRequired?.();
37947
38005
  return terminalizeProviderDispatchWatchdog();
37948
38006
  }
37949
38007
  throw error48;
@@ -38091,6 +38149,7 @@ var init_runner = __esm({
38091
38149
  dispatchOutcome: "not_dispatched"
38092
38150
  });
38093
38151
  }
38152
+ options.onProviderDispatchRecoveryRequired?.();
38094
38153
  throw new CodexAppServerError({
38095
38154
  message: "Provider dispatch could not be excluded after the freshness watchdog expired.",
38096
38155
  category: "timeout",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtxmacro/cli",
3
- "version": "2026.9.17",
3
+ "version": "2026.9.19",
4
4
  "description": "VTX Macro CLI, MCP server, and durable external inference host.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",