@vtxmacro/cli 2026.10.25 → 2026.10.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.
- package/bin/vtx-mcp.js +1 -1
- package/bin/vtx-service-bootstrap.js +20 -1
- package/bin/vtx.js +135 -8
- package/package.json +1 -1
package/bin/vtx-mcp.js
CHANGED
|
@@ -37,7 +37,7 @@ var init_define_VTX_PI_MODEL_POLICY = __esm({
|
|
|
37
37
|
var agent_cli_release_default;
|
|
38
38
|
var init_agent_cli_release = __esm({
|
|
39
39
|
"agent-cli-release.json"() {
|
|
40
|
-
agent_cli_release_default = { package_name: "@vtxmacro/cli", package_version: "2026.10.
|
|
40
|
+
agent_cli_release_default = { package_name: "@vtxmacro/cli", package_version: "2026.10.27", codex_package_name: "@openai/codex", codex_version: "0.155.0", copilot_sdk_package_name: "@github/copilot-sdk", copilot_sdk_version: "1.0.0-beta.8", copilot_cli_package_name: "@github/copilot", copilot_cli_version: "1.0.80", deepseek_harness_version: "0.1.1-rc.2", deepseek_harness_packages: ["@deepseek-ai/dsh-agent", "@deepseek-ai/dsh-agent-instructions", "@deepseek-ai/dsh-agent-loop", "@deepseek-ai/dsh-agent-spine-demo", "@deepseek-ai/dsh-anonymous-user-id", "@deepseek-ai/dsh-atomic-write", "@deepseek-ai/dsh-attachment", "@deepseek-ai/dsh-brand", "@deepseek-ai/dsh-code-runtime", "@deepseek-ai/dsh-credentials", "@deepseek-ai/dsh-fs", "@deepseek-ai/dsh-goal", "@deepseek-ai/dsh-goal-round-driver", "@deepseek-ai/dsh-home-paths", "@deepseek-ai/dsh-invariants", "@deepseek-ai/dsh-jobs", "@deepseek-ai/dsh-jobs-local", "@deepseek-ai/dsh-launch-environment", "@deepseek-ai/dsh-llm", "@deepseek-ai/dsh-llm-deepseek", "@deepseek-ai/dsh-llm-retry", "@deepseek-ai/dsh-output-retention", "@deepseek-ai/dsh-sandbox", "@deepseek-ai/dsh-sandbox-policy", "@deepseek-ai/dsh-scope", "@deepseek-ai/dsh-session", "@deepseek-ai/dsh-session-checkpoint-policy", "@deepseek-ai/dsh-session-persistence", "@deepseek-ai/dsh-session-persistence-jsonl", "@deepseek-ai/dsh-session-projection", "@deepseek-ai/dsh-session-title", "@deepseek-ai/dsh-settings", "@deepseek-ai/dsh-shell", "@deepseek-ai/dsh-shell-env", "@deepseek-ai/dsh-skill", "@deepseek-ai/dsh-skill-filesystem", "@deepseek-ai/dsh-subprocess", "@deepseek-ai/dsh-system-prompt", "@deepseek-ai/dsh-timeout", "@deepseek-ai/dsh-tool-bash", "@deepseek-ai/dsh-tool-goal", "@deepseek-ai/dsh-tool-jobs", "@deepseek-ai/dsh-tool-skill", "@deepseek-ai/dsh-tools", "@deepseek-ai/dsh-typert-protocol", "@deepseek-ai/dsh-user-approval"], deepseek_cordis_package_name: "@deepseek-ai/cordis", deepseek_cordis_version: "4.0.1", deepseek_support_packages: { "@deepseek-ai/cordis-plugin-timer": "1.1.3" }, platforms: { "linux-x64": { package_name: "@openai/codex-linux-x64", target: "x86_64-unknown-linux-musl", binary_name: "codex", sha256: "660e159a49e823ac8e5986cb238f73158ce4b957d40d9292f8de90862644b501" }, "win32-x64": { package_name: "@openai/codex-win32-x64", target: "x86_64-pc-windows-msvc", binary_name: "codex.exe", sha256: "e4c11374bd9de8ad5c3b7617fd4654bb7839901edb0863f9930666863c7a021b" } }, pi_coding_agent_package_name: "@earendil-works/pi-coding-agent", pi_ai_package_name: "@earendil-works/pi-ai", pi_version: "0.85.1", pi_support_packages: ["@earendil-works/pi-agent-core", "@earendil-works/pi-telemetry", "@earendil-works/pi-tui", "@earendil-works/chord"], grok_version: "1.0.30", grok_platforms: { "linux-x64": { package_name: "@xai-official/grok-linux-x64", binary_name: "grok", sha256: "504dd6546ab991b75d36698242875ce461489cd1f8cd84285873cb55bd5c7d54" }, "win32-x64": { package_name: "@xai-official/grok-win32-x64", binary_name: "grok.exe", sha256: "48736d1a4342a801ea26d0ecde4c516b653f791399065adaa55973f83abd8867" } } };
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
|
|
@@ -14,7 +14,7 @@ import { dirname as dirname4, relative as relative4, resolve as resolve4 } from
|
|
|
14
14
|
import { fileURLToPath } from "node:url";
|
|
15
15
|
|
|
16
16
|
// agent-cli-release.json
|
|
17
|
-
var agent_cli_release_default = { package_name: "@vtxmacro/cli", package_version: "2026.10.
|
|
17
|
+
var agent_cli_release_default = { package_name: "@vtxmacro/cli", package_version: "2026.10.27", codex_package_name: "@openai/codex", codex_version: "0.155.0", copilot_sdk_package_name: "@github/copilot-sdk", copilot_sdk_version: "1.0.0-beta.8", copilot_cli_package_name: "@github/copilot", copilot_cli_version: "1.0.80", deepseek_harness_version: "0.1.1-rc.2", deepseek_harness_packages: ["@deepseek-ai/dsh-agent", "@deepseek-ai/dsh-agent-instructions", "@deepseek-ai/dsh-agent-loop", "@deepseek-ai/dsh-agent-spine-demo", "@deepseek-ai/dsh-anonymous-user-id", "@deepseek-ai/dsh-atomic-write", "@deepseek-ai/dsh-attachment", "@deepseek-ai/dsh-brand", "@deepseek-ai/dsh-code-runtime", "@deepseek-ai/dsh-credentials", "@deepseek-ai/dsh-fs", "@deepseek-ai/dsh-goal", "@deepseek-ai/dsh-goal-round-driver", "@deepseek-ai/dsh-home-paths", "@deepseek-ai/dsh-invariants", "@deepseek-ai/dsh-jobs", "@deepseek-ai/dsh-jobs-local", "@deepseek-ai/dsh-launch-environment", "@deepseek-ai/dsh-llm", "@deepseek-ai/dsh-llm-deepseek", "@deepseek-ai/dsh-llm-retry", "@deepseek-ai/dsh-output-retention", "@deepseek-ai/dsh-sandbox", "@deepseek-ai/dsh-sandbox-policy", "@deepseek-ai/dsh-scope", "@deepseek-ai/dsh-session", "@deepseek-ai/dsh-session-checkpoint-policy", "@deepseek-ai/dsh-session-persistence", "@deepseek-ai/dsh-session-persistence-jsonl", "@deepseek-ai/dsh-session-projection", "@deepseek-ai/dsh-session-title", "@deepseek-ai/dsh-settings", "@deepseek-ai/dsh-shell", "@deepseek-ai/dsh-shell-env", "@deepseek-ai/dsh-skill", "@deepseek-ai/dsh-skill-filesystem", "@deepseek-ai/dsh-subprocess", "@deepseek-ai/dsh-system-prompt", "@deepseek-ai/dsh-timeout", "@deepseek-ai/dsh-tool-bash", "@deepseek-ai/dsh-tool-goal", "@deepseek-ai/dsh-tool-jobs", "@deepseek-ai/dsh-tool-skill", "@deepseek-ai/dsh-tools", "@deepseek-ai/dsh-typert-protocol", "@deepseek-ai/dsh-user-approval"], deepseek_cordis_package_name: "@deepseek-ai/cordis", deepseek_cordis_version: "4.0.1", deepseek_support_packages: { "@deepseek-ai/cordis-plugin-timer": "1.1.3" }, platforms: { "linux-x64": { package_name: "@openai/codex-linux-x64", target: "x86_64-unknown-linux-musl", binary_name: "codex", sha256: "660e159a49e823ac8e5986cb238f73158ce4b957d40d9292f8de90862644b501" }, "win32-x64": { package_name: "@openai/codex-win32-x64", target: "x86_64-pc-windows-msvc", binary_name: "codex.exe", sha256: "e4c11374bd9de8ad5c3b7617fd4654bb7839901edb0863f9930666863c7a021b" } }, pi_coding_agent_package_name: "@earendil-works/pi-coding-agent", pi_ai_package_name: "@earendil-works/pi-ai", pi_version: "0.85.1", pi_support_packages: ["@earendil-works/pi-agent-core", "@earendil-works/pi-telemetry", "@earendil-works/pi-tui", "@earendil-works/chord"], grok_version: "1.0.30", grok_platforms: { "linux-x64": { package_name: "@xai-official/grok-linux-x64", binary_name: "grok", sha256: "504dd6546ab991b75d36698242875ce461489cd1f8cd84285873cb55bd5c7d54" }, "win32-x64": { package_name: "@xai-official/grok-win32-x64", binary_name: "grok.exe", sha256: "48736d1a4342a801ea26d0ecde4c516b653f791399065adaa55973f83abd8867" } } };
|
|
18
18
|
|
|
19
19
|
// lib/runtime-policy.generated.json
|
|
20
20
|
var runtime_policy_generated_default = {
|
|
@@ -1405,6 +1405,7 @@ var CANDLE_TIMEFRAME_SECONDS = {
|
|
|
1405
1405
|
};
|
|
1406
1406
|
var AI_COST_ESTIMATE_PERIOD_DAYS = 30;
|
|
1407
1407
|
var SECONDS_PER_AI_COST_ESTIMATE_PERIOD = SECONDS_PER_DAY * AI_COST_ESTIMATE_PERIOD_DAYS;
|
|
1408
|
+
var EXIT_CODE_TEMPFAIL = 75;
|
|
1408
1409
|
var INFERENCE_HOST_PROCESS_LOCK_RECORD_SCHEMA_VERSION = 2;
|
|
1409
1410
|
var INFERENCE_HOST_RECLAIM_GUARD_CREATE_PASSES = 2;
|
|
1410
1411
|
var LINUX_PROC_STAT_COMM_TERMINATOR_CHARS = 2;
|
|
@@ -3103,8 +3104,26 @@ var runInferenceHostServiceBootstrap = async (manifestPathValue, dependencies =
|
|
|
3103
3104
|
live.supervisor = runSupervisor(manifest.executable, supervisorArguments(script, manifestPath));
|
|
3104
3105
|
return live.supervisor;
|
|
3105
3106
|
};
|
|
3107
|
+
const launcherProtocol = dependencies.launcherProtocol ?? process.env.VTX_INFERENCE_HOST_LAUNCHER_PROTOCOL === "1";
|
|
3108
|
+
const handOffToLauncher = async (plan) => {
|
|
3109
|
+
const candidate = { ...plan.candidate, selected_at: now().toISOString() };
|
|
3110
|
+
await atomicWriteSelection(manifestPath, candidate);
|
|
3111
|
+
await rm4(rejectionPathFor(manifestPath), { force: true }).catch(() => void 0);
|
|
3112
|
+
await prunePrivateReleases(manifestPath, [candidate, plan.active]).catch(
|
|
3113
|
+
async () => await appendBootstrapLog(
|
|
3114
|
+
manifest.log_path,
|
|
3115
|
+
"service_release_cleanup_deferred",
|
|
3116
|
+
{ package_version: candidate.package_version }
|
|
3117
|
+
).catch(() => void 0)
|
|
3118
|
+
);
|
|
3119
|
+
await appendBootstrapLog(manifest.log_path, "service_release_handoff", {
|
|
3120
|
+
package_version: candidate.package_version
|
|
3121
|
+
}).catch(() => void 0);
|
|
3122
|
+
return EXIT_CODE_TEMPFAIL;
|
|
3123
|
+
};
|
|
3106
3124
|
let updatePlan = await checkUpdate();
|
|
3107
3125
|
while (await shouldRun()) {
|
|
3126
|
+
if (updatePlan.candidate && launcherProtocol) return await handOffToLauncher(updatePlan);
|
|
3108
3127
|
if (updatePlan.candidate) {
|
|
3109
3128
|
const candidate = { ...updatePlan.candidate, selected_at: now().toISOString() };
|
|
3110
3129
|
await rm4(runtimePathFor(manifestPath), { force: true });
|
package/bin/vtx.js
CHANGED
|
@@ -113,7 +113,7 @@ var init_routing = __esm({
|
|
|
113
113
|
var agent_cli_release_default;
|
|
114
114
|
var init_agent_cli_release = __esm({
|
|
115
115
|
"agent-cli-release.json"() {
|
|
116
|
-
agent_cli_release_default = { package_name: "@vtxmacro/cli", package_version: "2026.10.
|
|
116
|
+
agent_cli_release_default = { package_name: "@vtxmacro/cli", package_version: "2026.10.27", codex_package_name: "@openai/codex", codex_version: "0.155.0", copilot_sdk_package_name: "@github/copilot-sdk", copilot_sdk_version: "1.0.0-beta.8", copilot_cli_package_name: "@github/copilot", copilot_cli_version: "1.0.80", deepseek_harness_version: "0.1.1-rc.2", deepseek_harness_packages: ["@deepseek-ai/dsh-agent", "@deepseek-ai/dsh-agent-instructions", "@deepseek-ai/dsh-agent-loop", "@deepseek-ai/dsh-agent-spine-demo", "@deepseek-ai/dsh-anonymous-user-id", "@deepseek-ai/dsh-atomic-write", "@deepseek-ai/dsh-attachment", "@deepseek-ai/dsh-brand", "@deepseek-ai/dsh-code-runtime", "@deepseek-ai/dsh-credentials", "@deepseek-ai/dsh-fs", "@deepseek-ai/dsh-goal", "@deepseek-ai/dsh-goal-round-driver", "@deepseek-ai/dsh-home-paths", "@deepseek-ai/dsh-invariants", "@deepseek-ai/dsh-jobs", "@deepseek-ai/dsh-jobs-local", "@deepseek-ai/dsh-launch-environment", "@deepseek-ai/dsh-llm", "@deepseek-ai/dsh-llm-deepseek", "@deepseek-ai/dsh-llm-retry", "@deepseek-ai/dsh-output-retention", "@deepseek-ai/dsh-sandbox", "@deepseek-ai/dsh-sandbox-policy", "@deepseek-ai/dsh-scope", "@deepseek-ai/dsh-session", "@deepseek-ai/dsh-session-checkpoint-policy", "@deepseek-ai/dsh-session-persistence", "@deepseek-ai/dsh-session-persistence-jsonl", "@deepseek-ai/dsh-session-projection", "@deepseek-ai/dsh-session-title", "@deepseek-ai/dsh-settings", "@deepseek-ai/dsh-shell", "@deepseek-ai/dsh-shell-env", "@deepseek-ai/dsh-skill", "@deepseek-ai/dsh-skill-filesystem", "@deepseek-ai/dsh-subprocess", "@deepseek-ai/dsh-system-prompt", "@deepseek-ai/dsh-timeout", "@deepseek-ai/dsh-tool-bash", "@deepseek-ai/dsh-tool-goal", "@deepseek-ai/dsh-tool-jobs", "@deepseek-ai/dsh-tool-skill", "@deepseek-ai/dsh-tools", "@deepseek-ai/dsh-typert-protocol", "@deepseek-ai/dsh-user-approval"], deepseek_cordis_package_name: "@deepseek-ai/cordis", deepseek_cordis_version: "4.0.1", deepseek_support_packages: { "@deepseek-ai/cordis-plugin-timer": "1.1.3" }, platforms: { "linux-x64": { package_name: "@openai/codex-linux-x64", target: "x86_64-unknown-linux-musl", binary_name: "codex", sha256: "660e159a49e823ac8e5986cb238f73158ce4b957d40d9292f8de90862644b501" }, "win32-x64": { package_name: "@openai/codex-win32-x64", target: "x86_64-pc-windows-msvc", binary_name: "codex.exe", sha256: "e4c11374bd9de8ad5c3b7617fd4654bb7839901edb0863f9930666863c7a021b" } }, pi_coding_agent_package_name: "@earendil-works/pi-coding-agent", pi_ai_package_name: "@earendil-works/pi-ai", pi_version: "0.85.1", pi_support_packages: ["@earendil-works/pi-agent-core", "@earendil-works/pi-telemetry", "@earendil-works/pi-tui", "@earendil-works/chord"], grok_version: "1.0.30", grok_platforms: { "linux-x64": { package_name: "@xai-official/grok-linux-x64", binary_name: "grok", sha256: "504dd6546ab991b75d36698242875ce461489cd1f8cd84285873cb55bd5c7d54" }, "win32-x64": { package_name: "@xai-official/grok-win32-x64", binary_name: "grok.exe", sha256: "48736d1a4342a801ea26d0ecde4c516b653f791399065adaa55973f83abd8867" } } };
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
119
|
|
|
@@ -1598,6 +1598,9 @@ var init_constants = __esm({
|
|
|
1598
1598
|
// Tools a Grok tool-validation summary lists before truncating.
|
|
1599
1599
|
max_grok_tool_summaries: 8,
|
|
1600
1600
|
max_recent_failures: 32,
|
|
1601
|
+
// Resolved claim failures one host heartbeat reports; a host that collects
|
|
1602
|
+
// more reports the oldest it dropped as a count.
|
|
1603
|
+
max_heartbeat_claim_failures: 32,
|
|
1601
1604
|
max_status_bindings: 512,
|
|
1602
1605
|
max_validation_error_codes: 128,
|
|
1603
1606
|
max_discarded_fields: 128,
|
|
@@ -21293,7 +21296,7 @@ var init_runtime_policy_generated2 = __esm({
|
|
|
21293
21296
|
});
|
|
21294
21297
|
|
|
21295
21298
|
// lib/external-inference-contract.ts
|
|
21296
|
-
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, PROVIDER_RESET_MAX_MS, MAX_GROK_TOOL_SUMMARIES, STDERR_OBSERVATION_CAP_BYTES, MAX_TURN_DECISION_OPERATION_IDS, SHA256_K, 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, grokResponseIdentityDiagnosticSchema, agentTurnReceiptSchema, agentConnectRequestSchema, agentNextRequestSchema, agentHeartbeatRequestSchema, emptyAgentNextResultSchema, claimedAgentNextResultSchema, agentNextResultSchema, agentCompleteRequestSchema, agentFailRequestSchema, requestedModelSelectionSchema, completedModelProvenanceSchema, attemptModelProvenanceSchema, providerWeeklyQuotaReadSchema, hostRuntimeRecoverySchema, 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;
|
|
21299
|
+
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, PROVIDER_RESET_MAX_MS, MAX_GROK_TOOL_SUMMARIES, STDERR_OBSERVATION_CAP_BYTES, MAX_TURN_DECISION_OPERATION_IDS, SHA256_K, 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, grokResponseIdentityDiagnosticSchema, agentTurnReceiptSchema, agentConnectRequestSchema, agentNextRequestSchema, agentHeartbeatRequestSchema, emptyAgentNextResultSchema, claimedAgentNextResultSchema, agentNextResultSchema, agentCompleteRequestSchema, agentFailRequestSchema, requestedModelSelectionSchema, completedModelProvenanceSchema, attemptModelProvenanceSchema, providerWeeklyQuotaReadSchema, hostRuntimeRecoverySchema, claimResolutionSchema, httpStatusCodeSchema, hostClaimTransportFailureSchema, hostClaimTransportFailureReportSchema, 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, externalInferenceClaimTransportFailureCountReadSchema, 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;
|
|
21297
21300
|
var init_external_inference_contract = __esm({
|
|
21298
21301
|
"lib/external-inference-contract.ts"() {
|
|
21299
21302
|
"use strict";
|
|
@@ -22270,6 +22273,24 @@ var init_external_inference_contract = __esm({
|
|
|
22270
22273
|
pending_attempts: nonNegativeSafeIntegerSchema,
|
|
22271
22274
|
pending_claim: external_exports.boolean()
|
|
22272
22275
|
});
|
|
22276
|
+
claimResolutionSchema = external_exports.enum(["replayed", "retired", "drained"]);
|
|
22277
|
+
httpStatusCodeSchema = external_exports.number().int().min(HTTP_STATUS_MIN).max(HTTP_STATUS_MAX);
|
|
22278
|
+
hostClaimTransportFailureSchema = external_exports.strictObject({
|
|
22279
|
+
claim_request_id: operationIdentifierSchema,
|
|
22280
|
+
failed_at: timestampSchema,
|
|
22281
|
+
failure_code: safeCodeSchema,
|
|
22282
|
+
http_status_code: httpStatusCodeSchema.nullable(),
|
|
22283
|
+
response_body_bytes: nonNegativeSafeIntegerSchema.nullable(),
|
|
22284
|
+
body_cut: external_exports.boolean(),
|
|
22285
|
+
attempts: positiveSafeIntegerSchema,
|
|
22286
|
+
resolution: claimResolutionSchema,
|
|
22287
|
+
resolved_at: timestampSchema
|
|
22288
|
+
});
|
|
22289
|
+
hostClaimTransportFailureReportSchema = external_exports.strictObject({
|
|
22290
|
+
entries: external_exports.array(hostClaimTransportFailureSchema).min(1).max(EXTERNAL_INFERENCE_LIMITS.max_heartbeat_claim_failures),
|
|
22291
|
+
// Failed requests dropped, oldest first, because the host's buffer was full.
|
|
22292
|
+
dropped: nonNegativeSafeIntegerSchema
|
|
22293
|
+
});
|
|
22273
22294
|
hostHeartbeatRequestSchema = external_exports.strictObject({
|
|
22274
22295
|
schema_version: external_exports.literal("external_inference_host_heartbeat_v1"),
|
|
22275
22296
|
contract_version: external_exports.literal(EXTERNAL_INFERENCE_CONTRACT_VERSION),
|
|
@@ -22283,6 +22304,14 @@ var init_external_inference_contract = __esm({
|
|
|
22283
22304
|
available_slots: nonNegativeSafeIntegerSchema,
|
|
22284
22305
|
provider_weekly_quota: providerWeeklyQuotaReadSchema.nullable().optional(),
|
|
22285
22306
|
runtime_recovery: hostRuntimeRecoverySchema.optional(),
|
|
22307
|
+
claim_transport_failures: hostClaimTransportFailureReportSchema.optional(),
|
|
22308
|
+
// The host's own provider limit snapshot shows the account cannot serve
|
|
22309
|
+
// until `until` (any limit window, not only the weekly one reported above).
|
|
22310
|
+
provider_quota_cooldown: external_exports.strictObject({
|
|
22311
|
+
source: external_exports.literal("codex_app_server"),
|
|
22312
|
+
until: timestampSchema,
|
|
22313
|
+
observed_at: timestampSchema
|
|
22314
|
+
}).optional(),
|
|
22286
22315
|
provider_quota_recovery: external_exports.strictObject({
|
|
22287
22316
|
source: external_exports.literal("codex_app_server"),
|
|
22288
22317
|
observed_at: timestampSchema
|
|
@@ -22863,6 +22892,15 @@ var init_external_inference_contract = __esm({
|
|
|
22863
22892
|
count: positiveSafeIntegerSchema,
|
|
22864
22893
|
last_observed_at: timestampSchema
|
|
22865
22894
|
});
|
|
22895
|
+
externalInferenceClaimTransportFailureCountReadSchema = external_exports.strictObject({
|
|
22896
|
+
failure_code: safeCodeSchema,
|
|
22897
|
+
http_status_code: httpStatusCodeSchema.nullable(),
|
|
22898
|
+
body_cut: external_exports.boolean(),
|
|
22899
|
+
resolution: claimResolutionSchema,
|
|
22900
|
+
count: positiveSafeIntegerSchema,
|
|
22901
|
+
attempts: positiveSafeIntegerSchema,
|
|
22902
|
+
last_failed_at: timestampSchema
|
|
22903
|
+
});
|
|
22866
22904
|
externalInferenceHostDiagnosticsReadSchema = external_exports.strictObject({
|
|
22867
22905
|
host_id: identifierSchema,
|
|
22868
22906
|
active_attempts: nonNegativeSafeIntegerSchema,
|
|
@@ -22872,7 +22910,8 @@ var init_external_inference_contract = __esm({
|
|
|
22872
22910
|
last_hour: externalInferenceVolumeWindowReadSchema,
|
|
22873
22911
|
last_day: externalInferenceVolumeWindowReadSchema,
|
|
22874
22912
|
last_week: externalInferenceVolumeWindowReadSchema,
|
|
22875
|
-
recent_failures: external_exports.array(externalInferenceFailureCountReadSchema).max(EXTERNAL_INFERENCE_LIMITS.max_recent_failures)
|
|
22913
|
+
recent_failures: external_exports.array(externalInferenceFailureCountReadSchema).max(EXTERNAL_INFERENCE_LIMITS.max_recent_failures),
|
|
22914
|
+
claim_transport_failures: external_exports.array(externalInferenceClaimTransportFailureCountReadSchema).max(EXTERNAL_INFERENCE_LIMITS.max_recent_failures)
|
|
22876
22915
|
});
|
|
22877
22916
|
externalInferenceProfileActivityReadSchema = external_exports.strictObject({
|
|
22878
22917
|
last_hour: externalInferenceVolumeWindowReadSchema,
|
|
@@ -25758,6 +25797,8 @@ var init_mcp_client = __esm({
|
|
|
25758
25797
|
#providerCreditsSupported = false;
|
|
25759
25798
|
#agentAnalysisDurationSupported = false;
|
|
25760
25799
|
#runtimeRecoveryDiagnosticsSupported = false;
|
|
25800
|
+
#claimTransportFailureReportsSupported = false;
|
|
25801
|
+
#providerQuotaCooldownSupported = false;
|
|
25761
25802
|
#providerHttpStatusTools = /* @__PURE__ */ new Set();
|
|
25762
25803
|
#grokToolValidationTools = /* @__PURE__ */ new Set();
|
|
25763
25804
|
#grokResponseIdentityTools = /* @__PURE__ */ new Set();
|
|
@@ -25803,6 +25844,12 @@ var init_mcp_client = __esm({
|
|
|
25803
25844
|
supportsRuntimeRecoveryDiagnostics() {
|
|
25804
25845
|
return this.#runtimeRecoveryDiagnosticsSupported;
|
|
25805
25846
|
}
|
|
25847
|
+
supportsClaimTransportFailureReports() {
|
|
25848
|
+
return this.#claimTransportFailureReportsSupported;
|
|
25849
|
+
}
|
|
25850
|
+
supportsProviderQuotaCooldown() {
|
|
25851
|
+
return this.#providerQuotaCooldownSupported;
|
|
25852
|
+
}
|
|
25806
25853
|
supportsAgentAnalysisDuration() {
|
|
25807
25854
|
return this.#agentAnalysisDurationSupported;
|
|
25808
25855
|
}
|
|
@@ -25876,6 +25923,14 @@ var init_mcp_client = __esm({
|
|
|
25876
25923
|
"inference.host.heartbeat",
|
|
25877
25924
|
["runtime_recovery"]
|
|
25878
25925
|
);
|
|
25926
|
+
this.#claimTransportFailureReportsSupported = advertisesFields(
|
|
25927
|
+
"inference.host.heartbeat",
|
|
25928
|
+
["claim_transport_failures"]
|
|
25929
|
+
);
|
|
25930
|
+
this.#providerQuotaCooldownSupported = advertisesFields(
|
|
25931
|
+
"inference.host.heartbeat",
|
|
25932
|
+
["provider_quota_cooldown"]
|
|
25933
|
+
);
|
|
25879
25934
|
this.#providerQuotaRecoverySupported = advertisesFields(
|
|
25880
25935
|
"inference.host.heartbeat",
|
|
25881
25936
|
["provider_quota_recovery"]
|
|
@@ -36351,6 +36406,24 @@ var init_runner = __esm({
|
|
|
36351
36406
|
let drainReason = "stopped";
|
|
36352
36407
|
let terminalRecoveryFailureCode = null;
|
|
36353
36408
|
let acknowledgedRecoveryDiagnostic = null;
|
|
36409
|
+
const claimFailures = [];
|
|
36410
|
+
let claimFailuresDropped = 0;
|
|
36411
|
+
const boundClaimFailures = () => {
|
|
36412
|
+
while (claimFailures.length > EXTERNAL_INFERENCE_LIMITS.max_heartbeat_claim_failures) {
|
|
36413
|
+
const resolved = claimFailures.findIndex((record5) => record5.resolution !== void 0);
|
|
36414
|
+
claimFailures.splice(resolved >= 0 ? resolved : 0, 1);
|
|
36415
|
+
claimFailuresDropped += 1;
|
|
36416
|
+
}
|
|
36417
|
+
};
|
|
36418
|
+
const resolveClaimFailures = (resolution, unresolved) => {
|
|
36419
|
+
for (const record5 of claimFailures) {
|
|
36420
|
+
if (record5.resolution === void 0 && unresolved(record5)) {
|
|
36421
|
+
record5.resolution = resolution;
|
|
36422
|
+
record5.resolved_at = isoAt(now());
|
|
36423
|
+
}
|
|
36424
|
+
}
|
|
36425
|
+
boundClaimFailures();
|
|
36426
|
+
};
|
|
36354
36427
|
let receipt;
|
|
36355
36428
|
let mcp;
|
|
36356
36429
|
const active = /* @__PURE__ */ new Map();
|
|
@@ -36955,7 +37028,23 @@ var init_runner = __esm({
|
|
|
36955
37028
|
pending_claim: Boolean(current.pending_claim_request)
|
|
36956
37029
|
};
|
|
36957
37030
|
const parsedDiagnostic = hostRuntimeRecoverySchema.safeParse(diagnostic);
|
|
37031
|
+
resolveClaimFailures("retired", (record5) => record5.claim_request_id !== current.pending_claim_request?.claim_request_id);
|
|
37032
|
+
if (status === "draining") resolveClaimFailures("drained", () => true);
|
|
37033
|
+
const claimFailureReport = hostClaimTransportFailureReportSchema.safeParse({
|
|
37034
|
+
entries: claimFailures.filter((record5) => record5.resolution !== void 0).slice(0, EXTERNAL_INFERENCE_LIMITS.max_heartbeat_claim_failures),
|
|
37035
|
+
dropped: claimFailuresDropped
|
|
37036
|
+
});
|
|
36958
37037
|
request = {
|
|
37038
|
+
...mcp.supportsClaimTransportFailureReports?.() === true && claimFailureReport.success ? { claim_transport_failures: claimFailureReport.data } : {},
|
|
37039
|
+
// This worker claims nothing while its account's limit is reached;
|
|
37040
|
+
// the server routes the profile's jobs to the next member meanwhile.
|
|
37041
|
+
...mcp.supportsProviderQuotaCooldown?.() === true && providerCooldownReason === "provider_limit_snapshot" && providerRetryAtMs !== null && providerRetryAtMs > now() ? {
|
|
37042
|
+
provider_quota_cooldown: {
|
|
37043
|
+
source: "codex_app_server",
|
|
37044
|
+
until: isoAt(providerRetryAtMs),
|
|
37045
|
+
observed_at: isoAt(providerRateLimitsObservedAtMs)
|
|
37046
|
+
}
|
|
37047
|
+
} : {},
|
|
36959
37048
|
...mcp.supportsRuntimeRecoveryDiagnostics?.() === true && parsedDiagnostic.success && JSON.stringify(parsedDiagnostic.data) !== acknowledgedRecoveryDiagnostic ? { runtime_recovery: parsedDiagnostic.data } : {},
|
|
36960
37049
|
schema_version: "external_inference_host_heartbeat_v1",
|
|
36961
37050
|
contract_version: EXTERNAL_INFERENCE_CONTRACT_VERSION,
|
|
@@ -37012,6 +37101,15 @@ var init_runner = __esm({
|
|
|
37012
37101
|
if (request.runtime_recovery) {
|
|
37013
37102
|
acknowledgedRecoveryDiagnostic = JSON.stringify(request.runtime_recovery);
|
|
37014
37103
|
}
|
|
37104
|
+
if (request.claim_transport_failures) {
|
|
37105
|
+
const reported = request.claim_transport_failures;
|
|
37106
|
+
for (const entry of reported.entries) {
|
|
37107
|
+
const index = claimFailures.findIndex((record5) => record5.claim_request_id === entry.claim_request_id && record5.failed_at === entry.failed_at);
|
|
37108
|
+
if (index >= 0) claimFailures.splice(index, 1);
|
|
37109
|
+
else claimFailuresDropped = Math.max(0, claimFailuresDropped - 1);
|
|
37110
|
+
}
|
|
37111
|
+
claimFailuresDropped = Math.max(0, claimFailuresDropped - reported.dropped);
|
|
37112
|
+
}
|
|
37015
37113
|
if (result.host.status === "revoked" || result.host.status === "offline" && !allowOfflineProjection) {
|
|
37016
37114
|
const error48 = new InferenceHostRunnerError(
|
|
37017
37115
|
result.host.status === "revoked" ? "host_revoked" : "host_offline",
|
|
@@ -37699,16 +37797,45 @@ var init_runner = __esm({
|
|
|
37699
37797
|
}
|
|
37700
37798
|
);
|
|
37701
37799
|
assertClaimResult(request, claim);
|
|
37800
|
+
resolveClaimFailures(
|
|
37801
|
+
"replayed",
|
|
37802
|
+
(record5) => record5.claim_request_id === request.claim_request_id
|
|
37803
|
+
);
|
|
37702
37804
|
} catch (error48) {
|
|
37805
|
+
const failureCode = safeFailureCode(
|
|
37806
|
+
error48 instanceof ExternalInferenceMcpError ? error48.code : "",
|
|
37807
|
+
"claim_failed"
|
|
37808
|
+
);
|
|
37809
|
+
const httpStatusCode = error48 instanceof ExternalInferenceMcpError ? error48.httpStatusCode : null;
|
|
37703
37810
|
if (claimTiming) emitDiagnostic("claim_request_failed", {
|
|
37704
37811
|
claim_request_id: request.claim_request_id,
|
|
37705
|
-
failure_code:
|
|
37706
|
-
|
|
37707
|
-
"claim_failed"
|
|
37708
|
-
),
|
|
37709
|
-
http_status_code: error48 instanceof ExternalInferenceMcpError ? error48.httpStatusCode : null,
|
|
37812
|
+
failure_code: failureCode,
|
|
37813
|
+
http_status_code: httpStatusCode,
|
|
37710
37814
|
client_timing: claimTiming
|
|
37711
37815
|
});
|
|
37816
|
+
if (!this.options.signal?.aborted) {
|
|
37817
|
+
const open4 = claimFailures.find((record5) => record5.resolution === void 0 && record5.claim_request_id === request.claim_request_id);
|
|
37818
|
+
const responseBodyBytes = claimTiming?.response_body_bytes ?? null;
|
|
37819
|
+
const bodyCut = failureCode === "network_error" && (responseBodyBytes ?? 0) > 0;
|
|
37820
|
+
if (open4) {
|
|
37821
|
+
open4.attempts = Math.min(Number.MAX_SAFE_INTEGER, open4.attempts + 1);
|
|
37822
|
+
if (bodyCut) open4.body_cut = true;
|
|
37823
|
+
if (responseBodyBytes !== null) {
|
|
37824
|
+
open4.response_body_bytes = Math.max(open4.response_body_bytes ?? 0, responseBodyBytes);
|
|
37825
|
+
}
|
|
37826
|
+
} else {
|
|
37827
|
+
claimFailures.push({
|
|
37828
|
+
claim_request_id: request.claim_request_id,
|
|
37829
|
+
failed_at: isoAt(claimCallStartedAtMs),
|
|
37830
|
+
failure_code: failureCode,
|
|
37831
|
+
http_status_code: httpStatusCode,
|
|
37832
|
+
response_body_bytes: responseBodyBytes,
|
|
37833
|
+
body_cut: bodyCut,
|
|
37834
|
+
attempts: 1
|
|
37835
|
+
});
|
|
37836
|
+
boundClaimFailures();
|
|
37837
|
+
}
|
|
37838
|
+
}
|
|
37712
37839
|
if (!this.options.signal?.aborted && request.schema_version === "external_inference_job_claim_v3" && error48 instanceof ExternalInferenceMcpError && error48.serverFailureCode === "schema_validation") {
|
|
37713
37840
|
batchClaimVersion = INFERENCE_JOB_CLAIM_SCHEMA_VERSION.V2;
|
|
37714
37841
|
await mutateReceipt((current) => ({
|