@vtxmacro/cli 2026.9.31 → 2026.9.33

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.31",
19
+ package_version: "2026.9.33",
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
@@ -77,7 +77,7 @@ var init_agent_cli_release = __esm({
77
77
  "agent-cli-release.json"() {
78
78
  agent_cli_release_default = {
79
79
  package_name: "@vtxmacro/cli",
80
- package_version: "2026.9.31",
80
+ package_version: "2026.9.33",
81
81
  codex_package_name: "@openai/codex",
82
82
  codex_version: "0.153.3",
83
83
  copilot_sdk_package_name: "@github/copilot-sdk",
@@ -14722,7 +14722,7 @@ var init_zod = __esm({
14722
14722
  });
14723
14723
 
14724
14724
  // lib/external-inference-contract.ts
14725
- var EXTERNAL_INFERENCE_CONTRACT_VERSION, EXTERNAL_INFERENCE_CONTROLLER_SCHEMA_VERSION, EXTERNAL_INFERENCE_CONTROLLER_SCHEMA_VERSION_V2, EXTERNAL_INFERENCE_ADVERTISEMENT_SCHEMA_VERSION, EXTERNAL_INFERENCE_ENVELOPE_SCHEMA_VERSION, EXTERNAL_INFERENCE_COMPRESSED_INPUT_ENVELOPE_SCHEMA_VERSION, EXTERNAL_INFERENCE_JOB_INPUT_SCHEMA_VERSION, LEGACY_EXTERNAL_INFERENCE_JOB_INPUT_SCHEMA_VERSION, EXTERNAL_INFERENCE_USAGE_SCHEMA_VERSION, EXTERNAL_INFERENCE_INPUT_HASH_DOMAIN, MAX_EXTERNAL_INFERENCE_STATUS_HOSTS, MAX_PROFILE_EXTERNAL_INFERENCE_FALLBACKS_PER_LANE, MAX_GENERATION, MAX_SAFE_INTEGER, MAX_PROMPT_BYTES, MAX_IMMUTABLE_JOB_INPUT_BYTES, MAX_CANDIDATE_PLAINTEXT_BYTES, MAX_CIPHERTEXT_CHARS, SHA256_INITIAL_STATE, SHA256_ROUND_CONSTANTS, rotateRight, sha256BytesHex, sha256Utf8Hex, computeImmutableJobInputSha256, identifierSchema, operationIdentifierSchema, sha256HexSchema, generationSchema, zeroBasedGenerationSchema, nonNegativeSafeIntegerSchema, positiveSafeIntegerSchema, sqlIntegerTokenCountSchema, timestampSchema, safeCodeSchema, processExitCodeSchema, externalInferenceAdapterIdSchema, reasoningEffortSchema, modelNameSchema, displayNameSchema, authenticatedAccountEmailSchema, protocolVersionSchema, base64UrlAlphabet, isCanonicalBase64Url, base64Url32BytesSchema, base64UrlNonceSchema, base64UrlCiphertextSchema, claimHandleSchema, boundedJsonTextSchema, boundedPromptTextSchema, laneSchema, botModeSchema, executionModeSchema, responseModeSchema, controlModeSchema, dispatchOutcomeSchema, responseOutcomeSchema, nativeModelControllerSchema, legacyExternalAgentModelControllerSchema, externalAgentModelControllerSchema, boundExternalAgentModelControllerSchema, externalAgentUnboundControllerSchema, externalAgentUnboundControllerV2Schema, orderedFallbackHostIdsSchema, externalInferenceFallbackHostIdsSchema, liveModelControllerSchema, snapshotModelControllerSchema, modelIdentityMappingSchema, advertisedModelSchema, hostAdvertisementSchema, envelopeAadSchema, validateEnvelopeAad, commonEnvelopeShape, sealedKeyWrapEnvelopeSchema, sealedInputEnvelopeSchema, sealedCandidateEnvelopeSchema, sealedEnvelopeSchema, screenerCandidateRuntimeBindingSchema, screenerClientLeaseBindingSchema, screenerRuntimeBindingSchema, serverRuntimeBindingSchema, clientRuntimeBindingSchema, runtimeBindingSchema, immutableJobInputSchema, canonicalizeJsonValue, serializeImmutableJobInput, reportedTokenUsageSchema, unavailableTokenUsageSchema, tokenUsageSchema, agentTurnReceiptSchema, agentConnectRequestSchema, agentNextRequestSchema, agentHeartbeatRequestSchema, emptyAgentNextResultSchema, claimedAgentNextResultSchema, agentNextResultSchema, agentCompleteRequestSchema, agentFailRequestSchema, requestedModelSelectionSchema, completedModelProvenanceSchema, attemptModelProvenanceSchema, providerWeeklyQuotaReadSchema, hostHeartbeatRequestSchema, jobClaimRequestBaseShape, jobClaimRequestSchema, emptyJobClaimSchema, claimedJobSchema, claimedDispatchIntentSchema, batchedJobClaimSchema, timedBatchedJobClaimSchema, jobClaimResultSchema, attemptStartRequestSchema, jobHeartbeatRequestSchema, continueHeartbeatDirectiveSchema, cancelHeartbeatDirectiveSchema, jobHeartbeatResultSchema, adapterOutcomeEvidenceSchema, completionBaseShape, validateCompletion, providerResponseCompletionSchema, decisionCandidateCompletionSchema, jobCompleteRequestSchema, codexProcessExitDiagnosticsSchema, jobFailRequestSchema, jobCancelRequestSchema, jobCancellationReceiptSchema, jobDeliveryRequestSchema, deliveryBaseShape, validateDeliveryCandidate, providerResponseDeliverySchema, decisionCandidateDeliverySchema, jobDeliveryResultSchema, jobConsumptionRequestSchema, jobConsumptionReceiptSchema, jobStateSchema, jobStatusReadSchema, hostStatusReadSchema, controllerBindingStatusReadSchema, queueStatusReadSchema, outcomeStatusReadSchema, externalInferenceVolumeWindowReadSchema, externalInferenceFailureCountReadSchema, externalInferenceHostDiagnosticsReadSchema, externalInferenceProfileActivityReadSchema, externalInferenceStatusReadSchema, nativeResearchEvidenceSourceSchema, externalAgentResearchEvidenceSourceSchema, researchEvidenceSourceSchema, reportedResearchTokenUsageSchema, unavailableResearchTokenUsageSchema, researchTokenUsageSchema, externalInferenceProductLineageBaseShape, traderExternalInferenceProductLineageSchema, decisionChatExternalInferenceProductLineageSchema, screenerExternalInferenceProductLineageSchema, externalInferenceProductLineageSchema, normalProductLinkageSchema, evidenceMaterializationMarkerSchema, deliveredExternalAgentSourceIdentitySchema, deliveredRequestEvidenceSchema, researchEvidenceBaseShape, researchEvidenceBaseSchema, validateExactUtf8, validateResearchEvidence, providerResponseResearchEvidenceSchema, decisionCandidateResearchEvidenceSchema, researchEvidenceSchema;
14725
+ var EXTERNAL_INFERENCE_CONTRACT_VERSION, EXTERNAL_INFERENCE_CONTROLLER_SCHEMA_VERSION, EXTERNAL_INFERENCE_CONTROLLER_SCHEMA_VERSION_V2, EXTERNAL_INFERENCE_ADVERTISEMENT_SCHEMA_VERSION, EXTERNAL_INFERENCE_ENVELOPE_SCHEMA_VERSION, EXTERNAL_INFERENCE_COMPRESSED_INPUT_ENVELOPE_SCHEMA_VERSION, EXTERNAL_INFERENCE_JOB_INPUT_SCHEMA_VERSION, LEGACY_EXTERNAL_INFERENCE_JOB_INPUT_SCHEMA_VERSION, EXTERNAL_INFERENCE_USAGE_SCHEMA_VERSION, EXTERNAL_INFERENCE_INPUT_HASH_DOMAIN, MAX_EXTERNAL_INFERENCE_STATUS_HOSTS, MAX_PROFILE_EXTERNAL_INFERENCE_FALLBACKS_PER_LANE, MAX_GENERATION, MAX_SAFE_INTEGER, MAX_PROMPT_BYTES, MAX_IMMUTABLE_JOB_INPUT_BYTES, MAX_CANDIDATE_PLAINTEXT_BYTES, MAX_CIPHERTEXT_CHARS, SHA256_INITIAL_STATE, SHA256_ROUND_CONSTANTS, rotateRight, sha256BytesHex, sha256Utf8Hex, computeImmutableJobInputSha256, identifierSchema, operationIdentifierSchema, sha256HexSchema, generationSchema, zeroBasedGenerationSchema, nonNegativeSafeIntegerSchema, positiveSafeIntegerSchema, sqlIntegerTokenCountSchema, timestampSchema, safeCodeSchema, processExitCodeSchema, externalInferenceAdapterIdSchema, reasoningEffortSchema, modelNameSchema, displayNameSchema, authenticatedAccountEmailSchema, protocolVersionSchema, base64UrlAlphabet, isCanonicalBase64Url, base64Url32BytesSchema, base64UrlNonceSchema, base64UrlCiphertextSchema, claimHandleSchema, boundedJsonTextSchema, boundedPromptTextSchema, laneSchema, botModeSchema, executionModeSchema, responseModeSchema, controlModeSchema, dispatchOutcomeSchema, responseOutcomeSchema, nativeModelControllerSchema, legacyExternalAgentModelControllerSchema, externalAgentModelControllerSchema, boundExternalAgentModelControllerSchema, externalAgentUnboundControllerSchema, externalAgentUnboundControllerV2Schema, orderedFallbackHostIdsSchema, externalInferenceFallbackHostIdsSchema, liveModelControllerSchema, snapshotModelControllerSchema, modelIdentityMappingSchema, advertisedModelSchema, hostAdvertisementSchema, envelopeAadSchema, validateEnvelopeAad, commonEnvelopeShape, sealedKeyWrapEnvelopeSchema, sealedInputEnvelopeSchema, sealedCandidateEnvelopeSchema, sealedEnvelopeSchema, screenerCandidateRuntimeBindingSchema, screenerClientLeaseBindingSchema, screenerRuntimeBindingSchema, serverRuntimeBindingSchema, clientRuntimeBindingSchema, runtimeBindingSchema, immutableJobInputSchema, canonicalizeJsonValue, serializeImmutableJobInput, reportedTokenUsageSchema, unavailableTokenUsageSchema, tokenUsageSchema, grokToolValidationDiagnosticSchema, agentTurnReceiptSchema, agentConnectRequestSchema, agentNextRequestSchema, agentHeartbeatRequestSchema, emptyAgentNextResultSchema, claimedAgentNextResultSchema, agentNextResultSchema, agentCompleteRequestSchema, agentFailRequestSchema, requestedModelSelectionSchema, completedModelProvenanceSchema, attemptModelProvenanceSchema, providerWeeklyQuotaReadSchema, hostHeartbeatRequestSchema, jobClaimRequestBaseShape, jobClaimRequestSchema, emptyJobClaimSchema, claimedJobSchema, claimedDispatchIntentSchema, batchedJobClaimSchema, timedBatchedJobClaimSchema, jobClaimResultSchema, attemptStartRequestSchema, jobHeartbeatRequestSchema, continueHeartbeatDirectiveSchema, cancelHeartbeatDirectiveSchema, jobHeartbeatResultSchema, adapterOutcomeEvidenceSchema, completionBaseShape, validateCompletion, providerResponseCompletionSchema, decisionCandidateCompletionSchema, jobCompleteRequestSchema, codexProcessExitDiagnosticsSchema, jobFailRequestSchema, jobCancelRequestSchema, jobCancellationReceiptSchema, jobDeliveryRequestSchema, deliveryBaseShape, validateDeliveryCandidate, providerResponseDeliverySchema, decisionCandidateDeliverySchema, jobDeliveryResultSchema, jobConsumptionRequestSchema, jobConsumptionReceiptSchema, jobStateSchema, jobStatusReadSchema, hostStatusReadSchema, controllerBindingStatusReadSchema, queueStatusReadSchema, outcomeStatusReadSchema, externalInferenceVolumeWindowReadSchema, externalInferenceFailureCountReadSchema, externalInferenceHostDiagnosticsReadSchema, externalInferenceProfileActivityReadSchema, externalInferenceStatusReadSchema, nativeResearchEvidenceSourceSchema, externalAgentResearchEvidenceSourceSchema, researchEvidenceSourceSchema, reportedResearchTokenUsageSchema, unavailableResearchTokenUsageSchema, researchTokenUsageSchema, externalInferenceProductLineageBaseShape, traderExternalInferenceProductLineageSchema, decisionChatExternalInferenceProductLineageSchema, screenerExternalInferenceProductLineageSchema, externalInferenceProductLineageSchema, normalProductLinkageSchema, evidenceMaterializationMarkerSchema, deliveredExternalAgentSourceIdentitySchema, deliveredRequestEvidenceSchema, researchEvidenceBaseShape, researchEvidenceBaseSchema, validateExactUtf8, validateResearchEvidence, providerResponseResearchEvidenceSchema, decisionCandidateResearchEvidenceSchema, researchEvidenceSchema;
14726
14726
  var init_external_inference_contract = __esm({
14727
14727
  "lib/external-inference-contract.ts"() {
14728
14728
  "use strict";
@@ -15490,9 +15490,37 @@ var init_external_inference_contract = __esm({
15490
15490
  reportedTokenUsageSchema,
15491
15491
  unavailableTokenUsageSchema
15492
15492
  ]);
15493
+ grokToolValidationDiagnosticSchema = external_exports.strictObject({
15494
+ schema_version: external_exports.literal("external_inference_grok_tool_validation_v1"),
15495
+ reason: external_exports.enum(["invalid_tools", "invalid_type", "missing_name", "unexpected_tools"]),
15496
+ route: external_exports.enum(["/responses", "/chat/completions"]),
15497
+ tools_shape: external_exports.enum(["undefined", "null", "array", "object", "string", "number", "boolean", "bigint", "symbol", "function"]),
15498
+ tool_count: nonNegativeSafeIntegerSchema.nullable(),
15499
+ expected_tool_count: nonNegativeSafeIntegerSchema,
15500
+ tools: external_exports.array(external_exports.strictObject({
15501
+ type: external_exports.enum(["function", "web_search", "web_search_preview", "file_search", "computer_use", "missing", "invalid", "redacted"]),
15502
+ name: external_exports.enum(["search_tool", "use_tool", "bash", "read_file", "write_file", "edit_file", "web_search", "vtx_get_data", "vtx_submit_decision", "vtx_decision_status", "missing", "invalid", "redacted"]),
15503
+ type_sha256: sha256HexSchema.nullable(),
15504
+ name_sha256: sha256HexSchema.nullable()
15505
+ }).refine(
15506
+ (tool) => tool.type === "redacted" === (tool.type_sha256 !== null) && tool.name === "redacted" === (tool.name_sha256 !== null),
15507
+ { message: "Only redacted tool identifiers require hashes." }
15508
+ )).max(8),
15509
+ tools_truncated: external_exports.boolean(),
15510
+ prior_dispatch: external_exports.boolean(),
15511
+ completed_response_count: nonNegativeSafeIntegerSchema
15512
+ }).refine(
15513
+ (value) => value.tools_shape === "array" ? value.tool_count !== null && value.tools.length === Math.min(value.tool_count, 8) && value.tools_truncated === value.tool_count > 8 : value.tool_count === null && value.tools.length === 0 && !value.tools_truncated,
15514
+ { message: "Grok tool diagnostic counts must match the observed shape." }
15515
+ ).refine(
15516
+ (value) => value.prior_dispatch || value.completed_response_count === 0,
15517
+ { message: "Completed responses require prior dispatch." }
15518
+ );
15493
15519
  agentTurnReceiptSchema = external_exports.strictObject({
15494
15520
  terminal_status: external_exports.enum(["completed", "failed"]),
15495
15521
  failure_code: safeCodeSchema.nullable(),
15522
+ grok_tool_validation: grokToolValidationDiagnosticSchema.optional(),
15523
+ dispatch_outcome: external_exports.enum(["not_dispatched", "outcome_unknown"]).optional(),
15496
15524
  turn_id: external_exports.string().uuid(),
15497
15525
  agent_run_id: identifierSchema,
15498
15526
  requested_model: modelNameSchema,
@@ -15509,6 +15537,9 @@ var init_external_inference_contract = __esm({
15509
15537
  { message: "Agent decision operation IDs must be unique." }
15510
15538
  )
15511
15539
  }).refine(
15540
+ (value) => value.grok_tool_validation === void 0 ? value.dispatch_outcome === void 0 : value.terminal_status === "failed" && value.failure_code === `grok_tool_isolation_${value.grok_tool_validation.reason}` && value.dispatch_outcome === (value.grok_tool_validation.prior_dispatch ? "outcome_unknown" : "not_dispatched") && value.effective_model === null && value.effective_reasoning_effort === null && value.adapter_request_id === null && value.adapter_response_id === null && value.usage.availability === "unavailable",
15541
+ { message: "Grok diagnostics must match the failed Agent turn and dispatch outcome." }
15542
+ ).refine(
15512
15543
  (value) => value.terminal_status === "failed" ? value.failure_code !== null : value.failure_code === null && value.effective_model !== null && value.effective_reasoning_effort !== null && value.adapter_response_id !== null,
15513
15544
  { message: "Agent terminal evidence is incomplete." }
15514
15545
  ).refine((value) => Date.parse(value.completed_at) >= Date.parse(value.started_at), {
@@ -16006,6 +16037,7 @@ var init_external_inference_contract = __esm({
16006
16037
  adapter_result_ready_at: timestampSchema.optional(),
16007
16038
  provider_dispatch_freshness_remaining_ms: nonNegativeSafeIntegerSchema.nullable().optional(),
16008
16039
  process_exit: codexProcessExitDiagnosticsSchema.nullable().optional(),
16040
+ grok_tool_validation: grokToolValidationDiagnosticSchema.optional(),
16009
16041
  membership_disposition: external_exports.enum([
16010
16042
  "retry_same_host",
16011
16043
  "cascade_cooldown",
@@ -16015,6 +16047,9 @@ var init_external_inference_contract = __esm({
16015
16047
  ]).optional(),
16016
16048
  failed_at: timestampSchema
16017
16049
  }).superRefine((value, context) => {
16050
+ if (value.grok_tool_validation !== void 0 && (value.failure_code !== `grok_tool_isolation_${value.grok_tool_validation.reason}` || value.outcome.dispatch_outcome !== (value.grok_tool_validation.prior_dispatch ? "outcome_unknown" : "not_dispatched"))) {
16051
+ context.addIssue({ code: "custom", message: "Grok diagnostics must match the failure and dispatch outcome.", path: ["grok_tool_validation"] });
16052
+ }
16018
16053
  if (value.provider_retry_at != null !== (value.provider_retry_source != null)) {
16019
16054
  context.addIssue({ code: "custom", message: "provider retry deadline and source must be provided together", path: ["provider_retry_at"] });
16020
16055
  }
@@ -19940,6 +19975,19 @@ var init_mcp_client = __esm({
19940
19975
  #requestId = 0;
19941
19976
  #initialized = false;
19942
19977
  #providerQuotaRecoverySupported = false;
19978
+ #grokToolValidationTools = /* @__PURE__ */ new Set();
19979
+ supportsGrokToolValidationDiagnostics(tool) {
19980
+ return this.#grokToolValidationTools.has(tool);
19981
+ }
19982
+ async refreshGrokToolValidationSupport(tool, options = {}) {
19983
+ if (this.supportsGrokToolValidationDiagnostics(tool)) return true;
19984
+ try {
19985
+ await this.initialize(options);
19986
+ } catch {
19987
+ return false;
19988
+ }
19989
+ return this.supportsGrokToolValidationDiagnostics(tool);
19990
+ }
19943
19991
  supportsProviderQuotaRecovery() {
19944
19992
  return this.#providerQuotaRecoverySupported;
19945
19993
  }
@@ -19997,6 +20045,27 @@ var init_mcp_client = __esm({
19997
20045
  "inference.host.heartbeat",
19998
20046
  ["provider_quota_recovery"]
19999
20047
  ) && advertisesFields("inference.job.fail", ["provider_retry_at", "provider_retry_source"]);
20048
+ this.#grokToolValidationTools.clear();
20049
+ if (advertisesFields("inference.job.fail", ["grok_tool_validation"])) {
20050
+ this.#grokToolValidationTools.add("inference.job.fail");
20051
+ }
20052
+ const heartbeatSchema = listed.tools.find(
20053
+ (tool) => tool.name === "inference.agent.assignment.heartbeat"
20054
+ )?.inputSchema;
20055
+ const advertisesDiagnosticReceipt = (value, depth = 0) => {
20056
+ if (depth > 4 || !value || typeof value !== "object" || Array.isArray(value)) return false;
20057
+ const node = value;
20058
+ const properties = node.properties;
20059
+ if (properties && typeof properties === "object" && Object.hasOwn(properties, "grok_tool_validation") && Object.hasOwn(properties, "dispatch_outcome")) return true;
20060
+ if (typeof node.$ref === "string" && /^#\/\$defs\/[^/]+$/u.test(node.$ref)) {
20061
+ const definition = node.$ref.slice("#/$defs/".length).replace(/~1/gu, "/").replace(/~0/gu, "~");
20062
+ return advertisesDiagnosticReceipt(heartbeatSchema?.$defs?.[definition], depth + 1);
20063
+ }
20064
+ return Array.isArray(node.anyOf) && node.anyOf.some((branch) => advertisesDiagnosticReceipt(branch, depth + 1));
20065
+ };
20066
+ if (advertisesDiagnosticReceipt(heartbeatSchema?.properties?.turn_receipt)) {
20067
+ this.#grokToolValidationTools.add("inference.agent.assignment.heartbeat");
20068
+ }
20000
20069
  this.#initialized = true;
20001
20070
  }
20002
20071
  async callTool(name, argumentsValue, options = {}) {
@@ -21596,6 +21665,7 @@ var init_codex_app_server = __esm({
21596
21665
  this.terminalEvidence = options.terminalEvidence ?? null;
21597
21666
  this.rateLimits = options.rateLimits ?? null;
21598
21667
  this.processExit = options.processExit ?? null;
21668
+ this.grokToolValidation = options.grokToolValidation ?? null;
21599
21669
  }
21600
21670
  };
21601
21671
  objectOrNull = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
@@ -34414,6 +34484,7 @@ var init_grok_transport_proxy = __esm({
34414
34484
  init_define_VTX_EXO_POLICY();
34415
34485
  init_define_VTX_GROK_POLICY();
34416
34486
  init_define_VTX_PI_MODEL_POLICY();
34487
+ init_external_inference_contract();
34417
34488
  diagnosticNames = /* @__PURE__ */ new Set([
34418
34489
  "search_tool",
34419
34490
  "use_tool",
@@ -34491,7 +34562,8 @@ var init_grok_transport_proxy = __esm({
34491
34562
  }
34492
34563
  rejectTools(reason, payload, route) {
34493
34564
  const tools = Array.isArray(payload.tools) ? payload.tools : null;
34494
- const diagnostic = {
34565
+ const diagnostic = grokToolValidationDiagnosticSchema.parse({
34566
+ schema_version: "external_inference_grok_tool_validation_v1",
34495
34567
  reason,
34496
34568
  route,
34497
34569
  tools_shape: tools ? "array" : payload.tools === null ? "null" : typeof payload.tools,
@@ -34506,7 +34578,7 @@ var init_grok_transport_proxy = __esm({
34506
34578
  tools_truncated: (tools?.length ?? 0) > 8,
34507
34579
  prior_dispatch: this.dispatched,
34508
34580
  completed_response_count: this.receiptValues.length
34509
- };
34581
+ });
34510
34582
  this.toolValidationFailure ??= diagnostic;
34511
34583
  try {
34512
34584
  this.options.onToolValidationFailure?.(diagnostic);
@@ -34888,7 +34960,11 @@ var init_grok_runtime = __esm({
34888
34960
  'preferred_method = "oidc"',
34889
34961
  "[cli]",
34890
34962
  "auto_update = false",
34963
+ // Model-catalog backend search is independent of the ACP tool profile.
34964
+ // Pin it off before request construction: Provider has no tools and Agent
34965
+ // may use only the assignment-scoped VTX tools.
34891
34966
  "[features]",
34967
+ "backend_tools = false",
34892
34968
  "telemetry = false",
34893
34969
  "turn_summary = false",
34894
34970
  "title_refresh = false",
@@ -35708,7 +35784,8 @@ var init_grok_adapter = __esm({
35708
35784
  code: proxy?.failureCode ?? proxy?.terminalFailure?.code ?? (error48 instanceof Error && /^grok_[a-z0-9_]+$/u.test(error48.message) ? error48.message : "grok_adapter_failure"),
35709
35785
  httpStatusCode: proxy?.rejectionStatus,
35710
35786
  retryable: false,
35711
- dispatchOutcome: outcome
35787
+ dispatchOutcome: outcome,
35788
+ grokToolValidation: proxy?.toolValidationFailure ?? null
35712
35789
  });
35713
35790
  } finally {
35714
35791
  try {
@@ -37210,8 +37287,8 @@ var init_runner = __esm({
37210
37287
  init_mcp_client();
37211
37288
  init_config();
37212
37289
  init_oauth();
37213
- terminalFailureRequiresManualRecovery = (error48) => error48.terminalEvidence !== null && !error48.retryable && error48.category !== "auth" && !["quota_exceeded", "codex_rate_limited", "provider_rate_limited"].includes(error48.code);
37214
- canReplayFencedAgentTerminal = (state, fence) => state?.schema_version === "vtx_inference_agent_runtime_v3" && state.adapter_id === fence.adapter_id && state.host_id === fence.host_id && state.assignment.assignment_id === fence.assignment_id && state.pending_turn?.terminal_receipt?.terminal_status === "failed" && state.pending_turn.terminal_receipt.failure_code === fence.failure_code && fence.dispatch_outcome !== "outcome_unknown";
37290
+ terminalFailureRequiresManualRecovery = (error48) => (error48.terminalEvidence !== null || error48.grokToolValidation != null) && !error48.retryable && error48.category !== "auth" && !["quota_exceeded", "codex_rate_limited", "provider_rate_limited"].includes(error48.code);
37291
+ canReplayFencedAgentTerminal = (state, fence) => state?.schema_version === "vtx_inference_agent_runtime_v3" && state.adapter_id === fence.adapter_id && state.host_id === fence.host_id && state.assignment.assignment_id === fence.assignment_id && state.pending_turn?.terminal_receipt?.terminal_status === "failed" && state.pending_turn.terminal_receipt.failure_code === fence.failure_code && (fence.dispatch_outcome !== "outcome_unknown" || state.pending_turn.terminal_receipt.grok_tool_validation?.prior_dispatch === true && state.pending_turn.terminal_receipt.dispatch_outcome === "outcome_unknown");
37215
37292
  RUNTIME_RECEIPT_SCHEMA_VERSION = "vtx_inference_host_runtime_v1";
37216
37293
  ATTEMPT_RECEIPT_SCHEMA_VERSION = "vtx_inference_attempt_receipt_v1";
37217
37294
  CLAIM_DISPATCH_BATCH_SIZE = 16;
@@ -38221,7 +38298,14 @@ var init_runner = __esm({
38221
38298
  cooldown_until: retryAtMs === null ? null : isoAt(retryAtMs)
38222
38299
  }
38223
38300
  );
38224
- if (this.options.once || retryAtMs === null) return;
38301
+ if (this.options.once) return;
38302
+ if (retryAtMs === null) {
38303
+ const retained = await readInferenceAgentRuntimeState(agentRuntimeSettings.statePath);
38304
+ const fence = await readInferenceAgentFailureFence(agentRuntimeSettings.statePath);
38305
+ if (!fence || !canReplayFencedAgentTerminal(retained, fence)) return;
38306
+ await sleep4(1e3, agentIdleSignal).catch(() => void 0);
38307
+ continue;
38308
+ }
38225
38309
  try {
38226
38310
  await sleep4(Math.max(MIN_SLEEP_MS, retryAtMs - now()), agentIdleSignal);
38227
38311
  } catch {
@@ -40376,6 +40460,11 @@ var init_runner = __esm({
40376
40460
  failure2.code
40377
40461
  ]);
40378
40462
  const canReportEffective = dispatchOutcome !== "not_dispatched";
40463
+ const grokDiagnostic = heartbeatFailure === void 0 && effectiveError instanceof CodexAppServerError && effectiveError.grokToolValidation !== null && failure2.code === `grok_tool_isolation_${effectiveError.grokToolValidation.reason}` && dispatchOutcome === (effectiveError.grokToolValidation.prior_dispatch ? "outcome_unknown" : "not_dispatched") ? effectiveError.grokToolValidation : null;
40464
+ const sendGrokDiagnostic = grokDiagnostic !== null && (mcp.supportsGrokToolValidationDiagnostics?.("inference.job.fail") === true || await mcp.refreshGrokToolValidationSupport?.("inference.job.fail", {
40465
+ signal,
40466
+ deadlineAtMs: Date.parse(jobInput.evidence_expires_at)
40467
+ }) === true);
40379
40468
  const failureRequest = jobFailRequestSchema.parse({
40380
40469
  schema_version: "external_inference_job_fail_v1",
40381
40470
  contract_version: EXTERNAL_INFERENCE_CONTRACT_VERSION,
@@ -40416,6 +40505,7 @@ var init_runner = __esm({
40416
40505
  ...adapterResultReadyAt === null ? {} : { adapter_result_ready_at: adapterResultReadyAt },
40417
40506
  provider_dispatch_freshness_remaining_ms: providerDispatchFreshnessRemainingMs,
40418
40507
  ...processExit ? { process_exit: processExit } : {},
40508
+ ...sendGrokDiagnostic ? { grok_tool_validation: grokDiagnostic } : {},
40419
40509
  membership_disposition: membershipFailureDisposition({
40420
40510
  ...failure2,
40421
40511
  dispatchOutcome
@@ -40487,6 +40577,7 @@ var init_runner = __esm({
40487
40577
  }
40488
40578
  };
40489
40579
  createInferenceAgentControlClient = (mcp) => ({
40580
+ supportsGrokToolValidationDiagnostics: async (options = {}) => mcp.supportsGrokToolValidationDiagnostics?.("inference.agent.assignment.heartbeat") === true || await mcp.refreshGrokToolValidationSupport?.("inference.agent.assignment.heartbeat", options) === true,
40490
40581
  nextAssignment: async (request, options) => {
40491
40582
  const result2 = await mcp.callTool("inference.agent.assignment.next", {
40492
40583
  ...request,
@@ -40730,6 +40821,12 @@ var init_runner = __esm({
40730
40821
  if (terminal.terminal_receipt.terminal_status === "failed") {
40731
40822
  state = { ...state, pending_turn: null, updated_at: nowIso() };
40732
40823
  await writeInferenceAgentRuntimeState(this.options.statePath, state);
40824
+ if (terminal.terminal_receipt.dispatch_outcome === "outcome_unknown") {
40825
+ throw new InferenceHostRunnerError(
40826
+ "agent_terminal_failure_fenced",
40827
+ "The diagnostic receipt was acknowledged; upstream outcome remains unknown and model redispatch is fenced."
40828
+ );
40829
+ }
40733
40830
  await this.releaseForHostStop(terminal.terminal_receipt.failure_code ?? "provider_failure");
40734
40831
  return this.now() + (this.options.idlePollMs ?? 5e3);
40735
40832
  }
@@ -41026,11 +41123,12 @@ var init_runner = __esm({
41026
41123
  await writeInferenceAgentRuntimeState(this.options.statePath, state);
41027
41124
  return nextWakeAtMs;
41028
41125
  } catch (error48) {
41029
- if (error48 instanceof CodexAppServerError && error48.dispatchOutcome === "not_dispatched" && error48.terminalEvidence === null) {
41126
+ const diagnostic = error48 instanceof CodexAppServerError && error48.grokToolValidation && error48.code === `grok_tool_isolation_${error48.grokToolValidation.reason}` && error48.dispatchOutcome === (error48.grokToolValidation.prior_dispatch ? "outcome_unknown" : "not_dispatched") && await this.options.controlClient.supportsGrokToolValidationDiagnostics?.({}) === true ? error48.grokToolValidation : null;
41127
+ if (error48 instanceof CodexAppServerError && error48.dispatchOutcome === "not_dispatched" && error48.terminalEvidence === null && !diagnostic) {
41030
41128
  state = { ...state, pending_turn: null, updated_at: nowIso() };
41031
41129
  await writeInferenceAgentRuntimeState(this.options.statePath, state);
41032
41130
  }
41033
- if (state.pending_turn && !state.pending_turn.terminal_receipt && error48 instanceof CodexAppServerError && (error48.terminalEvidence !== null || error48.dispatchOutcome === "confirmed_dispatched" && ["provider_rate_limited", "codex_rate_limited", "quota_exceeded"].includes(error48.code))) {
41131
+ if (state.pending_turn && !state.pending_turn.terminal_receipt && error48 instanceof CodexAppServerError && (diagnostic != null || error48.terminalEvidence !== null || error48.dispatchOutcome === "confirmed_dispatched" && ["provider_rate_limited", "codex_rate_limited", "quota_exceeded"].includes(error48.code))) {
41034
41132
  state = { ...state, pending_turn: {
41035
41133
  ...state.pending_turn,
41036
41134
  terminal_receipt: {
@@ -41039,19 +41137,23 @@ var init_runner = __esm({
41039
41137
  turn_id: state.pending_turn.turn_id,
41040
41138
  agent_run_id: state.thread?.threadId ?? state.pending_turn.turn_id,
41041
41139
  requested_model: assignment.model_id,
41042
- effective_model: error48.terminalEvidence?.effectiveModel ?? null,
41140
+ effective_model: diagnostic ? null : error48.terminalEvidence?.effectiveModel ?? null,
41043
41141
  requested_reasoning_effort: assignment.reasoning_effort,
41044
- effective_reasoning_effort: error48.terminalEvidence?.effectiveReasoningEffort ?? null,
41142
+ effective_reasoning_effort: diagnostic ? null : error48.terminalEvidence?.effectiveReasoningEffort ?? null,
41045
41143
  started_at: state.pending_turn.started_at,
41046
41144
  completed_at: nowIso(),
41047
- adapter_request_id: error48.terminalEvidence?.adapterRequestId ?? null,
41048
- adapter_response_id: error48.terminalEvidence?.adapterResponseId ?? null,
41049
- usage: error48.usage ? reportedTokenUsage(error48.usage, this.options.adapterId) : {
41145
+ adapter_request_id: diagnostic ? null : error48.terminalEvidence?.adapterRequestId ?? null,
41146
+ adapter_response_id: diagnostic ? null : error48.terminalEvidence?.adapterResponseId ?? null,
41147
+ usage: !diagnostic && error48.usage ? reportedTokenUsage(error48.usage, this.options.adapterId) : {
41050
41148
  schema_version: EXTERNAL_INFERENCE_USAGE_SCHEMA_VERSION,
41051
41149
  availability: "unavailable",
41052
41150
  reason_code: "terminal_usage_unavailable"
41053
41151
  },
41054
- decision_operation_ids: [...state.pending_turn.decision_operation_ids]
41152
+ decision_operation_ids: [...state.pending_turn.decision_operation_ids],
41153
+ ...diagnostic ? {
41154
+ grok_tool_validation: diagnostic,
41155
+ dispatch_outcome: error48.dispatchOutcome === "not_dispatched" ? "not_dispatched" : "outcome_unknown"
41156
+ } : {}
41055
41157
  }
41056
41158
  }, updated_at: nowIso() };
41057
41159
  if (terminalFailureRequiresManualRecovery(error48)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtxmacro/cli",
3
- "version": "2026.9.31",
3
+ "version": "2026.9.33",
4
4
  "description": "VTX Macro CLI, MCP server, and durable external inference host.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",