@vtxmacro/cli 2026.9.20 → 2026.9.21

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.20",
19
+ package_version: "2026.9.21",
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.20",
72
+ package_version: "2026.9.21",
73
73
  codex_package_name: "@openai/codex",
74
74
  codex_version: "0.153.3",
75
75
  copilot_sdk_package_name: "@github/copilot-sdk",
@@ -17958,13 +17958,27 @@ async function acquireInferenceHostProcessLock(path, dependencies = {}) {
17958
17958
  }
17959
17959
  };
17960
17960
  }
17961
- var loadInferenceAgentDataRequestTimeoutMs, INFERENCE_CREDENTIAL_NAMESPACE, MAX_INFERENCE_PRIVATE_FILE_BYTES, WINDOWS_PRIVATE_ACL_BROKER_SCRIPT, WINDOWS_IDENTITY_COMMAND_TIMEOUT_MS, WINDOWS_PRIVATE_ACL_BROKER_STARTUP_TIMEOUT_MS, SMALL_IDENTITY_COMMAND_TIMEOUT_MS, windowsPowerShellEnvironment, windowsPrivateAclBrokerInvocation, WindowsPrivateAclBroker, defaultWindowsPrivateAclBroker, runWindowsPrivateAcl, windowsAclCache, windowsAclIdentity, aclCacheKey, secureWindowsPrivatePath, invalidateWindowsAclCache, rebindHardenedWindowsAclAfterRename, rebindHardenedWindowsDirectoryAfterOwnedMutation, isDefaultWindowsPrivatePath, secureExistingWindowsPath, linuxProcessIdentity, windowsProcessIdentityInvocation, windowsBootIdentityInvocation, windowsProcessIdentity, darwinProcessIdentity, runSmallIdentityCommand, cachedSystemBootIdentity, readInferenceSystemBootIdentity, defaultProcessIdentity, defaultCurrentProcessIdentity, processLockObservationCache, inferenceProcessIdentitiesMatch, DEFAULT_INFERENCE_HOST_INSTANCE, SAFE_INFERENCE_HOST_INSTANCE, requireNamedInstancePath, credentialStoreIdentity, inferenceHostCredentialContextPath, inferenceHostCredentialContextTransitionPath, credentialContextForConfig, WINDOWS_PRIVATE_FILE_REPLACE_ERROR_CODES;
17961
+ var loadInferenceReceiptDurabilityTimeoutMs, loadInferenceAgentDataRequestTimeoutMs, INFERENCE_CREDENTIAL_NAMESPACE, MAX_INFERENCE_PRIVATE_FILE_BYTES, WINDOWS_PRIVATE_ACL_BROKER_SCRIPT, WINDOWS_IDENTITY_COMMAND_TIMEOUT_MS, WINDOWS_PRIVATE_ACL_BROKER_STARTUP_TIMEOUT_MS, SMALL_IDENTITY_COMMAND_TIMEOUT_MS, windowsPowerShellEnvironment, windowsPrivateAclBrokerInvocation, WindowsPrivateAclBroker, defaultWindowsPrivateAclBroker, runWindowsPrivateAcl, windowsAclCache, windowsAclIdentity, aclCacheKey, secureWindowsPrivatePath, invalidateWindowsAclCache, rebindHardenedWindowsAclAfterRename, rebindHardenedWindowsDirectoryAfterOwnedMutation, isDefaultWindowsPrivatePath, secureExistingWindowsPath, linuxProcessIdentity, windowsProcessIdentityInvocation, windowsBootIdentityInvocation, windowsProcessIdentity, darwinProcessIdentity, runSmallIdentityCommand, cachedSystemBootIdentity, readInferenceSystemBootIdentity, defaultProcessIdentity, defaultCurrentProcessIdentity, processLockObservationCache, inferenceProcessIdentitiesMatch, DEFAULT_INFERENCE_HOST_INSTANCE, SAFE_INFERENCE_HOST_INSTANCE, requireNamedInstancePath, credentialStoreIdentity, inferenceHostCredentialContextPath, inferenceHostCredentialContextTransitionPath, credentialContextForConfig, WINDOWS_PRIVATE_FILE_REPLACE_ERROR_CODES;
17962
17962
  var init_config = __esm({
17963
17963
  "lib/inference-host/config.ts"() {
17964
17964
  "use strict";
17965
17965
  init_define_VTX_EXO_POLICY();
17966
17966
  init_define_VTX_PI_MODEL_POLICY();
17967
17967
  init_dist();
17968
+ loadInferenceReceiptDurabilityTimeoutMs = async () => {
17969
+ let configured;
17970
+ if (true) {
17971
+ configured = 5e3;
17972
+ } else {
17973
+ const config2 = parse4(await readFile(resolve(dirname(fileURLToPath(import.meta.url)), "../../../config.toml"), "utf8"));
17974
+ const inference = config2.external_inference;
17975
+ configured = Number(inference?.receipt_durability_timeout_seconds) * 1e3;
17976
+ }
17977
+ if (!Number.isSafeInteger(configured) || Number(configured) < 1) {
17978
+ throw new Error("Inference receipt durability timeout is missing or invalid.");
17979
+ }
17980
+ return Number(configured);
17981
+ };
17968
17982
  loadInferenceAgentDataRequestTimeoutMs = async () => {
17969
17983
  let configured;
17970
17984
  if (true) {
@@ -35774,6 +35788,11 @@ var init_runner = __esm({
35774
35788
  DEFAULT_ATTEMPT_HEARTBEAT_MS,
35775
35789
  "Attempt heartbeat interval"
35776
35790
  ),
35791
+ receiptDurabilityTimeoutMs: finitePositiveOption(
35792
+ options.receiptDurabilityTimeoutMs,
35793
+ options.receiptDurabilityTimeoutMs,
35794
+ "Receipt durability timeout"
35795
+ ),
35777
35796
  drainTimeoutMs: finitePositiveOption(
35778
35797
  options.drainTimeoutMs,
35779
35798
  DEFAULT_DRAIN_TIMEOUT_MS,
@@ -36093,7 +36112,10 @@ var init_runner = __esm({
36093
36112
  this.options = options;
36094
36113
  }
36095
36114
  async run() {
36096
- const settings = validateRunnerOptions(this.options);
36115
+ const settings = validateRunnerOptions({
36116
+ ...this.options,
36117
+ receiptDurabilityTimeoutMs: this.options.receiptDurabilityTimeoutMs ?? await loadInferenceReceiptDurabilityTimeoutMs()
36118
+ });
36097
36119
  const now = this.dependencies.now ?? Date.now;
36098
36120
  const sleep4 = this.dependencies.sleep ?? defaultSleep;
36099
36121
  const lock2 = await this.dependencies.acquireProcessLock();
@@ -36965,6 +36987,7 @@ var init_runner = __esm({
36965
36987
  retryExact,
36966
36988
  signal: controller.signal,
36967
36989
  attemptHeartbeatMs: settings.attemptHeartbeatMs,
36990
+ receiptDurabilityTimeoutMs: settings.receiptDurabilityTimeoutMs,
36968
36991
  sleep: sleep4,
36969
36992
  now,
36970
36993
  onProviderCooldown: ({ retryAtMs, reason, rateLimits }) => {
@@ -37032,9 +37055,9 @@ var init_runner = __esm({
37032
37055
  active_attempts: active.size
37033
37056
  });
37034
37057
  },
37035
- onProviderDispatchRecoveryRequired: () => {
37058
+ onProviderDispatchRecoveryRequired: (reason = "provider_dispatch_watchdog_expired") => {
37036
37059
  providerDispatchWatchdogDrainRequested = true;
37037
- requestDrain("provider_dispatch_watchdog_expired");
37060
+ requestDrain(reason);
37038
37061
  },
37039
37062
  startRetryCount: nextStartRetryCount,
37040
37063
  onAttemptStartRetry: (observation) => {
@@ -37738,14 +37761,35 @@ var init_runner = __esm({
37738
37761
  attemptAbort.abort();
37739
37762
  }, Math.max(MIN_SLEEP_MS, deadlineAtMs - now()));
37740
37763
  };
37741
- const awaitPreProviderDurability = async (operation) => Promise.race([
37742
- operation,
37743
- providerDispatchWatchdogSignal.then(() => {
37744
- throw new InferenceHostRecoveryRequiredError(
37745
- "Provider dispatch stopped because its durable receipt missed the freshness deadline."
37746
- );
37747
- })
37748
- ]);
37764
+ let receiptDurabilityUnhealthy = false;
37765
+ const awaitPreProviderDurability = async (operation) => {
37766
+ let timer;
37767
+ try {
37768
+ return await Promise.race([
37769
+ operation,
37770
+ new Promise((_resolve, reject) => {
37771
+ timer = setTimeout(() => {
37772
+ receiptDurabilityUnhealthy = true;
37773
+ options.onProviderDispatchRecoveryRequired?.("receipt_durability_timeout");
37774
+ reject(new InferenceHostRecoveryRequiredError(
37775
+ "Provider dispatch stopped because durable receipt storage did not settle."
37776
+ ));
37777
+ }, options.receiptDurabilityTimeoutMs);
37778
+ })
37779
+ ]);
37780
+ } finally {
37781
+ if (timer !== void 0) clearTimeout(timer);
37782
+ }
37783
+ };
37784
+ const requireDispatchFreshness = () => {
37785
+ if (providerDispatchNotAfterMs === void 0 || !providerDispatchWatchdogExpired && now() < providerDispatchNotAfterMs) return;
37786
+ providerDispatchWatchdogExpired = true;
37787
+ attemptAbort.abort();
37788
+ throw new InferenceHostRunnerError(
37789
+ "server_account_context_expired_before_provider_dispatch",
37790
+ "The Server account context expired before provider dispatch."
37791
+ );
37792
+ };
37749
37793
  const persistAttempt = async (changes, clearPendingClaim = false) => {
37750
37794
  const nextAttemptReceipt = validateAttemptReceipt({
37751
37795
  ...attemptReceipt,
@@ -37865,12 +37909,21 @@ var init_runner = __esm({
37865
37909
  membership_disposition: membershipFailureDisposition(failure2),
37866
37910
  failed_at: isoAt(now())
37867
37911
  });
37868
- void persistAttempt({
37912
+ const terminalDurability = persistAttempt({
37869
37913
  phase: "terminal_pending",
37870
37914
  dispatch_outcome: "not_dispatched",
37871
37915
  terminal_operation_id: failureId,
37872
37916
  terminal_request: failureRequest
37873
- }).catch(() => void 0);
37917
+ });
37918
+ if (receiptDurabilityUnhealthy) {
37919
+ void terminalDurability.catch(() => void 0);
37920
+ } else {
37921
+ try {
37922
+ await awaitPreProviderDurability(terminalDurability);
37923
+ } catch (error48) {
37924
+ if (!receiptDurabilityUnhealthy) throw error48;
37925
+ }
37926
+ }
37874
37927
  const evidenceDeadlineAtMs = Date.parse(jobInput.evidence_expires_at);
37875
37928
  const failureResult = await retryExact(() => mcp.callTool(
37876
37929
  "inference.job.fail",
@@ -37878,6 +37931,9 @@ var init_runner = __esm({
37878
37931
  { signal, deadlineAtMs: evidenceDeadlineAtMs }
37879
37932
  ), { signal, deadlineAtMs: evidenceDeadlineAtMs });
37880
37933
  assertTerminalResult(failureRequest, failureResult);
37934
+ if (!receiptDurabilityUnhealthy) {
37935
+ await awaitPreProviderDurability(removeAttempt());
37936
+ }
37881
37937
  options.onAttemptOutcome?.({
37882
37938
  outcome: "failed",
37883
37939
  failure_category: failureRequest.failure_category,
@@ -38018,6 +38074,7 @@ var init_runner = __esm({
38018
38074
  }
38019
38075
  }
38020
38076
  if (attemptReceipt.phase !== "dispatched") {
38077
+ requireDispatchFreshness();
38021
38078
  const providerDispatchable = inputValidationError === void 0 && outputContract !== null;
38022
38079
  reportPreProviderStage("receipt_persistence");
38023
38080
  await awaitPreProviderDurability(
@@ -38030,12 +38087,12 @@ var init_runner = __esm({
38030
38087
  ])
38031
38088
  );
38032
38089
  }
38090
+ if (options.resumeReceipt?.phase !== "dispatched") requireDispatchFreshness();
38033
38091
  reportPreProviderStage("thread_setup");
38034
38092
  } catch (error48) {
38035
38093
  clearProviderDispatchWatchdog();
38036
38094
  signal.removeEventListener("abort", relayAbort);
38037
38095
  if (providerDispatchWatchdogExpired) {
38038
- options.onProviderDispatchRecoveryRequired?.();
38039
38096
  return terminalizeProviderDispatchWatchdog();
38040
38097
  }
38041
38098
  throw error48;
@@ -41458,6 +41515,7 @@ Durable service:
41458
41515
  protocolVersion: EXTERNAL_INFERENCE_CONTRACT_VERSION,
41459
41516
  adapterRuntimeVersion: INFERENCE_HOST_CLI_VERSION,
41460
41517
  hostRuntimeVersion: INFERENCE_HOST_CLI_VERSION,
41518
+ receiptDurabilityTimeoutMs: await loadInferenceReceiptDurabilityTimeoutMs(),
41461
41519
  maxConcurrency: options.maxConcurrency,
41462
41520
  once: options.once,
41463
41521
  emitDiagnosticEvent: options.emitDiagnosticEvent,
@@ -41528,6 +41586,7 @@ Durable service:
41528
41586
  protocolVersion: EXTERNAL_INFERENCE_CONTRACT_VERSION,
41529
41587
  adapterRuntimeVersion: options.preflight.runtimeVersion,
41530
41588
  hostRuntimeVersion: INFERENCE_HOST_CLI_VERSION,
41589
+ receiptDurabilityTimeoutMs: await loadInferenceReceiptDurabilityTimeoutMs(),
41531
41590
  maxConcurrency: options.maxConcurrency,
41532
41591
  once: options.once,
41533
41592
  emitDiagnosticEvent: options.emitDiagnosticEvent,
@@ -48034,6 +48093,9 @@ async function postClientRuntime(path, profileId, body, options) {
48034
48093
  if (idempotencyKey) {
48035
48094
  requestHeaders["X-Idempotency-Key"] = idempotencyKey;
48036
48095
  }
48096
+ if (options?.reconcileOnly === true) {
48097
+ requestHeaders["X-Runtime-Reconcile-Only"] = "true";
48098
+ }
48037
48099
  let lastNetworkError = null;
48038
48100
  let missingRuntimeLeaseRecoveryAttempted = false;
48039
48101
  let replacementLeaseRetryUsed = false;
@@ -48799,7 +48861,7 @@ var init_api2 = __esm({
48799
48861
  return true;
48800
48862
  };
48801
48863
  isRuntimeIdempotencyInProgressError = (status, message) => status === 409 && (message.toLowerCase().includes("duplicate request already in progress") || message.toLowerCase().includes("duplicate request in-flight"));
48802
- isRetryableRuntimeConflictError = (status, error48) => status === 409 && error48.retryable === true && (error48.code === "profile_runtime_contract_busy" || error48.code === "runtime_decision_finalizing" || error48.code === "runtime_trade_sync_finalizing");
48864
+ isRetryableRuntimeConflictError = (status, error48) => status === 409 && error48.retryable === true && (error48.code === "profile_runtime_contract_busy" || error48.code === "runtime_decision_finalizing" || error48.code === "runtime_trade_sync_finalizing" || error48.code === "runtime_decision_unconfirmed");
48803
48865
  resolveClientRuntimeRetryDelayMs = (attempt, retryAfterHeader) => {
48804
48866
  const retryAfterMs = parseRuntimeRetryAfterMs(retryAfterHeader);
48805
48867
  if (retryAfterMs != null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtxmacro/cli",
3
- "version": "2026.9.20",
3
+ "version": "2026.9.21",
4
4
  "description": "VTX Macro CLI, MCP server, and durable external inference host.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",