@vtxmacro/cli 2026.9.25 → 2026.9.27

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.25",
19
+ package_version: "2026.9.27",
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.25",
72
+ package_version: "2026.9.27",
73
73
  codex_package_name: "@openai/codex",
74
74
  codex_version: "0.153.3",
75
75
  copilot_sdk_package_name: "@github/copilot-sdk",
@@ -22008,7 +22008,11 @@ child.once('close', async (code, signal) => {
22008
22008
  "EPERM"
22009
22009
  ]);
22010
22010
  MAX_RETIRED_RESPONSE_IDS = 256;
22011
- LATE_RESPONSE_SAFE_METHODS = /* @__PURE__ */ new Set(["account/rateLimits/read"]);
22011
+ LATE_RESPONSE_SAFE_METHODS = /* @__PURE__ */ new Set([
22012
+ "account/rateLimits/read",
22013
+ "turn/start",
22014
+ "turn/interrupt"
22015
+ ]);
22012
22016
  replaceCodexGuardianReceiptFile = async (temporaryPath, receiptPath, options = {}) => {
22013
22017
  const platform = options.platform ?? process.platform;
22014
22018
  const renameFile = options.renameFile ?? rename2;
@@ -22158,6 +22162,7 @@ child.once('close', async (code, signal) => {
22158
22162
  this.startedAtMs = Date.now();
22159
22163
  this.guardian = options.guardian;
22160
22164
  this.onProcessExit = options.onProcessExit;
22165
+ this.onLateResponse = options.onLateResponse;
22161
22166
  this.process.stderr.on("data", (chunk) => this.observeStderr(chunk));
22162
22167
  const lines = createInterface({ input: this.process.stdout, crlfDelay: Infinity });
22163
22168
  lines.on("line", (line) => this.handleLine(line));
@@ -22239,7 +22244,8 @@ child.once('close', async (code, signal) => {
22239
22244
  codexHome: options.codexHome,
22240
22245
  sessionGeneration: options.sessionGeneration ?? 1,
22241
22246
  guardian: guardian ?? null,
22242
- onProcessExit: options.onProcessExit ?? null
22247
+ onProcessExit: options.onProcessExit ?? null,
22248
+ onLateResponse: options.onLateResponse ?? null
22243
22249
  });
22244
22250
  try {
22245
22251
  const initialized = await session.request("initialize", {
@@ -22306,7 +22312,13 @@ child.once('close', async (code, signal) => {
22306
22312
  if (!pending) {
22307
22313
  const retiredMethod = this.retiredResponseIds.get(id2);
22308
22314
  this.retiredResponseIds.delete(id2);
22309
- if (retiredMethod && LATE_RESPONSE_SAFE_METHODS.has(retiredMethod)) return;
22315
+ if (retiredMethod && LATE_RESPONSE_SAFE_METHODS.has(retiredMethod)) {
22316
+ try {
22317
+ this.onLateResponse?.(retiredMethod);
22318
+ } catch {
22319
+ }
22320
+ return;
22321
+ }
22310
22322
  this.failTransport("unexpected_response_id");
22311
22323
  return;
22312
22324
  }
@@ -24631,6 +24643,15 @@ var init_codex_adapter = __esm({
24631
24643
  spawnProcess: this.dependencies.spawnProcess,
24632
24644
  guardian: processToken && processReceiptPath ? { processToken, receiptPath: processReceiptPath, bootIdentity: bootIdentity ?? void 0 } : void 0,
24633
24645
  sessionGeneration,
24646
+ onLateResponse: (method) => {
24647
+ this.emitDiagnostic({
24648
+ event: "codex_app_server_late_response_ignored",
24649
+ method,
24650
+ session_generation: sessionGeneration,
24651
+ active_attempt_ids: [...activeAttemptIds].sort().slice(0, 64),
24652
+ active_attempt_ids_truncated: activeAttemptIds.size > 64
24653
+ });
24654
+ },
24634
24655
  onProcessExit: (diagnostics) => {
24635
24656
  this.emitDiagnostic({
24636
24657
  event: "codex_app_server_closed",
@@ -25133,12 +25154,11 @@ var init_codex_adapter = __esm({
25133
25154
  if (sessionLease && (!sessionLease.session.isUsable() || error48 instanceof CodexAppServerError && (error48.category === "transport" || [
25134
25155
  "rpc_rejected",
25135
25156
  "invalid_rpc_result",
25136
- "rpc_timeout",
25137
25157
  "capability_preflight_invalidation_unconfirmed",
25138
25158
  "invalid_thread_provenance",
25139
25159
  "thread_cleanup_identity_missing",
25140
25160
  "thread_delete_unconfirmed"
25141
- ].includes(error48.code)))) {
25161
+ ].includes(error48.code) || error48.code === "rpc_timeout" && !(turnEntered && threadId)))) {
25142
25162
  try {
25143
25163
  await this.invalidateDurableSession(sessionLease);
25144
25164
  } catch (invalidationError) {
@@ -39451,6 +39471,124 @@ var init_runner = __esm({
39451
39471
  }
39452
39472
  });
39453
39473
 
39474
+ // lib/runtime-policy.generated.json with { type: 'json' }
39475
+ var runtime_policy_generated_default;
39476
+ var init_runtime_policy_generated = __esm({
39477
+ "lib/runtime-policy.generated.json with { type: 'json' }"() {
39478
+ runtime_policy_generated_default = {
39479
+ ui: {
39480
+ auth_bootstrap_retry: {
39481
+ max_attempts: 3,
39482
+ jitter_milliseconds: 750,
39483
+ base_delay_milliseconds: 500,
39484
+ min_delay_milliseconds: 250,
39485
+ max_delay_milliseconds: 1e4
39486
+ }
39487
+ },
39488
+ ai_dashboard: {
39489
+ market_news_bounds: {
39490
+ max_items_min: 1,
39491
+ max_items_max: 100,
39492
+ lookback_hours_min: 1,
39493
+ lookback_hours_max: 168,
39494
+ max_items_steps: [
39495
+ 1,
39496
+ 2,
39497
+ 3,
39498
+ 4,
39499
+ 5,
39500
+ 6,
39501
+ 7,
39502
+ 8,
39503
+ 9,
39504
+ 10,
39505
+ 15,
39506
+ 20,
39507
+ 25,
39508
+ 30,
39509
+ 40,
39510
+ 50,
39511
+ 60,
39512
+ 75,
39513
+ 90,
39514
+ 100
39515
+ ],
39516
+ lookback_hours_steps: [
39517
+ 1,
39518
+ 2,
39519
+ 4,
39520
+ 8,
39521
+ 12,
39522
+ 24,
39523
+ 48,
39524
+ 72,
39525
+ 168
39526
+ ]
39527
+ }
39528
+ },
39529
+ trading: {
39530
+ engine: {
39531
+ client_runtime: {
39532
+ recovery: {
39533
+ resume_retry_base_delay_ms: 1e3,
39534
+ resume_retry_max_delay_ms: 3e4,
39535
+ transient_load_min_delay_ms: 3e4,
39536
+ transient_load_max_delay_ms: 12e4,
39537
+ rate_limit_buffer_ms: 1e3,
39538
+ rate_limit_max_delay_ms: 3e5,
39539
+ engine_stop_settle_retry_delay_ms: 250,
39540
+ recoverable_reset_settle_retry_delay_ms: 1500,
39541
+ local_ai_preflight_timeout_ms: 3e3,
39542
+ surge_stagger_max_ms: 6e4,
39543
+ surge_stagger_min_ms: 2e3,
39544
+ surge_stagger_min_candidates: 4,
39545
+ stagger_deadline_ttl_ms: 3e5,
39546
+ server_active_reprobe_delay_ms: 6e4,
39547
+ transient_load_jitter_ms: 1e4,
39548
+ cross_host_completed_ttl_ms: 15e3,
39549
+ telemetry_dedupe_ttl_ms: 5e3,
39550
+ browser_presence_heartbeat_interval_ms: 3e4,
39551
+ host_liveness_heartbeat_interval_ms: 3e4,
39552
+ host_liveness_recovery_nudge_ttl_ms: 1e4
39553
+ }
39554
+ }
39555
+ }
39556
+ },
39557
+ external_inference: {
39558
+ service: {
39559
+ startup_max_attempts: 40,
39560
+ startup_poll_interval_ms: 250,
39561
+ restart_stable_uptime_ms: 6e4,
39562
+ restart_backoff_base_ms: 1e3,
39563
+ restart_backoff_max_ms: 3e4,
39564
+ restart_exponent_max: 5
39565
+ }
39566
+ },
39567
+ desktop: {
39568
+ runtime_watchdog: {
39569
+ ping_interval_milliseconds: 15e3,
39570
+ telemetry_interval_milliseconds: 3e5
39571
+ }
39572
+ },
39573
+ screener: {
39574
+ resource_scheduler: {
39575
+ client_lock_ttl_milliseconds: 12e4,
39576
+ client_poll_interval_milliseconds: 250
39577
+ }
39578
+ },
39579
+ deployment: {
39580
+ cutover_buffer: {
39581
+ target_timeout_ms: 3e3,
39582
+ retired_timeout_ms: 45e3,
39583
+ max_body_bytes: 33554432,
39584
+ max_inflight: 16,
39585
+ max_queue: 64
39586
+ }
39587
+ }
39588
+ };
39589
+ }
39590
+ });
39591
+
39454
39592
  // lib/inference-host/service.ts
39455
39593
  import { spawn as spawn7 } from "node:child_process";
39456
39594
  import { randomUUID as randomUUID6 } from "node:crypto";
@@ -39464,6 +39602,7 @@ var init_service = __esm({
39464
39602
  "use strict";
39465
39603
  init_define_VTX_EXO_POLICY();
39466
39604
  init_define_VTX_PI_MODEL_POLICY();
39605
+ init_runtime_policy_generated();
39467
39606
  init_durable_adapter();
39468
39607
  init_config();
39469
39608
  SERVICE_NAME = "VTX Macro Inference Host";
@@ -39870,7 +40009,7 @@ WantedBy=default.target
39870
40009
  await new Promise((resolvePromise) => setTimeout(resolvePromise, milliseconds));
39871
40010
  });
39872
40011
  this.stopWaitAttempts = dependencies.stopWaitAttempts ?? SERVICE_COOPERATIVE_STOP_SECONDS * 4;
39873
- this.startWaitAttempts = dependencies.startWaitAttempts ?? 40;
40012
+ this.startWaitAttempts = dependencies.startWaitAttempts ?? runtime_policy_generated_default.external_inference.service.startup_max_attempts;
39874
40013
  this.reconcileWaitAttempts = dependencies.reconcileWaitAttempts ?? SERVICE_COOPERATIVE_STOP_SECONDS * 4;
39875
40014
  this.confirmInitialReadiness = dependencies.confirmInitialReadiness ?? true;
39876
40015
  this.acquireProcessLock = dependencies.acquireProcessLock ?? acquireInferenceHostProcessLock;
@@ -40001,9 +40140,9 @@ WantedBy=default.target
40001
40140
  for (let attempt = 0; attempt < this.startWaitAttempts; attempt += 1) {
40002
40141
  const status = await this.status();
40003
40142
  if (status.manager_active) return status;
40004
- await this.sleep(250);
40143
+ await this.sleep(runtime_policy_generated_default.external_inference.service.startup_poll_interval_ms);
40005
40144
  }
40006
- throw new Error("Background service did not reach an active state within 10 seconds.");
40145
+ throw new Error(`Background service did not reach an active state within ${this.startWaitAttempts * runtime_policy_generated_default.external_inference.service.startup_poll_interval_ms / 1e3} seconds.`);
40007
40146
  }
40008
40147
  async restoreRunningSupervisor(manifest, preserveGeneration = false, targetInstanceName) {
40009
40148
  const previousRuntime = await readRuntimeAcrossAtomicReplacement(this.runtimePath()).catch(() => null);
@@ -40804,8 +40943,8 @@ ${result2.stderr}`)) {
40804
40943
  throw new Error("worker_cooperative_stop_timeout");
40805
40944
  }
40806
40945
  if (signal.aborted || record3.controller.signal.aborted || !await readDesiredAcrossAtomicReplacement(desiredPath)) break;
40807
- failures = result2.uptimeMs >= 6e4 ? 0 : failures + 1;
40808
- const retryAfterMs = Math.min(1e3 * 2 ** Math.min(failures, 5), 3e4);
40946
+ failures = result2.uptimeMs >= runtime_policy_generated_default.external_inference.service.restart_stable_uptime_ms ? 0 : failures + 1;
40947
+ const retryAfterMs = Math.min(runtime_policy_generated_default.external_inference.service.restart_backoff_base_ms * 2 ** Math.min(failures, runtime_policy_generated_default.external_inference.service.restart_exponent_max), runtime_policy_generated_default.external_inference.service.restart_backoff_max_ms);
40809
40948
  await updateRecord(record3, "failed", "worker_exited");
40810
40949
  await appendServiceLog(serviceManifest.log_path, "worker_exited", {
40811
40950
  instance_name: record3.worker.instance_name,
@@ -40819,7 +40958,7 @@ ${result2.stderr}`)) {
40819
40958
  if (error48 instanceof Error && error48.message === "worker_cooperative_stop_timeout") throw error48;
40820
40959
  if (signal.aborted || record3.controller.signal.aborted) break;
40821
40960
  failures += 1;
40822
- const retryAfterMs = Math.min(1e3 * 2 ** Math.min(failures, 5), 3e4);
40961
+ const retryAfterMs = Math.min(runtime_policy_generated_default.external_inference.service.restart_backoff_base_ms * 2 ** Math.min(failures, runtime_policy_generated_default.external_inference.service.restart_exponent_max), runtime_policy_generated_default.external_inference.service.restart_backoff_max_ms);
40823
40962
  await updateRecord(record3, "failed", "worker_launch_failed");
40824
40963
  await appendServiceLog(serviceManifest.log_path, "worker_launch_failed", {
40825
40964
  instance_name: record3.worker.instance_name,
@@ -47786,6 +47925,124 @@ var init_local_breadcrumbs = __esm({
47786
47925
  }
47787
47926
  });
47788
47927
 
47928
+ // lib/runtime-policy.generated.json
47929
+ var runtime_policy_generated_default2;
47930
+ var init_runtime_policy_generated2 = __esm({
47931
+ "lib/runtime-policy.generated.json"() {
47932
+ runtime_policy_generated_default2 = {
47933
+ ui: {
47934
+ auth_bootstrap_retry: {
47935
+ max_attempts: 3,
47936
+ jitter_milliseconds: 750,
47937
+ base_delay_milliseconds: 500,
47938
+ min_delay_milliseconds: 250,
47939
+ max_delay_milliseconds: 1e4
47940
+ }
47941
+ },
47942
+ ai_dashboard: {
47943
+ market_news_bounds: {
47944
+ max_items_min: 1,
47945
+ max_items_max: 100,
47946
+ lookback_hours_min: 1,
47947
+ lookback_hours_max: 168,
47948
+ max_items_steps: [
47949
+ 1,
47950
+ 2,
47951
+ 3,
47952
+ 4,
47953
+ 5,
47954
+ 6,
47955
+ 7,
47956
+ 8,
47957
+ 9,
47958
+ 10,
47959
+ 15,
47960
+ 20,
47961
+ 25,
47962
+ 30,
47963
+ 40,
47964
+ 50,
47965
+ 60,
47966
+ 75,
47967
+ 90,
47968
+ 100
47969
+ ],
47970
+ lookback_hours_steps: [
47971
+ 1,
47972
+ 2,
47973
+ 4,
47974
+ 8,
47975
+ 12,
47976
+ 24,
47977
+ 48,
47978
+ 72,
47979
+ 168
47980
+ ]
47981
+ }
47982
+ },
47983
+ trading: {
47984
+ engine: {
47985
+ client_runtime: {
47986
+ recovery: {
47987
+ resume_retry_base_delay_ms: 1e3,
47988
+ resume_retry_max_delay_ms: 3e4,
47989
+ transient_load_min_delay_ms: 3e4,
47990
+ transient_load_max_delay_ms: 12e4,
47991
+ rate_limit_buffer_ms: 1e3,
47992
+ rate_limit_max_delay_ms: 3e5,
47993
+ engine_stop_settle_retry_delay_ms: 250,
47994
+ recoverable_reset_settle_retry_delay_ms: 1500,
47995
+ local_ai_preflight_timeout_ms: 3e3,
47996
+ surge_stagger_max_ms: 6e4,
47997
+ surge_stagger_min_ms: 2e3,
47998
+ surge_stagger_min_candidates: 4,
47999
+ stagger_deadline_ttl_ms: 3e5,
48000
+ server_active_reprobe_delay_ms: 6e4,
48001
+ transient_load_jitter_ms: 1e4,
48002
+ cross_host_completed_ttl_ms: 15e3,
48003
+ telemetry_dedupe_ttl_ms: 5e3,
48004
+ browser_presence_heartbeat_interval_ms: 3e4,
48005
+ host_liveness_heartbeat_interval_ms: 3e4,
48006
+ host_liveness_recovery_nudge_ttl_ms: 1e4
48007
+ }
48008
+ }
48009
+ }
48010
+ },
48011
+ external_inference: {
48012
+ service: {
48013
+ startup_max_attempts: 40,
48014
+ startup_poll_interval_ms: 250,
48015
+ restart_stable_uptime_ms: 6e4,
48016
+ restart_backoff_base_ms: 1e3,
48017
+ restart_backoff_max_ms: 3e4,
48018
+ restart_exponent_max: 5
48019
+ }
48020
+ },
48021
+ desktop: {
48022
+ runtime_watchdog: {
48023
+ ping_interval_milliseconds: 15e3,
48024
+ telemetry_interval_milliseconds: 3e5
48025
+ }
48026
+ },
48027
+ screener: {
48028
+ resource_scheduler: {
48029
+ client_lock_ttl_milliseconds: 12e4,
48030
+ client_poll_interval_milliseconds: 250
48031
+ }
48032
+ },
48033
+ deployment: {
48034
+ cutover_buffer: {
48035
+ target_timeout_ms: 3e3,
48036
+ retired_timeout_ms: 45e3,
48037
+ max_body_bytes: 33554432,
48038
+ max_inflight: 16,
48039
+ max_queue: 64
48040
+ }
48041
+ }
48042
+ };
48043
+ }
48044
+ });
48045
+
47789
48046
  // lib/api/shared.ts
47790
48047
  function getProfileHeaders(baseHeaders = {}, explicitProfileId) {
47791
48048
  const headers = { ...baseHeaders };
@@ -47793,12 +48050,13 @@ function getProfileHeaders(baseHeaders = {}, explicitProfileId) {
47793
48050
  if (profileId) headers["x-profile-id"] = profileId.toString();
47794
48051
  return headers;
47795
48052
  }
47796
- var getApiUrl, API_URL, sleep2, isTransientNetworkFetchError, createIdempotencyKey, getErrorMessage, getErrorPayloadOrEmpty, getErrorPayloadOrFallbackDetail, getErrorMessageFromResponse, activeProfileId, PROFILE_STORAGE_KEY;
48053
+ var getApiUrl, API_URL, sleep2, AUTH_BOOTSTRAP_GET_MAX_ATTEMPTS, AUTH_BOOTSTRAP_RETRY_JITTER_MS, isTransientNetworkFetchError, createIdempotencyKey, getErrorMessage, getErrorPayloadOrEmpty, getErrorPayloadOrFallbackDetail, getErrorMessageFromResponse, activeProfileId, PROFILE_STORAGE_KEY;
47797
48054
  var init_shared = __esm({
47798
48055
  "lib/api/shared.ts"() {
47799
48056
  "use strict";
47800
48057
  init_define_VTX_EXO_POLICY();
47801
48058
  init_define_VTX_PI_MODEL_POLICY();
48059
+ init_runtime_policy_generated2();
47802
48060
  init_abort();
47803
48061
  getApiUrl = () => {
47804
48062
  if (typeof window === "undefined") {
@@ -47829,6 +48087,8 @@ var init_shared = __esm({
47829
48087
  };
47830
48088
  API_URL = getApiUrl();
47831
48089
  sleep2 = (ms) => new Promise((resolve10) => setTimeout(resolve10, ms));
48090
+ AUTH_BOOTSTRAP_GET_MAX_ATTEMPTS = runtime_policy_generated_default2.ui.auth_bootstrap_retry.max_attempts;
48091
+ AUTH_BOOTSTRAP_RETRY_JITTER_MS = runtime_policy_generated_default2.ui.auth_bootstrap_retry.jitter_milliseconds;
47832
48092
  isTransientNetworkFetchError = (error48) => {
47833
48093
  const message = error48 instanceof Error ? error48.message : String(error48 || "");
47834
48094
  const normalized = message.toLowerCase();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtxmacro/cli",
3
- "version": "2026.9.25",
3
+ "version": "2026.9.27",
4
4
  "description": "VTX Macro CLI, MCP server, and durable external inference host.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",