@vtxmacro/cli 2026.10.59 → 2026.10.60
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/exo-harness.ts +13 -0
- package/bin/vtx-mcp.js +14 -1
- package/bin/vtx-service-bootstrap.js +14 -1
- package/bin/vtx-service-launcher.js +13 -0
- package/bin/vtx.js +428 -152
- package/package.json +1 -1
package/bin/exo-harness.ts
CHANGED
|
@@ -1551,6 +1551,19 @@ var runtime_policy_generated_default = {
|
|
|
1551
1551
|
error_details: {
|
|
1552
1552
|
review_failure_message_max_length: 220
|
|
1553
1553
|
}
|
|
1554
|
+
},
|
|
1555
|
+
llm: {
|
|
1556
|
+
provider_diagnostics: {
|
|
1557
|
+
reply_body_max_chars: 65536,
|
|
1558
|
+
reply_max_headers: 64,
|
|
1559
|
+
reply_header_name_parts: [
|
|
1560
|
+
"retry-after",
|
|
1561
|
+
"ratelimit",
|
|
1562
|
+
"rate-limit",
|
|
1563
|
+
"quota",
|
|
1564
|
+
"balance"
|
|
1565
|
+
]
|
|
1566
|
+
}
|
|
1554
1567
|
}
|
|
1555
1568
|
};
|
|
1556
1569
|
|
package/bin/vtx-mcp.js
CHANGED
|
@@ -43,7 +43,7 @@ var init_define_VTX_PI_MODEL_POLICY = __esm({
|
|
|
43
43
|
var agent_cli_release_default;
|
|
44
44
|
var init_agent_cli_release = __esm({
|
|
45
45
|
"agent-cli-release.json"() {
|
|
46
|
-
agent_cli_release_default = { package_name: "@vtxmacro/cli", package_version: "2026.10.
|
|
46
|
+
agent_cli_release_default = { package_name: "@vtxmacro/cli", package_version: "2026.10.60", 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" } } };
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
|
|
@@ -3151,6 +3151,19 @@ var runtime_policy_generated_default = {
|
|
|
3151
3151
|
error_details: {
|
|
3152
3152
|
review_failure_message_max_length: 220
|
|
3153
3153
|
}
|
|
3154
|
+
},
|
|
3155
|
+
llm: {
|
|
3156
|
+
provider_diagnostics: {
|
|
3157
|
+
reply_body_max_chars: 65536,
|
|
3158
|
+
reply_max_headers: 64,
|
|
3159
|
+
reply_header_name_parts: [
|
|
3160
|
+
"retry-after",
|
|
3161
|
+
"ratelimit",
|
|
3162
|
+
"rate-limit",
|
|
3163
|
+
"quota",
|
|
3164
|
+
"balance"
|
|
3165
|
+
]
|
|
3166
|
+
}
|
|
3154
3167
|
}
|
|
3155
3168
|
};
|
|
3156
3169
|
|
|
@@ -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.60", 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 = {
|
|
@@ -1423,6 +1423,19 @@ var runtime_policy_generated_default = {
|
|
|
1423
1423
|
error_details: {
|
|
1424
1424
|
review_failure_message_max_length: 220
|
|
1425
1425
|
}
|
|
1426
|
+
},
|
|
1427
|
+
llm: {
|
|
1428
|
+
provider_diagnostics: {
|
|
1429
|
+
reply_body_max_chars: 65536,
|
|
1430
|
+
reply_max_headers: 64,
|
|
1431
|
+
reply_header_name_parts: [
|
|
1432
|
+
"retry-after",
|
|
1433
|
+
"ratelimit",
|
|
1434
|
+
"rate-limit",
|
|
1435
|
+
"quota",
|
|
1436
|
+
"balance"
|
|
1437
|
+
]
|
|
1438
|
+
}
|
|
1426
1439
|
}
|
|
1427
1440
|
};
|
|
1428
1441
|
|
|
@@ -1407,6 +1407,19 @@ var runtime_policy_generated_default = {
|
|
|
1407
1407
|
error_details: {
|
|
1408
1408
|
review_failure_message_max_length: 220
|
|
1409
1409
|
}
|
|
1410
|
+
},
|
|
1411
|
+
llm: {
|
|
1412
|
+
provider_diagnostics: {
|
|
1413
|
+
reply_body_max_chars: 65536,
|
|
1414
|
+
reply_max_headers: 64,
|
|
1415
|
+
reply_header_name_parts: [
|
|
1416
|
+
"retry-after",
|
|
1417
|
+
"ratelimit",
|
|
1418
|
+
"rate-limit",
|
|
1419
|
+
"quota",
|
|
1420
|
+
"balance"
|
|
1421
|
+
]
|
|
1422
|
+
}
|
|
1410
1423
|
}
|
|
1411
1424
|
};
|
|
1412
1425
|
|
package/bin/vtx.js
CHANGED
|
@@ -122,7 +122,7 @@ var init_routing = __esm({
|
|
|
122
122
|
var agent_cli_release_default;
|
|
123
123
|
var init_agent_cli_release = __esm({
|
|
124
124
|
"agent-cli-release.json"() {
|
|
125
|
-
agent_cli_release_default = { package_name: "@vtxmacro/cli", package_version: "2026.10.
|
|
125
|
+
agent_cli_release_default = { package_name: "@vtxmacro/cli", package_version: "2026.10.60", 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" } } };
|
|
126
126
|
}
|
|
127
127
|
});
|
|
128
128
|
|
|
@@ -1536,6 +1536,19 @@ var init_runtime_policy_generated = __esm({
|
|
|
1536
1536
|
error_details: {
|
|
1537
1537
|
review_failure_message_max_length: 220
|
|
1538
1538
|
}
|
|
1539
|
+
},
|
|
1540
|
+
llm: {
|
|
1541
|
+
provider_diagnostics: {
|
|
1542
|
+
reply_body_max_chars: 65536,
|
|
1543
|
+
reply_max_headers: 64,
|
|
1544
|
+
reply_header_name_parts: [
|
|
1545
|
+
"retry-after",
|
|
1546
|
+
"ratelimit",
|
|
1547
|
+
"rate-limit",
|
|
1548
|
+
"quota",
|
|
1549
|
+
"balance"
|
|
1550
|
+
]
|
|
1551
|
+
}
|
|
1539
1552
|
}
|
|
1540
1553
|
};
|
|
1541
1554
|
}
|
|
@@ -23194,6 +23207,19 @@ var init_runtime_policy_generated2 = __esm({
|
|
|
23194
23207
|
error_details: {
|
|
23195
23208
|
review_failure_message_max_length: 220
|
|
23196
23209
|
}
|
|
23210
|
+
},
|
|
23211
|
+
llm: {
|
|
23212
|
+
provider_diagnostics: {
|
|
23213
|
+
reply_body_max_chars: 65536,
|
|
23214
|
+
reply_max_headers: 64,
|
|
23215
|
+
reply_header_name_parts: [
|
|
23216
|
+
"retry-after",
|
|
23217
|
+
"ratelimit",
|
|
23218
|
+
"rate-limit",
|
|
23219
|
+
"quota",
|
|
23220
|
+
"balance"
|
|
23221
|
+
]
|
|
23222
|
+
}
|
|
23197
23223
|
}
|
|
23198
23224
|
};
|
|
23199
23225
|
}
|
|
@@ -26956,7 +26982,7 @@ var init_mcp_transport = __esm({
|
|
|
26956
26982
|
});
|
|
26957
26983
|
|
|
26958
26984
|
// lib/inference-host/mcp-client.ts
|
|
26959
|
-
var EXTERNAL_INFERENCE_MCP_PROTOCOL_VERSION, EXTERNAL_INFERENCE_AUTOMATED_HOST_TOOLS, EXTERNAL_INFERENCE_OPERATIONAL_TOOLS, ClaimTiming, ExternalInferenceMcpError, DEFAULT_REQUEST_TIMEOUT_MS, MAX_RETRY_AFTER_MS, SSE_DATA_FIELD_PREFIX, PUBLIC_TOOL_ERROR_PREFIX, parseRetryAfterMs, identifierSchema2, safeCodeSchema2, publicFailureCodeSchema, publicToolErrorSchema, structuredPublicToolErrorSchema, MAX_REJECTION_REASON_CHARS, CONTROL_CHARACTERS, publicRejectionReason, parsePublicToolError, hostMutationResultSchema, attemptStartResultSchema, agentConnectResultSchema, agentHeartbeatResultSchema, timestampSchema2, positiveGenerationSchema, jsonObjectSchema, agentAssignmentNextArgumentsSchema, agentDataCapabilityDescriptorSchema, agentAssignmentNextResultSchema, agentAssignmentHeartbeatArgumentsSchema, agentAssignmentHeartbeatResultSchema, agentDataCallArgumentsSchema, agentDataCallResultSchema, agentDecisionTimingSchema, agentDecisionSubmitArgumentsSchema, agentDecisionSubmitResultSchema, agentDecisionStatusArgumentsSchema, agentDecisionStatusResultSchema, agentAssignmentReleaseArgumentsSchema, agentAssignmentReleaseResultSchema, jobCompletionResultSchema, jobFailureResultSchema, toolContracts, discoveryResultSchema, toolListResultSchema, inlineStructuredContentSchema, protocolMeta, parseJsonDocument, parseSseDocuments, parseResponseDocuments, exactOperationalInventory, exactJson, invalidBoundResult, verifyToolResult, ExternalInferenceMcpClient;
|
|
26985
|
+
var EXTERNAL_INFERENCE_MCP_PROTOCOL_VERSION, EXTERNAL_INFERENCE_AUTOMATED_HOST_TOOLS, EXTERNAL_INFERENCE_OPERATIONAL_TOOLS, ClaimTiming, ExternalInferenceMcpError, DEFAULT_REQUEST_TIMEOUT_MS, MAX_RETRY_AFTER_MS, SSE_DATA_FIELD_PREFIX, PUBLIC_TOOL_ERROR_PREFIX, parseRetryAfterMs, identifierSchema2, safeCodeSchema2, serverReasonCodeSchema, publicFailureCodeSchema, publicToolErrorSchema, structuredPublicToolErrorSchema, MAX_REJECTION_REASON_CHARS, CONTROL_CHARACTERS, publicRejectionReason, parsePublicToolError, hostMutationResultSchema, attemptStartResultSchema, agentConnectResultSchema, agentHeartbeatResultSchema, timestampSchema2, positiveGenerationSchema, jsonObjectSchema, agentAssignmentNextArgumentsSchema, agentDataCapabilityDescriptorSchema, agentAssignmentNextResultSchema, agentAssignmentHeartbeatArgumentsSchema, agentAssignmentHeartbeatResultSchema, agentDataCallArgumentsSchema, agentDataCallResultSchema, agentDecisionTimingSchema, agentDecisionSubmitArgumentsSchema, agentDecisionSubmitResultSchema, agentDecisionStatusArgumentsSchema, agentDecisionStatusResultSchema, agentAssignmentReleaseArgumentsSchema, agentAssignmentReleaseResultSchema, jobCompletionResultSchema, jobFailureResultSchema, toolContracts, discoveryResultSchema, toolListResultSchema, inlineStructuredContentSchema, protocolMeta, parseJsonDocument, parseSseDocuments, parseResponseDocuments, exactOperationalInventory, exactJson, invalidBoundResult, verifyToolResult, ExternalInferenceMcpClient;
|
|
26960
26986
|
var init_mcp_client = __esm({
|
|
26961
26987
|
"lib/inference-host/mcp-client.ts"() {
|
|
26962
26988
|
"use strict";
|
|
@@ -27108,6 +27134,7 @@ var init_mcp_client = __esm({
|
|
|
27108
27134
|
this.httpStatusCode = options.httpStatusCode ?? null;
|
|
27109
27135
|
this.retryAfterMs = options.retryAfterMs ?? null;
|
|
27110
27136
|
this.serverFailureCode = options.serverFailureCode ?? null;
|
|
27137
|
+
this.serverReasonCode = options.serverReasonCode ?? null;
|
|
27111
27138
|
this.retryable = options.retryable ?? [
|
|
27112
27139
|
"network_error",
|
|
27113
27140
|
"transport_rejected",
|
|
@@ -27133,6 +27160,7 @@ var init_mcp_client = __esm({
|
|
|
27133
27160
|
};
|
|
27134
27161
|
identifierSchema2 = external_exports.string().min(1).max(EXTERNAL_INFERENCE_SCHEMA_BOUNDS.identifier_length);
|
|
27135
27162
|
safeCodeSchema2 = external_exports.string().min(1).max(EXTERNAL_INFERENCE_SCHEMA_BOUNDS.long_code_length);
|
|
27163
|
+
serverReasonCodeSchema = safeCodeSchema2.regex(/^[a-z0-9][a-z0-9._-]*$/u);
|
|
27136
27164
|
publicFailureCodeSchema = external_exports.string().regex(/^[a-z0-9][a-z0-9._-]{0,95}$/u);
|
|
27137
27165
|
publicToolErrorSchema = external_exports.object({
|
|
27138
27166
|
failure_code: publicFailureCodeSchema,
|
|
@@ -27964,6 +27992,7 @@ var init_mcp_client = __esm({
|
|
|
27964
27992
|
// the exact request unless the server proves it was not applied.
|
|
27965
27993
|
retryable: retryableInfrastructureRejection || retryableClaimRejection || retryableHeartbeatClockSkew || retryableAdvertisementClockSkew,
|
|
27966
27994
|
serverFailureCode: publicToolError?.failure_code ?? null,
|
|
27995
|
+
serverReasonCode: serverReasonCodeSchema.safeParse(publicToolError?.reason_code).data ?? null,
|
|
27967
27996
|
retryAfterMs: hostNotClaimable ? publicToolError?.retry_after_ms ?? null : null
|
|
27968
27997
|
}
|
|
27969
27998
|
);
|
|
@@ -34703,7 +34732,7 @@ async function logoutCodexSubscription(options) {
|
|
|
34703
34732
|
await session.close();
|
|
34704
34733
|
}
|
|
34705
34734
|
}
|
|
34706
|
-
var CODEX_INFERENCE_PERMISSION_PROFILE, CODEX_AGENT_PERMISSION_PROFILE, CODEX_REASONING_CONTENT_MAX_UTF8_BYTES, CODEX_REASONING_SUMMARY_MAX_UTF8_BYTES, utf8Prefix, reasoningContentPrefix, HOST_RUNTIME_POLICY, CODEX_ACCOUNT_PLAN_TYPES, CODEX_AGENT_DYNAMIC_TOOLS, CodexAppServerError, objectOrNull, finiteToken, tokenUsageFromBreakdown, usageFromNotification, validPlanType, nonnegativeSafeIntegerOrNull, nonnegativeFiniteNumberOrNull, parseRateLimitWindow, RATE_LIMIT_REACHED_TYPES, DEFAULT_CODEX_QUOTA_COOLDOWN_MS, MAX_CODEX_QUOTA_COOLDOWN_MS, CODEX_TRANSIENT_RATE_LIMIT_COOLDOWN_MS, parseCreditsSnapshot, codexCreditsAvailable, parseRateLimitSnapshot, codexRateLimitRetryAtMs, codexAccountRateLimitReached, forbiddenMethod, forbiddenTerminalItem, forbiddenAgentMethod, forbiddenAgentTerminalItem, createCodexAgentToolSpecs, classifyCodexTurnFailure, scrubbedCodexEnvironment, killWindowsProcessTree, appServerArgs, GUARDIAN_SCRIPT, WINDOWS_RECEIPT_REPLACE_ERROR_CODES, MAX_RETIRED_RESPONSE_IDS, LATE_RESPONSE_SAFE_METHODS, replaceCodexGuardianReceiptFile, writeCodexGuardianSpawnIntent, parseGuardianReceipt, readCodexGuardianReceipt, waitForCodexGuardianState, defaultSpawn, CodexAppServerSession;
|
|
34735
|
+
var CODEX_INFERENCE_PERMISSION_PROFILE, CODEX_AGENT_PERMISSION_PROFILE, CODEX_REASONING_CONTENT_MAX_UTF8_BYTES, CODEX_REASONING_SUMMARY_MAX_UTF8_BYTES, utf8Prefix, reasoningContentPrefix, HOST_RUNTIME_POLICY, CODEX_ACCOUNT_PLAN_TYPES, CODEX_AGENT_DYNAMIC_TOOLS, CodexAppServerError, objectOrNull, finiteToken, tokenUsageFromBreakdown, usageFromNotification, validPlanType, nonnegativeSafeIntegerOrNull, nonnegativeFiniteNumberOrNull, parseRateLimitWindow, RATE_LIMIT_REACHED_TYPES, DEFAULT_CODEX_QUOTA_COOLDOWN_MS, MAX_CODEX_QUOTA_COOLDOWN_MS, CODEX_TRANSIENT_RATE_LIMIT_COOLDOWN_MS, parseCreditsSnapshot, parseCodexAccountRateLimits, codexCreditsAvailable, parseRateLimitSnapshot, codexRateLimitRetryAtMs, codexAccountRateLimitReached, forbiddenMethod, forbiddenTerminalItem, forbiddenAgentMethod, forbiddenAgentTerminalItem, createCodexAgentToolSpecs, classifyCodexTurnFailure, scrubbedCodexEnvironment, killWindowsProcessTree, appServerArgs, GUARDIAN_SCRIPT, WINDOWS_RECEIPT_REPLACE_ERROR_CODES, MAX_RETIRED_RESPONSE_IDS, LATE_RESPONSE_SAFE_METHODS, replaceCodexGuardianReceiptFile, writeCodexGuardianSpawnIntent, parseGuardianReceipt, readCodexGuardianReceipt, waitForCodexGuardianState, defaultSpawn, CodexAppServerSession;
|
|
34707
34736
|
var init_codex_app_server = __esm({
|
|
34708
34737
|
"lib/inference-host/codex-app-server.ts"() {
|
|
34709
34738
|
"use strict";
|
|
@@ -34843,6 +34872,23 @@ var init_codex_app_server = __esm({
|
|
|
34843
34872
|
balance: candidate.balance ?? null
|
|
34844
34873
|
};
|
|
34845
34874
|
};
|
|
34875
|
+
parseCodexAccountRateLimits = (value) => {
|
|
34876
|
+
const candidate = objectOrNull(value);
|
|
34877
|
+
if (!candidate) throw new Error("invalid account rate limits");
|
|
34878
|
+
const rateLimits = parseRateLimitSnapshot(candidate.rateLimits);
|
|
34879
|
+
const rawByLimitId = candidate.rateLimitsByLimitId;
|
|
34880
|
+
let rateLimitsByLimitId = null;
|
|
34881
|
+
if (rawByLimitId !== null && rawByLimitId !== void 0) {
|
|
34882
|
+
const byLimitId = objectOrNull(rawByLimitId);
|
|
34883
|
+
if (!byLimitId) throw new Error("invalid rate-limit bucket map");
|
|
34884
|
+
rateLimitsByLimitId = {};
|
|
34885
|
+
for (const [limitId, snapshot] of Object.entries(byLimitId)) {
|
|
34886
|
+
if (!limitId.trim()) throw new Error("invalid rate-limit bucket identity");
|
|
34887
|
+
rateLimitsByLimitId[limitId] = parseRateLimitSnapshot(snapshot);
|
|
34888
|
+
}
|
|
34889
|
+
}
|
|
34890
|
+
return { rateLimits, rateLimitsByLimitId };
|
|
34891
|
+
};
|
|
34846
34892
|
codexCreditsAvailable = (snapshot) => {
|
|
34847
34893
|
const credits = parseCreditsSnapshot(snapshot.credits);
|
|
34848
34894
|
return credits !== null && (credits.hasCredits || credits.unlimited);
|
|
@@ -35976,19 +36022,7 @@ child.once('close', async (code, signal) => {
|
|
|
35976
36022
|
signal
|
|
35977
36023
|
});
|
|
35978
36024
|
try {
|
|
35979
|
-
|
|
35980
|
-
const rawByLimitId = result.rateLimitsByLimitId;
|
|
35981
|
-
let rateLimitsByLimitId = null;
|
|
35982
|
-
if (rawByLimitId !== null && rawByLimitId !== void 0) {
|
|
35983
|
-
const byLimitId = objectOrNull(rawByLimitId);
|
|
35984
|
-
if (!byLimitId) throw new Error("invalid rate-limit bucket map");
|
|
35985
|
-
rateLimitsByLimitId = {};
|
|
35986
|
-
for (const [limitId, snapshot] of Object.entries(byLimitId)) {
|
|
35987
|
-
if (!limitId.trim()) throw new Error("invalid rate-limit bucket identity");
|
|
35988
|
-
rateLimitsByLimitId[limitId] = parseRateLimitSnapshot(snapshot);
|
|
35989
|
-
}
|
|
35990
|
-
}
|
|
35991
|
-
return { rateLimits, rateLimitsByLimitId };
|
|
36025
|
+
return parseCodexAccountRateLimits(result);
|
|
35992
36026
|
} catch (error48) {
|
|
35993
36027
|
throw new CodexAppServerError({
|
|
35994
36028
|
message: "Codex returned invalid account rate-limit metadata.",
|
|
@@ -37809,6 +37843,67 @@ var init_attempt_failure = __esm({
|
|
|
37809
37843
|
}
|
|
37810
37844
|
});
|
|
37811
37845
|
|
|
37846
|
+
// lib/inference-host/claim-answer.ts
|
|
37847
|
+
var claimDeferral, quotaRecoveryMayLiftRefusal, createClaimDeferralLog, recordClaimFailure;
|
|
37848
|
+
var init_claim_answer = __esm({
|
|
37849
|
+
"lib/inference-host/claim-answer.ts"() {
|
|
37850
|
+
"use strict";
|
|
37851
|
+
init_define_VTX_CLAUDE_CODE_POLICY();
|
|
37852
|
+
init_define_VTX_EXO_POLICY();
|
|
37853
|
+
init_define_VTX_GROK_POLICY();
|
|
37854
|
+
init_define_VTX_PI_MODEL_POLICY();
|
|
37855
|
+
init_mcp_client();
|
|
37856
|
+
claimDeferral = (error48, staleReplay) => {
|
|
37857
|
+
if (!(error48 instanceof ExternalInferenceMcpError)) return null;
|
|
37858
|
+
if (error48.serverFailureCode === "host_not_claimable" && error48.retryable) {
|
|
37859
|
+
return { reason: error48.serverReasonCode ?? error48.serverFailureCode, retry_after_ms: error48.retryAfterMs };
|
|
37860
|
+
}
|
|
37861
|
+
if (error48.definitivelyNotApplied && staleReplay && error48.code === "tool_rejected") {
|
|
37862
|
+
return { reason: error48.serverReasonCode ?? error48.serverFailureCode ?? error48.code, retry_after_ms: null };
|
|
37863
|
+
}
|
|
37864
|
+
return null;
|
|
37865
|
+
};
|
|
37866
|
+
quotaRecoveryMayLiftRefusal = (error48) => !(error48 instanceof ExternalInferenceMcpError && error48.serverReasonCode === "provider_cooldown_fixed");
|
|
37867
|
+
createClaimDeferralLog = () => {
|
|
37868
|
+
const last = /* @__PURE__ */ new Map();
|
|
37869
|
+
return {
|
|
37870
|
+
changed: (deferral) => {
|
|
37871
|
+
if (last.has(deferral.reason) && last.get(deferral.reason) === deferral.retry_after_ms) return false;
|
|
37872
|
+
last.set(deferral.reason, deferral.retry_after_ms);
|
|
37873
|
+
return true;
|
|
37874
|
+
},
|
|
37875
|
+
/** A claim the server served (or found nothing for) ends every deferral. */
|
|
37876
|
+
reset: () => {
|
|
37877
|
+
last.clear();
|
|
37878
|
+
}
|
|
37879
|
+
};
|
|
37880
|
+
};
|
|
37881
|
+
recordClaimFailure = (claimFailures, failure2) => {
|
|
37882
|
+
const open4 = claimFailures.find((record6) => record6.resolution === void 0 && record6.claim_request_id === failure2.claimRequestId);
|
|
37883
|
+
const responseBodyBytes = failure2.timing?.response_body_bytes ?? null;
|
|
37884
|
+
const bodyCut = failure2.failureCode === "network_error" && (responseBodyBytes ?? 0) > 0;
|
|
37885
|
+
if (open4) {
|
|
37886
|
+
open4.attempts = Math.min(Number.MAX_SAFE_INTEGER, open4.attempts + 1);
|
|
37887
|
+
if (bodyCut) open4.body_cut = true;
|
|
37888
|
+
if (responseBodyBytes !== null) {
|
|
37889
|
+
open4.response_body_bytes = Math.max(open4.response_body_bytes ?? 0, responseBodyBytes);
|
|
37890
|
+
}
|
|
37891
|
+
return false;
|
|
37892
|
+
}
|
|
37893
|
+
claimFailures.push({
|
|
37894
|
+
claim_request_id: failure2.claimRequestId,
|
|
37895
|
+
failed_at: failure2.failedAt,
|
|
37896
|
+
failure_code: failure2.failureCode,
|
|
37897
|
+
http_status_code: failure2.httpStatusCode,
|
|
37898
|
+
response_body_bytes: responseBodyBytes,
|
|
37899
|
+
body_cut: bodyCut,
|
|
37900
|
+
attempts: 1
|
|
37901
|
+
});
|
|
37902
|
+
return true;
|
|
37903
|
+
};
|
|
37904
|
+
}
|
|
37905
|
+
});
|
|
37906
|
+
|
|
37812
37907
|
// lib/inference-host/runner.ts
|
|
37813
37908
|
import { createHash as createHash5, randomUUID as randomUUID2 } from "node:crypto";
|
|
37814
37909
|
function createDefaultInferenceHostRunnerDependencies(options) {
|
|
@@ -37868,6 +37963,7 @@ var init_runner = __esm({
|
|
|
37868
37963
|
init_config2();
|
|
37869
37964
|
init_oauth();
|
|
37870
37965
|
init_attempt_failure();
|
|
37966
|
+
init_claim_answer();
|
|
37871
37967
|
canReplayFencedAgentTerminal = (state2, fence) => state2?.schema_version === "vtx_inference_agent_runtime_v3" && state2.adapter_id === fence.adapter_id && state2.host_id === fence.host_id && state2.assignment.assignment_id === fence.assignment_id && state2.pending_turn?.terminal_receipt?.terminal_status === "failed" && state2.pending_turn.terminal_receipt.failure_code === fence.failure_code && (fence.dispatch_outcome !== "outcome_unknown" || (state2.pending_turn.terminal_receipt.grok_tool_validation?.prior_dispatch === true || state2.pending_turn.terminal_receipt.grok_response_identity != null || state2.pending_turn.terminal_receipt.provider_http_status !== void 0) && state2.pending_turn.terminal_receipt.dispatch_outcome === "outcome_unknown");
|
|
37872
37968
|
fencedTurnAwaitsAssignmentCheck = (state2, fence) => fence.failure_code === "agent_turn_outcome_unknown" && state2?.schema_version === "vtx_inference_agent_runtime_v3" && state2.adapter_id === fence.adapter_id && state2.host_id === fence.host_id && state2.assignment.assignment_id === fence.assignment_id && state2.pending_turn != null && !state2.pending_turn.terminal_receipt;
|
|
37873
37969
|
RUNTIME_RECEIPT_SCHEMA_VERSION = "vtx_inference_host_runtime_v1";
|
|
@@ -38555,6 +38651,7 @@ var init_runner = __esm({
|
|
|
38555
38651
|
let terminalRecoveryFailureCode = null;
|
|
38556
38652
|
let acknowledgedRecoveryDiagnostic = null;
|
|
38557
38653
|
const claimFailures = [];
|
|
38654
|
+
const claimDeferralLog = createClaimDeferralLog();
|
|
38558
38655
|
let claimFailuresDropped = 0;
|
|
38559
38656
|
const boundClaimFailures = () => {
|
|
38560
38657
|
while (claimFailures.length > EXTERNAL_INFERENCE_LIMITS.max_heartbeat_claim_failures) {
|
|
@@ -39263,7 +39360,7 @@ var init_runner = __esm({
|
|
|
39263
39360
|
);
|
|
39264
39361
|
throw error48;
|
|
39265
39362
|
}
|
|
39266
|
-
if (claimAvailabilityBackoff
|
|
39363
|
+
if (claimAvailabilityBackoff?.liftable === true && result.host.status === "online" && request.provider_quota_recovery != null && Date.parse(request.provider_quota_recovery.observed_at) >= claimAvailabilityBackoff.rejectedAtMs) {
|
|
39267
39364
|
claimAvailabilityBackoff = null;
|
|
39268
39365
|
}
|
|
39269
39366
|
};
|
|
@@ -39971,6 +40068,7 @@ var init_runner = __esm({
|
|
|
39971
40068
|
}
|
|
39972
40069
|
);
|
|
39973
40070
|
assertClaimResult(request, claim);
|
|
40071
|
+
claimDeferralLog.reset();
|
|
39974
40072
|
resolveClaimFailures(
|
|
39975
40073
|
"replayed",
|
|
39976
40074
|
(record6) => record6.claim_request_id === request.claim_request_id
|
|
@@ -39981,35 +40079,25 @@ var init_runner = __esm({
|
|
|
39981
40079
|
"claim_failed"
|
|
39982
40080
|
);
|
|
39983
40081
|
const httpStatusCode = error48 instanceof ExternalInferenceMcpError ? error48.httpStatusCode : null;
|
|
39984
|
-
|
|
39985
|
-
|
|
39986
|
-
|
|
39987
|
-
|
|
39988
|
-
|
|
39989
|
-
|
|
39990
|
-
|
|
39991
|
-
|
|
39992
|
-
|
|
39993
|
-
|
|
39994
|
-
|
|
39995
|
-
open4.attempts = Math.min(Number.MAX_SAFE_INTEGER, open4.attempts + 1);
|
|
39996
|
-
if (bodyCut) open4.body_cut = true;
|
|
39997
|
-
if (responseBodyBytes !== null) {
|
|
39998
|
-
open4.response_body_bytes = Math.max(open4.response_body_bytes ?? 0, responseBodyBytes);
|
|
39999
|
-
}
|
|
40000
|
-
} else {
|
|
40001
|
-
claimFailures.push({
|
|
40002
|
-
claim_request_id: request.claim_request_id,
|
|
40003
|
-
failed_at: isoAt(claimCallStartedAtMs),
|
|
40004
|
-
failure_code: failureCode,
|
|
40005
|
-
http_status_code: httpStatusCode,
|
|
40006
|
-
response_body_bytes: responseBodyBytes,
|
|
40007
|
-
body_cut: bodyCut,
|
|
40008
|
-
attempts: 1
|
|
40009
|
-
});
|
|
40010
|
-
boundClaimFailures();
|
|
40011
|
-
}
|
|
40082
|
+
const deferral = claimDeferral(error48, request.advertisement_generation < receipt.advertisement_generation);
|
|
40083
|
+
if (deferral && claimDeferralLog.changed(deferral)) {
|
|
40084
|
+
emitDiagnostic("claim_deferred", { claim_request_id: request.claim_request_id, ...deferral });
|
|
40085
|
+
} else if (!deferral && claimTiming) {
|
|
40086
|
+
emitDiagnostic("claim_request_failed", {
|
|
40087
|
+
claim_request_id: request.claim_request_id,
|
|
40088
|
+
failure_code: failureCode,
|
|
40089
|
+
http_status_code: httpStatusCode,
|
|
40090
|
+
server_failure_code: error48 instanceof ExternalInferenceMcpError ? error48.serverFailureCode : null,
|
|
40091
|
+
client_timing: claimTiming
|
|
40092
|
+
});
|
|
40012
40093
|
}
|
|
40094
|
+
if (!deferral && !this.options.signal?.aborted && recordClaimFailure(claimFailures, {
|
|
40095
|
+
claimRequestId: request.claim_request_id,
|
|
40096
|
+
failedAt: isoAt(claimCallStartedAtMs),
|
|
40097
|
+
failureCode,
|
|
40098
|
+
httpStatusCode,
|
|
40099
|
+
timing: claimTiming
|
|
40100
|
+
})) boundClaimFailures();
|
|
40013
40101
|
if (!this.options.signal?.aborted && request.schema_version === "external_inference_job_claim_v4" && error48 instanceof ExternalInferenceMcpError && error48.serverFailureCode === "schema_validation") {
|
|
40014
40102
|
batchClaimVersion = INFERENCE_JOB_CLAIM_SCHEMA_VERSION.V3;
|
|
40015
40103
|
await mutateReceipt((current) => ({
|
|
@@ -40101,7 +40189,7 @@ var init_runner = __esm({
|
|
|
40101
40189
|
const rejectedAtMs = now();
|
|
40102
40190
|
const retryAtMs = rejectedAtMs + remoteRetryAfterMs(error48, HOST_RUNTIME_POLICY2.remote_retry_fallback_ms);
|
|
40103
40191
|
if (error48 instanceof ExternalInferenceMcpError && error48.serverFailureCode === "host_not_claimable") {
|
|
40104
|
-
claimAvailabilityBackoff = { untilMs: retryAtMs, rejectedAtMs };
|
|
40192
|
+
claimAvailabilityBackoff = { untilMs: retryAtMs, rejectedAtMs, liftable: quotaRecoveryMayLiftRefusal(error48) };
|
|
40105
40193
|
} else {
|
|
40106
40194
|
nextClaimAt = retryAtMs;
|
|
40107
40195
|
}
|
|
@@ -42777,7 +42865,7 @@ import {
|
|
|
42777
42865
|
import { createHash as createHash7, randomBytes as randomBytes4 } from "node:crypto";
|
|
42778
42866
|
import { tmpdir as tmpdir3 } from "node:os";
|
|
42779
42867
|
import { isAbsolute as isAbsolute6, join as join6, relative as relative4, resolve as resolve5, sep as sep3 } from "node:path";
|
|
42780
|
-
var MAX_PROMPT_BYTES2, HOST_RUNTIME_POLICY4, CODEX_MODEL_NAME_PATTERN, CODEX_REASONING_EFFORT_PATTERN, codexRecoveryCheckpointProcessFingerprint, proveCodexSameBootQuiescence, tokenUsageReceiptSchema, turnResultReceiptSchema, terminalReceiptSchema, recoveryCheckpointSchema, recoveryFileSchema, FileCodexAttemptRecoveryStore, utf8Bytes, assertAttemptActive, tomlString, permissionConfig, ensureDedicatedCodexHome, createIsolatedCodexAttemptResources, isMissingPathError, createIsolatedCodexHostResources, validateAttemptInput, isStrictDescendant, assertRecoveryResourceScope, removeRecoveredThread, confirmCodexGuardianTerminated, confirmGuardianTerminatedForRecovery, recoveredCodexProcessExit, reconcileCodexAttemptRecovery, CodexSubscriptionAdapter, CodexAgentSubscriptionAdapter;
|
|
42868
|
+
var MAX_PROMPT_BYTES2, HOST_RUNTIME_POLICY4, CODEX_MODEL_NAME_PATTERN, CODEX_REASONING_EFFORT_PATTERN, codexRecoveryCheckpointProcessFingerprint, proveCodexSameBootQuiescence, tokenUsageReceiptSchema, turnResultReceiptSchema, terminalReceiptSchema, recoveryAccountLimitsSchema, recoveryCheckpointSchema, recoveryFileSchema, FileCodexAttemptRecoveryStore, utf8Bytes, assertAttemptActive, tomlString, permissionConfig, ensureDedicatedCodexHome, createIsolatedCodexAttemptResources, isMissingPathError, createIsolatedCodexHostResources, validateAttemptInput, isStrictDescendant, assertRecoveryResourceScope, removeRecoveredThread, confirmCodexGuardianTerminated, confirmGuardianTerminatedForRecovery, recoveredCodexProcessExit, reconcileCodexAttemptRecovery, CodexSubscriptionAdapter, CodexAgentSubscriptionAdapter;
|
|
42781
42869
|
var init_codex_adapter = __esm({
|
|
42782
42870
|
"lib/inference-host/codex-adapter.ts"() {
|
|
42783
42871
|
"use strict";
|
|
@@ -42870,6 +42958,23 @@ var init_codex_adapter = __esm({
|
|
|
42870
42958
|
})
|
|
42871
42959
|
})
|
|
42872
42960
|
]);
|
|
42961
|
+
recoveryAccountLimitsSchema = external_exports.strictObject({
|
|
42962
|
+
schema_version: external_exports.literal("vtx_codex_recovery_account_limits_v1"),
|
|
42963
|
+
attempts: external_exports.record(external_exports.string(), external_exports.strictObject({
|
|
42964
|
+
// The exact failure the limits were read with: input, code and retry time.
|
|
42965
|
+
inputSha256: external_exports.string().regex(/^[0-9a-f]{64}$/u),
|
|
42966
|
+
code: external_exports.string().min(1).max(CODEX_RECOVERY_RECEIPT_MAX_CHARS.ERROR_CODE),
|
|
42967
|
+
retryAtMs: external_exports.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER).nullable(),
|
|
42968
|
+
rateLimits: external_exports.custom((value) => {
|
|
42969
|
+
try {
|
|
42970
|
+
parseCodexAccountRateLimits(value);
|
|
42971
|
+
return true;
|
|
42972
|
+
} catch {
|
|
42973
|
+
return false;
|
|
42974
|
+
}
|
|
42975
|
+
})
|
|
42976
|
+
}))
|
|
42977
|
+
});
|
|
42873
42978
|
recoveryCheckpointSchema = external_exports.strictObject({
|
|
42874
42979
|
schemaVersion: external_exports.literal("vtx_codex_attempt_recovery_v1"),
|
|
42875
42980
|
attemptId: identifierSchema,
|
|
@@ -42907,6 +43012,10 @@ var init_codex_adapter = __esm({
|
|
|
42907
43012
|
this.path = path;
|
|
42908
43013
|
this.queue = Promise.resolve();
|
|
42909
43014
|
}
|
|
43015
|
+
/** The account limits file beside the recovery file (recoveryAccountLimitsSchema). */
|
|
43016
|
+
get accountLimitsPath() {
|
|
43017
|
+
return `${this.path}.account-limits.json`;
|
|
43018
|
+
}
|
|
42910
43019
|
async readAll() {
|
|
42911
43020
|
const raw = await readInferencePrivateFile(this.path, "Codex attempt recovery file");
|
|
42912
43021
|
if (raw === null) return {};
|
|
@@ -42924,44 +43033,116 @@ var init_codex_adapter = __esm({
|
|
|
42924
43033
|
}
|
|
42925
43034
|
return document2.attempts;
|
|
42926
43035
|
}
|
|
43036
|
+
async readAccountLimits() {
|
|
43037
|
+
try {
|
|
43038
|
+
const raw = await readInferencePrivateFile(this.accountLimitsPath, "Codex recovery account limits file");
|
|
43039
|
+
return raw === null ? {} : recoveryAccountLimitsSchema.parse(JSON.parse(raw)).attempts;
|
|
43040
|
+
} catch {
|
|
43041
|
+
return {};
|
|
43042
|
+
}
|
|
43043
|
+
}
|
|
43044
|
+
// Limits reach only the exact failure they were read with.
|
|
43045
|
+
withAccountLimits(checkpoint, limits) {
|
|
43046
|
+
const entry = limits[checkpoint.attemptId];
|
|
43047
|
+
const terminal = checkpoint.terminal;
|
|
43048
|
+
if (terminal?.kind !== "failed" || entry?.inputSha256 !== checkpoint.inputSha256 || entry.code !== terminal.error.code || entry.retryAtMs !== (terminal.error.retryAtMs ?? null)) return checkpoint;
|
|
43049
|
+
return { ...checkpoint, terminal: { kind: "failed", error: { ...terminal.error, rateLimits: entry.rateLimits } } };
|
|
43050
|
+
}
|
|
43051
|
+
// The limits file is written first (a crash between the writes leaves limits
|
|
43052
|
+
// no failure matches, never a failure missing them) and only when its entries
|
|
43053
|
+
// change, and never at the recovery file's expense: a limits file that cannot
|
|
43054
|
+
// be written costs only the limits. Entries of attempts the recovery file no
|
|
43055
|
+
// longer holds (cleared by this or an older release) go.
|
|
43056
|
+
async writeAll(attempts, limits, previous) {
|
|
43057
|
+
const kept = Object.fromEntries(Object.entries(limits).filter(([attemptId]) => attemptId in attempts));
|
|
43058
|
+
if (Object.keys(attempts).length === 0 || JSON.stringify(kept) !== JSON.stringify(previous)) {
|
|
43059
|
+
try {
|
|
43060
|
+
if (Object.keys(kept).length === 0) {
|
|
43061
|
+
await clearInferencePrivateFile(this.accountLimitsPath, "Codex recovery account limits file");
|
|
43062
|
+
} else {
|
|
43063
|
+
await writeAtomicInferencePrivateFile(this.accountLimitsPath, `${JSON.stringify({
|
|
43064
|
+
schema_version: "vtx_codex_recovery_account_limits_v1",
|
|
43065
|
+
attempts: kept
|
|
43066
|
+
}, null, JSON_INDENT_SPACES)}
|
|
43067
|
+
`);
|
|
43068
|
+
}
|
|
43069
|
+
} catch {
|
|
43070
|
+
}
|
|
43071
|
+
}
|
|
43072
|
+
if (Object.keys(attempts).length === 0) {
|
|
43073
|
+
await clearInferencePrivateFile(this.path, "Codex attempt recovery file");
|
|
43074
|
+
return;
|
|
43075
|
+
}
|
|
43076
|
+
await writeAtomicInferencePrivateFile(this.path, `${JSON.stringify({
|
|
43077
|
+
schema_version: "vtx_codex_recovery_file_v1",
|
|
43078
|
+
attempts
|
|
43079
|
+
}, null, JSON_INDENT_SPACES)}
|
|
43080
|
+
`);
|
|
43081
|
+
}
|
|
42927
43082
|
enqueue(operation) {
|
|
42928
43083
|
const pending3 = this.queue.then(operation, operation);
|
|
42929
43084
|
this.queue = pending3.then(() => void 0, () => void 0);
|
|
42930
43085
|
return pending3;
|
|
42931
43086
|
}
|
|
43087
|
+
/** One attempt for its same-attempt recovery, with the account limits its failure was read with. */
|
|
42932
43088
|
async load(attemptId) {
|
|
42933
43089
|
await this.queue;
|
|
42934
|
-
|
|
43090
|
+
const checkpoint = (await this.readAll())[attemptId];
|
|
43091
|
+
return checkpoint ? this.withAccountLimits(checkpoint, await this.readAccountLimits()) : null;
|
|
42935
43092
|
}
|
|
43093
|
+
/**
|
|
43094
|
+
* Every attempt exactly as the recovery file holds it, without account
|
|
43095
|
+
* limits: the service recovery compares these with a raw copy of the file.
|
|
43096
|
+
*/
|
|
42936
43097
|
async loadAll() {
|
|
42937
43098
|
await this.queue;
|
|
42938
43099
|
return await this.readAll();
|
|
42939
43100
|
}
|
|
43101
|
+
/**
|
|
43102
|
+
* A failure's own rateLimits (or null) replaces its stored limits; a
|
|
43103
|
+
* checkpoint saved without that field (one loadAll returned) keeps them.
|
|
43104
|
+
*/
|
|
42940
43105
|
async save(checkpoint) {
|
|
42941
|
-
const
|
|
43106
|
+
const terminal = checkpoint.terminal;
|
|
43107
|
+
let stored = checkpoint;
|
|
43108
|
+
let limitsUpdate = null;
|
|
43109
|
+
if (terminal?.kind === "failed" && "rateLimits" in terminal.error) {
|
|
43110
|
+
const { rateLimits, ...error48 } = terminal.error;
|
|
43111
|
+
limitsUpdate = { rateLimits: rateLimits ?? null };
|
|
43112
|
+
stored = { ...checkpoint, terminal: { kind: "failed", error: error48 } };
|
|
43113
|
+
}
|
|
43114
|
+
const validated = recoveryCheckpointSchema.parse(stored);
|
|
42942
43115
|
await this.enqueue(async () => {
|
|
42943
43116
|
const attempts = await this.readAll();
|
|
42944
43117
|
attempts[validated.attemptId] = validated;
|
|
42945
|
-
await
|
|
42946
|
-
|
|
42947
|
-
|
|
42948
|
-
|
|
42949
|
-
|
|
43118
|
+
const previous = await this.readAccountLimits();
|
|
43119
|
+
const limits = { ...previous };
|
|
43120
|
+
if (limitsUpdate?.rateLimits && validated.terminal?.kind === "failed") {
|
|
43121
|
+
limits[validated.attemptId] = {
|
|
43122
|
+
inputSha256: validated.inputSha256,
|
|
43123
|
+
code: validated.terminal.error.code,
|
|
43124
|
+
retryAtMs: validated.terminal.error.retryAtMs ?? null,
|
|
43125
|
+
rateLimits: limitsUpdate.rateLimits
|
|
43126
|
+
};
|
|
43127
|
+
} else if (limitsUpdate) {
|
|
43128
|
+
delete limits[validated.attemptId];
|
|
43129
|
+
}
|
|
43130
|
+
await this.writeAll(attempts, limits, previous);
|
|
42950
43131
|
});
|
|
42951
43132
|
}
|
|
42952
43133
|
async clear(attemptId) {
|
|
42953
43134
|
await this.enqueue(async () => {
|
|
42954
43135
|
const attempts = await this.readAll();
|
|
42955
43136
|
delete attempts[attemptId];
|
|
42956
|
-
|
|
42957
|
-
|
|
42958
|
-
|
|
42959
|
-
|
|
42960
|
-
|
|
42961
|
-
|
|
42962
|
-
|
|
42963
|
-
|
|
42964
|
-
|
|
43137
|
+
const previous = await this.readAccountLimits();
|
|
43138
|
+
await this.writeAll(attempts, previous, previous);
|
|
43139
|
+
});
|
|
43140
|
+
}
|
|
43141
|
+
/** Removes the recovery file and its account limits (logout and revoke). */
|
|
43142
|
+
async discard() {
|
|
43143
|
+
await this.enqueue(async () => {
|
|
43144
|
+
await clearInferencePrivateFile(this.accountLimitsPath, "Codex recovery account limits file").catch(() => void 0);
|
|
43145
|
+
await clearInferencePrivateFile(this.path, "Codex attempt recovery file");
|
|
42965
43146
|
});
|
|
42966
43147
|
}
|
|
42967
43148
|
};
|
|
@@ -43946,7 +44127,8 @@ var init_codex_adapter = __esm({
|
|
|
43946
44127
|
httpStatusCode: recovered.httpStatusCode,
|
|
43947
44128
|
retryAtMs: recovered.retryAtMs,
|
|
43948
44129
|
usage: recovered.usage,
|
|
43949
|
-
processExit: recovered.processExit
|
|
44130
|
+
processExit: recovered.processExit,
|
|
44131
|
+
rateLimits: recovered.rateLimits ?? null
|
|
43950
44132
|
});
|
|
43951
44133
|
}
|
|
43952
44134
|
throw new CodexAppServerError({
|
|
@@ -44107,7 +44289,8 @@ var init_codex_adapter = __esm({
|
|
|
44107
44289
|
httpStatusCode: error48.httpStatusCode,
|
|
44108
44290
|
retryAtMs: error48.retryAtMs,
|
|
44109
44291
|
usage: error48.usage,
|
|
44110
|
-
processExit: error48.processExit
|
|
44292
|
+
processExit: error48.processExit,
|
|
44293
|
+
rateLimits: error48.rateLimits
|
|
44111
44294
|
}
|
|
44112
44295
|
}
|
|
44113
44296
|
};
|
|
@@ -44124,6 +44307,7 @@ var init_codex_adapter = __esm({
|
|
|
44124
44307
|
retryAtMs: error48.retryAtMs,
|
|
44125
44308
|
usage: error48.usage,
|
|
44126
44309
|
processExit: error48.processExit,
|
|
44310
|
+
rateLimits: error48.rateLimits,
|
|
44127
44311
|
cause: error48
|
|
44128
44312
|
});
|
|
44129
44313
|
}
|
|
@@ -52092,9 +52276,9 @@ ${result.stderr}`)) {
|
|
|
52092
52276
|
}
|
|
52093
52277
|
}
|
|
52094
52278
|
async status(confirmedRuntime) {
|
|
52095
|
-
const manifest = await
|
|
52279
|
+
const manifest = await readManifestAcrossAtomicReplacement(this.manifestPath());
|
|
52096
52280
|
const runtime = confirmedRuntime?.manifest_generation === manifest?.generation ? confirmedRuntime : await readRuntimeAcrossAtomicReplacement(this.runtimePath()).catch(() => null);
|
|
52097
|
-
const desired = await
|
|
52281
|
+
const desired = await readDesiredAcrossAtomicReplacement(this.desiredPath());
|
|
52098
52282
|
const result = await this.managerCommand("status");
|
|
52099
52283
|
const output3 = result.stdout.trim();
|
|
52100
52284
|
const managerActive = result.exitCode === 0 && (this.platform === "linux" ? /(?:^|\n)ActiveState=active(?:\n|$)/u.test(output3) : this.platform === "win32" ? output3.trim() === "4" : /\bstate\s*=\s*running\b/iu.test(output3));
|
|
@@ -53417,10 +53601,7 @@ Durable service:
|
|
|
53417
53601
|
"Inference host runtime receipt file"
|
|
53418
53602
|
);
|
|
53419
53603
|
await rm17(codexGuardianReceiptRoot(config2), { recursive: true, force: true });
|
|
53420
|
-
await
|
|
53421
|
-
codexRecoveryPath(config2),
|
|
53422
|
-
"Codex attempt recovery file"
|
|
53423
|
-
);
|
|
53604
|
+
await new FileCodexAttemptRecoveryStore(codexRecoveryPath(config2)).discard();
|
|
53424
53605
|
await clearInferenceAgentAttemptState(config2.statePath);
|
|
53425
53606
|
await clearInferenceAgentNextState(config2.statePath);
|
|
53426
53607
|
await clearInferenceForegroundAgentControlState(config2.statePath);
|
|
@@ -63408,7 +63589,7 @@ var init_runtime_handoff = __esm({
|
|
|
63408
63589
|
});
|
|
63409
63590
|
|
|
63410
63591
|
// lib/runtime/provider-observability.ts
|
|
63411
|
-
var MAX_DIAGNOSTIC_LIST_ITEMS, record5, ERROR_TOKEN, ERROR_DOMAIN, ERROR_INPUT, ERROR_ECHO_REDACTIONS, ERROR_PROSE_REDACTIONS, CONTROL_CHARACTER_RUN, WHITESPACE_RUN, collapseProse, settled, REDACTED_MARKER_START, boundedMessage, normalizeProviderError, identifier, count4, normalizeProviderDiagnostics, providerRequestId, hash2, googleCredentialDiagnostics, withExecutionMode, retryAfterDiagnostics, extractProviderDiagnostics, estimateRequestInputTokens;
|
|
63592
|
+
var MAX_DIAGNOSTIC_LIST_ITEMS, record5, ERROR_TOKEN, ERROR_DOMAIN, ERROR_INPUT, ERROR_ECHO_REDACTIONS, ERROR_PROSE_REDACTIONS, CONTROL_CHARACTER_RUN, UNSTORABLE_TEXT, WHITESPACE_RUN, collapseProse, settled, REDACTED_MARKER_START, cutOutsideMarker, boundedMessage, normalizeProviderError, REPLY_POLICY, REPLY_HEADER_NAME, isProviderReplyHeaderName, boundedReplyText, normalizeProviderReply, identifier, count4, normalizeProviderDiagnostics, providerRequestId, hash2, googleCredentialDiagnostics, withExecutionMode, retryAfterDiagnostics, extractProviderDiagnostics, estimateRequestInputTokens;
|
|
63412
63593
|
var init_provider_observability = __esm({
|
|
63413
63594
|
"lib/runtime/provider-observability.ts"() {
|
|
63414
63595
|
"use strict";
|
|
@@ -63418,6 +63599,7 @@ var init_provider_observability = __esm({
|
|
|
63418
63599
|
init_define_VTX_PI_MODEL_POLICY();
|
|
63419
63600
|
init_constants();
|
|
63420
63601
|
init_runtime_redaction();
|
|
63602
|
+
init_runtime_policy_generated2();
|
|
63421
63603
|
MAX_DIAGNOSTIC_LIST_ITEMS = PROVIDER_DIAGNOSTIC_LIMITS.MAX_LIST_ITEMS;
|
|
63422
63604
|
record5 = (v) => v !== null && typeof v === "object" && !Array.isArray(v) ? v : {};
|
|
63423
63605
|
ERROR_TOKEN = /^[A-Z][A-Z0-9_]{0,63}$/;
|
|
@@ -63438,6 +63620,7 @@ var init_provider_observability = __esm({
|
|
|
63438
63620
|
[/"[^"]*"|'[^'\r\n]*'/g, "[REDACTED]"]
|
|
63439
63621
|
];
|
|
63440
63622
|
CONTROL_CHARACTER_RUN = /[\x00-\x1f\x7f]+/g;
|
|
63623
|
+
UNSTORABLE_TEXT = /\u0000|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g;
|
|
63441
63624
|
WHITESPACE_RUN = new RegExp(`${WHITESPACE_CLASS}+`, "g");
|
|
63442
63625
|
collapseProse = (value) => value.replace(CONTROL_CHARACTER_RUN, " ").replace(WHITESPACE_RUN, " ").trim();
|
|
63443
63626
|
settled = (value) => {
|
|
@@ -63451,12 +63634,14 @@ var init_provider_observability = __esm({
|
|
|
63451
63634
|
return current;
|
|
63452
63635
|
};
|
|
63453
63636
|
REDACTED_MARKER_START = "[REDACTED";
|
|
63637
|
+
cutOutsideMarker = (full, cut) => {
|
|
63638
|
+
const opened = cut.lastIndexOf("[");
|
|
63639
|
+
return opened !== -1 && full.startsWith(REDACTED_MARKER_START, opened) && full.indexOf("]", opened) >= cut.length ? cut.slice(0, opened) : cut;
|
|
63640
|
+
};
|
|
63454
63641
|
boundedMessage = (value) => {
|
|
63455
63642
|
const characters = Array.from(value);
|
|
63456
63643
|
if (characters.length <= PROVIDER_DIAGNOSTIC_LIMITS.MAX_ERROR_MESSAGE_CHARS) return value;
|
|
63457
|
-
|
|
63458
|
-
const marker2 = cut.lastIndexOf(REDACTED_MARKER_START);
|
|
63459
|
-
if (marker2 !== -1 && value.indexOf("]", marker2) >= cut.length) cut = cut.slice(0, marker2);
|
|
63644
|
+
const cut = cutOutsideMarker(value, characters.slice(0, PROVIDER_DIAGNOSTIC_LIMITS.MAX_ERROR_MESSAGE_CHARS).join(""));
|
|
63460
63645
|
return cut.replace(/ +$/, "");
|
|
63461
63646
|
};
|
|
63462
63647
|
normalizeProviderError = (value) => {
|
|
@@ -63473,6 +63658,7 @@ var init_provider_observability = __esm({
|
|
|
63473
63658
|
message = sanitizeRuntimeDiagnosticValue(message);
|
|
63474
63659
|
for (const [pattern, replacement] of ERROR_PROSE_REDACTIONS) message = message.replace(pattern, replacement);
|
|
63475
63660
|
message = settled(sanitizeRuntimeDiagnosticValue(collapseProse(sanitizeRuntimeDiagnosticValue(message))));
|
|
63661
|
+
message = message.replace(UNSTORABLE_TEXT, "\uFFFD");
|
|
63476
63662
|
}
|
|
63477
63663
|
const fullLength = Array.from(message).length;
|
|
63478
63664
|
let bounded = boundedMessage(message);
|
|
@@ -63492,6 +63678,35 @@ var init_provider_observability = __esm({
|
|
|
63492
63678
|
}
|
|
63493
63679
|
return result;
|
|
63494
63680
|
};
|
|
63681
|
+
REPLY_POLICY = runtime_policy_generated_default2.llm.provider_diagnostics;
|
|
63682
|
+
REPLY_HEADER_NAME = /^[a-z0-9][a-z0-9-]{0,127}$/;
|
|
63683
|
+
isProviderReplyHeaderName = (name) => {
|
|
63684
|
+
const lowered = name.toLowerCase();
|
|
63685
|
+
return REPLY_HEADER_NAME.test(lowered) && REPLY_POLICY.reply_header_name_parts.some((part) => lowered.includes(part));
|
|
63686
|
+
};
|
|
63687
|
+
boundedReplyText = (value) => {
|
|
63688
|
+
const masked = sanitizeRuntimeDiagnosticValue(value.replace(UNSTORABLE_TEXT, "\uFFFD"));
|
|
63689
|
+
const characters = Array.from(masked);
|
|
63690
|
+
if (characters.length <= REPLY_POLICY.reply_body_max_chars) return { text: masked, truncated: false };
|
|
63691
|
+
let cut = cutOutsideMarker(masked, characters.slice(0, REPLY_POLICY.reply_body_max_chars).join(""));
|
|
63692
|
+
while (sanitizeRuntimeDiagnosticValue(cut) !== cut) cut = Array.from(cut).slice(0, -1).join("");
|
|
63693
|
+
return { text: cut, truncated: true };
|
|
63694
|
+
};
|
|
63695
|
+
normalizeProviderReply = (value) => {
|
|
63696
|
+
const raw = record5(value);
|
|
63697
|
+
const result = {};
|
|
63698
|
+
if (typeof raw.status === "number" && Number.isInteger(raw.status) && raw.status >= HTTP_STATUS_MIN && raw.status <= HTTP_STATUS_MAX) result.status = raw.status;
|
|
63699
|
+
if (typeof raw.body === "string" && raw.body) {
|
|
63700
|
+
const { text: text2, truncated } = boundedReplyText(raw.body);
|
|
63701
|
+
if (text2) {
|
|
63702
|
+
result.body = text2;
|
|
63703
|
+
if (truncated || raw.body_truncated === true) result.body_truncated = true;
|
|
63704
|
+
}
|
|
63705
|
+
}
|
|
63706
|
+
const headers = Object.entries(record5(raw.headers)).filter((entry) => typeof entry[1] === "string" && entry[0] === entry[0].toLowerCase() && isProviderReplyHeaderName(entry[0])).sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0).slice(0, REPLY_POLICY.reply_max_headers);
|
|
63707
|
+
if (headers.length) result.headers = Object.fromEntries(headers.map(([name, text2]) => [name, boundedReplyText(text2).text]));
|
|
63708
|
+
return result;
|
|
63709
|
+
};
|
|
63495
63710
|
identifier = (v) => typeof v === "string" && /^[A-Za-z0-9][A-Za-z0-9_.:/-]{0,255}$/.test(v) ? v : void 0;
|
|
63496
63711
|
count4 = (v) => {
|
|
63497
63712
|
if (typeof v !== "number" && (typeof v !== "string" || !v.trim())) return void 0;
|
|
@@ -63531,6 +63746,8 @@ var init_provider_observability = __esm({
|
|
|
63531
63746
|
}).filter((v) => Object.keys(v).length > 0);
|
|
63532
63747
|
if (violations.length) result.quota_violations = violations;
|
|
63533
63748
|
}
|
|
63749
|
+
const providerReply = normalizeProviderReply(raw.provider_reply);
|
|
63750
|
+
if (Object.keys(providerReply).length) result.provider_reply = providerReply;
|
|
63534
63751
|
const outputValidation = record5(raw.output_validation);
|
|
63535
63752
|
if (Array.isArray(outputValidation.expected_symbols)) {
|
|
63536
63753
|
const symbols = outputValidation.expected_symbols.slice(0, MAX_DIAGNOSTIC_LIST_ITEMS).map(identifier).filter((symbol2) => symbol2 !== void 0);
|
|
@@ -105324,7 +105541,7 @@ var init_execution_capacity = __esm({
|
|
|
105324
105541
|
});
|
|
105325
105542
|
|
|
105326
105543
|
// lib/runtime/owed-protection-warnings.ts
|
|
105327
|
-
var storageKey, isWarning, identity2, owesProtectionRecord, distinctProtectionWarnings, owedProtectionWarnings, store, oweProtectionWarnings, forgetProtectionWarnings;
|
|
105544
|
+
var storageKey, configuredStorage2, owedStorage, isWarning, identity2, owesProtectionRecord, distinctProtectionWarnings, owedProtectionWarnings, store, oweProtectionWarnings, forgetProtectionWarnings;
|
|
105328
105545
|
var init_owed_protection_warnings = __esm({
|
|
105329
105546
|
"lib/runtime/owed-protection-warnings.ts"() {
|
|
105330
105547
|
"use strict";
|
|
@@ -105334,6 +105551,8 @@ var init_owed_protection_warnings = __esm({
|
|
|
105334
105551
|
init_define_VTX_PI_MODEL_POLICY();
|
|
105335
105552
|
init_host_storage();
|
|
105336
105553
|
storageKey = (profileId) => `vtx:protection-warning-outbox:${String(profileId ?? "").trim()}`;
|
|
105554
|
+
configuredStorage2 = null;
|
|
105555
|
+
owedStorage = () => configuredStorage2 ?? runtimeHostStorage();
|
|
105337
105556
|
isWarning = (value) => {
|
|
105338
105557
|
const record6 = value;
|
|
105339
105558
|
return record6 != null && typeof record6 === "object" && typeof record6.symbol === "string" && typeof record6.action === "string" && typeof record6.status === "string" && (record6.order_id === null || typeof record6.order_id === "string") && record6.execution_metadata != null && typeof record6.execution_metadata === "object";
|
|
@@ -105351,7 +105570,7 @@ var init_owed_protection_warnings = __esm({
|
|
|
105351
105570
|
};
|
|
105352
105571
|
owedProtectionWarnings = (profileId) => {
|
|
105353
105572
|
try {
|
|
105354
|
-
const parsed = JSON.parse(
|
|
105573
|
+
const parsed = JSON.parse(owedStorage()?.getItem(storageKey(profileId)) ?? "[]");
|
|
105355
105574
|
return Array.isArray(parsed) ? parsed.filter(isWarning) : [];
|
|
105356
105575
|
} catch {
|
|
105357
105576
|
return [];
|
|
@@ -105359,7 +105578,7 @@ var init_owed_protection_warnings = __esm({
|
|
|
105359
105578
|
};
|
|
105360
105579
|
store = (profileId, warnings) => {
|
|
105361
105580
|
try {
|
|
105362
|
-
const storage3 =
|
|
105581
|
+
const storage3 = owedStorage();
|
|
105363
105582
|
if (warnings.length > 0) storage3?.setItem(storageKey(profileId), JSON.stringify(warnings));
|
|
105364
105583
|
else storage3?.removeItem(storageKey(profileId));
|
|
105365
105584
|
} catch {
|
|
@@ -116672,7 +116891,7 @@ var init_browser_observability = __esm({
|
|
|
116672
116891
|
init_define_VTX_GROK_POLICY();
|
|
116673
116892
|
init_define_VTX_PI_MODEL_POLICY();
|
|
116674
116893
|
init_runtime_policy_generated2();
|
|
116675
|
-
CLIENT_SOURCE_VERSION = typeof process !== "undefined" && true && "
|
|
116894
|
+
CLIENT_SOURCE_VERSION = typeof process !== "undefined" && true && "1fbd5d0b063d9c340fde67bbac63073001dc6b56".trim() && "1fbd5d0b063d9c340fde67bbac63073001dc6b56".trim() !== "unstamped" ? "1fbd5d0b063d9c340fde67bbac63073001dc6b56".trim() : null;
|
|
116676
116895
|
listenersInstalled = false;
|
|
116677
116896
|
state = {
|
|
116678
116897
|
loadedAtMs: Date.now(),
|
|
@@ -123661,6 +123880,122 @@ var init_native_provider_budget = __esm({
|
|
|
123661
123880
|
}
|
|
123662
123881
|
});
|
|
123663
123882
|
|
|
123883
|
+
// lib/runtime/provider-reply.ts
|
|
123884
|
+
var PROVIDER_LIMIT_HEADERS_HEADER, providerResponseSignals, replyBodies, rememberProviderReplyBody, readProviderPayload, rawProviderTextForDebug, extractProviderErrorDetail, extractProviderErrorWords, providerReplyHeaders, providerReplyDiagnostics;
|
|
123885
|
+
var init_provider_reply = __esm({
|
|
123886
|
+
"lib/runtime/provider-reply.ts"() {
|
|
123887
|
+
"use strict";
|
|
123888
|
+
init_define_VTX_CLAUDE_CODE_POLICY();
|
|
123889
|
+
init_define_VTX_EXO_POLICY();
|
|
123890
|
+
init_define_VTX_GROK_POLICY();
|
|
123891
|
+
init_define_VTX_PI_MODEL_POLICY();
|
|
123892
|
+
init_native_provider_budget();
|
|
123893
|
+
init_provider_credit();
|
|
123894
|
+
init_runtime_redaction();
|
|
123895
|
+
init_provider_observability();
|
|
123896
|
+
init_constants();
|
|
123897
|
+
PROVIDER_LIMIT_HEADERS_HEADER = "X-VTX-Provider-Limit-Headers";
|
|
123898
|
+
providerResponseSignals = /* @__PURE__ */ new WeakMap();
|
|
123899
|
+
replyBodies = /* @__PURE__ */ new WeakMap();
|
|
123900
|
+
rememberProviderReplyBody = (response, body) => {
|
|
123901
|
+
replyBodies.set(response, body);
|
|
123902
|
+
};
|
|
123903
|
+
readProviderPayload = async (response) => {
|
|
123904
|
+
if (typeof response?.text === "function") {
|
|
123905
|
+
const raw = await awaitProviderOperation(response.text(), providerResponseSignals.get(response));
|
|
123906
|
+
if (typeof raw === "string" && raw) replyBodies.set(response, raw);
|
|
123907
|
+
const normalizedRaw = typeof raw === "string" ? raw.trim() : "";
|
|
123908
|
+
if (!normalizedRaw) {
|
|
123909
|
+
return { payload: {}, rawText: "" };
|
|
123910
|
+
}
|
|
123911
|
+
try {
|
|
123912
|
+
return {
|
|
123913
|
+
payload: JSON.parse(normalizedRaw),
|
|
123914
|
+
rawText: normalizedRaw
|
|
123915
|
+
};
|
|
123916
|
+
} catch {
|
|
123917
|
+
return {
|
|
123918
|
+
payload: {},
|
|
123919
|
+
rawText: normalizedRaw
|
|
123920
|
+
};
|
|
123921
|
+
}
|
|
123922
|
+
}
|
|
123923
|
+
const payload = await awaitProviderOperation(response.json(), providerResponseSignals.get(response));
|
|
123924
|
+
return {
|
|
123925
|
+
payload,
|
|
123926
|
+
rawText: ""
|
|
123927
|
+
};
|
|
123928
|
+
};
|
|
123929
|
+
rawProviderTextForDebug = (payload, rawText) => {
|
|
123930
|
+
if (!rawText) {
|
|
123931
|
+
return null;
|
|
123932
|
+
}
|
|
123933
|
+
if (!payload || typeof payload === "object" && !Array.isArray(payload) && Object.keys(payload).length === 0) {
|
|
123934
|
+
return rawText;
|
|
123935
|
+
}
|
|
123936
|
+
return null;
|
|
123937
|
+
};
|
|
123938
|
+
extractProviderErrorDetail = (payload, rawText) => {
|
|
123939
|
+
const words7 = extractProviderErrorWords(payload, rawText);
|
|
123940
|
+
const outOfCreditCode = providerOutOfCreditErrorCode(payload);
|
|
123941
|
+
return outOfCreditCode && !words7.toLowerCase().includes(outOfCreditCode.toLowerCase()) ? `${words7}${words7 ? " " : ""}[${outOfCreditCode}]` : words7;
|
|
123942
|
+
};
|
|
123943
|
+
extractProviderErrorWords = (payload, rawText) => {
|
|
123944
|
+
const errorNode = payload?.error;
|
|
123945
|
+
if (typeof errorNode === "string" && errorNode.trim()) {
|
|
123946
|
+
return errorNode.trim();
|
|
123947
|
+
}
|
|
123948
|
+
if (typeof errorNode?.message === "string" && errorNode.message.trim()) {
|
|
123949
|
+
return errorNode.message.trim();
|
|
123950
|
+
}
|
|
123951
|
+
if (typeof errorNode?.detail === "string" && errorNode.detail.trim()) {
|
|
123952
|
+
return errorNode.detail.trim();
|
|
123953
|
+
}
|
|
123954
|
+
if (typeof payload?.detail === "string" && payload.detail.trim()) {
|
|
123955
|
+
return payload.detail.trim();
|
|
123956
|
+
}
|
|
123957
|
+
if (typeof payload?.message === "string" && payload.message.trim()) {
|
|
123958
|
+
return payload.message.trim();
|
|
123959
|
+
}
|
|
123960
|
+
if (rawText) {
|
|
123961
|
+
return sanitizeRuntimeDiagnosticValue(rawText).replace(/\s+/g, " ").slice(0, PROVIDER_ERROR_RAW_TEXT_MAX_CHARS);
|
|
123962
|
+
}
|
|
123963
|
+
return "";
|
|
123964
|
+
};
|
|
123965
|
+
providerReplyHeaders = (response) => {
|
|
123966
|
+
const headers = {};
|
|
123967
|
+
const read = response?.headers;
|
|
123968
|
+
if (!read || typeof read.forEach !== "function") return headers;
|
|
123969
|
+
try {
|
|
123970
|
+
const relayed = JSON.parse(read.get(PROVIDER_LIMIT_HEADERS_HEADER) || "{}");
|
|
123971
|
+
if (relayed && typeof relayed === "object" && !Array.isArray(relayed)) {
|
|
123972
|
+
for (const [name, value] of Object.entries(relayed)) {
|
|
123973
|
+
if (typeof value === "string" && isProviderReplyHeaderName(name)) headers[name.toLowerCase()] = value;
|
|
123974
|
+
}
|
|
123975
|
+
}
|
|
123976
|
+
} catch {
|
|
123977
|
+
}
|
|
123978
|
+
read.forEach((value, name) => {
|
|
123979
|
+
if (isProviderReplyHeaderName(name)) headers[name.toLowerCase()] = value;
|
|
123980
|
+
});
|
|
123981
|
+
return headers;
|
|
123982
|
+
};
|
|
123983
|
+
providerReplyDiagnostics = (response, body) => {
|
|
123984
|
+
if (!response) return {};
|
|
123985
|
+
const text2 = typeof body === "string" && body ? body : replyBodies.get(response);
|
|
123986
|
+
const headers = providerReplyHeaders(response);
|
|
123987
|
+
if (!text2 && !Object.keys(headers).length) return {};
|
|
123988
|
+
return {
|
|
123989
|
+
provider_reply: {
|
|
123990
|
+
...typeof response.status === "number" ? { status: response.status } : {},
|
|
123991
|
+
...text2 ? { body: text2 } : {},
|
|
123992
|
+
...Object.keys(headers).length ? { headers } : {}
|
|
123993
|
+
}
|
|
123994
|
+
};
|
|
123995
|
+
};
|
|
123996
|
+
}
|
|
123997
|
+
});
|
|
123998
|
+
|
|
123664
123999
|
// lib/screener-resource-scheduler.ts
|
|
123665
124000
|
var STORAGE_KEY, CHANNEL_NAME, LOCK_TTL_MS, nowMs, stableHash, storage2, readStore, writeStore, prune2, buildLlmResourceKey, registerTraderProviderCallStarted, registerTraderProviderCallFinished;
|
|
123666
124001
|
var init_screener_resource_scheduler = __esm({
|
|
@@ -123927,7 +124262,7 @@ var init_native_request_parameters = __esm({
|
|
|
123927
124262
|
});
|
|
123928
124263
|
|
|
123929
124264
|
// lib/runtime/provider-client.ts
|
|
123930
|
-
var mapOpenAiCompatibleNativeRequestPath, isRetryableProviderFailureForFallback, extractRuntimeProviderFailureStatusCode, isModelSpecificProviderFailure, emptyProviderContentError, isEmptyProviderContentFailure, emptyReplyForInternalAttempt, isEmptyProviderMessageFailure, isRetryableProviderAttemptFailure, providerRejectedRequestError, OPTIONAL_CONTRACT_PARAMETER_TOKENS, OPTIONAL_CONTRACT_REJECTION_TOKENS, OPTIONAL_CONTRACT_GRAMMAR_TOKENS, isOptionalContractParameterRejection, isTemperatureRefusal, PROVIDER_ROUTE_REFUSAL_PHRASE, isProviderRouteRefusal, OPTIONAL_CONTRACT_REQUEST_KEYS, OPTIONAL_CONTRACT_EXTRA_BODY_KEYS, resolveEmptyContentRetryPolicy, resolveStreamRetryPolicy, isKeySpecificOrTransientProviderFailure, providerDispatchClockMs, beginProviderDispatch, providerDispatchLatencyMs, attachProviderDispatchFailure, attachProviderFailureTrace, toRuntimeExecutionMode, buildNoneReasoningPayload, normalizeLevelValue, buildRuntimeReasoningPayload, resolveProviderReasoningParameters, requestedReasoningParameters, usesReasoningCompletionTokens, shouldRequestReasoningTrace, runtimeProviderForByokProvider, findByokProviderForRuntime, findModelOption, findNativeRequestParametersForModel, modelHasNativeRequestApiSurface, asRequestRecord, setDottedRequestValue, normalizeProviderMaxTokens, applyRuntimeRequestContract, normalizeProvider2, requireProviderEndpoint, SSE_DATA_FIELD_PREFIX2, estimateTokenCount, normalizeUsageCount, buildOpenAiUsagePayload, buildAnthropicUsagePayload, buildGoogleUsagePayload, normalizeProviderUsageMetrics,
|
|
124265
|
+
var mapOpenAiCompatibleNativeRequestPath, isRetryableProviderFailureForFallback, extractRuntimeProviderFailureStatusCode, isModelSpecificProviderFailure, emptyProviderContentError, isEmptyProviderContentFailure, emptyReplyForInternalAttempt, isEmptyProviderMessageFailure, isRetryableProviderAttemptFailure, providerRejectedRequestError, OPTIONAL_CONTRACT_PARAMETER_TOKENS, OPTIONAL_CONTRACT_REJECTION_TOKENS, OPTIONAL_CONTRACT_GRAMMAR_TOKENS, isOptionalContractParameterRejection, isTemperatureRefusal, PROVIDER_ROUTE_REFUSAL_PHRASE, isProviderRouteRefusal, OPTIONAL_CONTRACT_REQUEST_KEYS, OPTIONAL_CONTRACT_EXTRA_BODY_KEYS, resolveEmptyContentRetryPolicy, resolveStreamRetryPolicy, isKeySpecificOrTransientProviderFailure, providerDispatchClockMs, beginProviderDispatch, providerDispatchLatencyMs, attachProviderDispatchFailure, attachProviderFailureTrace, toRuntimeExecutionMode, buildNoneReasoningPayload, normalizeLevelValue, buildRuntimeReasoningPayload, resolveProviderReasoningParameters, requestedReasoningParameters, usesReasoningCompletionTokens, shouldRequestReasoningTrace, runtimeProviderForByokProvider, findByokProviderForRuntime, findModelOption, findNativeRequestParametersForModel, modelHasNativeRequestApiSurface, asRequestRecord, setDottedRequestValue, normalizeProviderMaxTokens, applyRuntimeRequestContract, normalizeProvider2, requireProviderEndpoint, SSE_DATA_FIELD_PREFIX2, estimateTokenCount, normalizeUsageCount, buildOpenAiUsagePayload, buildAnthropicUsagePayload, buildGoogleUsagePayload, normalizeProviderUsageMetrics, fetchProvider, emitRuntimeDelta, readProviderTextStream, readProviderJsonEventStream, providerStreamError, extractOpenAiCompatibleDeltaText, readOpenAiCompatibleTextStream, buildProviderFailureDiagnostic, buildCanonicalProviderFailureMessage, providerRefusal, toProviderNetworkDebugError, REASONING_ONLY_CONTENT_TYPES, extractOpenAiContentPartText, extractOpenAiReasoningPartText, extractOpenAiMessageContent, extractOpenAiMessageReasoningContent, extractOpenAiCompatibleText, normalizeRuntimeChatHistory, calculateProviderCost, resolveVeniceRequestContract, callOpenAiCompatible, extractOpenAiResponsesText, extractOpenAiResponsesReasoning, readOpenAiResponsesStream, internalDispatchAttempt, callOpenAiResponses, extractAnthropicMessageText, extractAnthropicReasoningContent, readAnthropicMessageStream, callAnthropic, isAqGoogleKey, googleKeySurfaceRef, resolveGoogleKeySurface, googlePublicModelIdRegexes, shouldUseGooglePublicEndpointForModel, normalizeGoogleModelId, shouldRetryGoogleVertexRequestPublicly, GOOGLE_VERTEX_PUBLIC_RETRY_NOTE, buildGoogleRequest, GOOGLE_JSON_MODE_REFUSAL_PHRASES, googleTradeResponseMimeType, providerRequestFailure, isGoogleJsonModeRefusal, isGoogleReasoningPart, extractGoogleMessageText, extractGoogleReasoningContent, extractGoogleSafetyMetadata, GOOGLE_BLOCKED_FINISH_REASONS, googleProviderBlockReason, readGoogleGenerateStream, callGoogle, resolveRuntimeProvider, defaultInvocationContext, defaultProviderTransport, invocationFailureCode, buildBrowserInvocation, resolveProviderSecretKey, resolveNativeProviderCredentialSlots, resolveProviderSecretKeySlots, requireOpenAiCompatibleRuntimeBaseUrl, runtimeSubscriptionPlan, runtimeKeySlotSupportsModel, invokeRuntimeProviderAttempt, invokeRuntimeProvider;
|
|
123931
124266
|
var init_provider_client = __esm({
|
|
123932
124267
|
"lib/runtime/provider-client.ts"() {
|
|
123933
124268
|
"use strict";
|
|
@@ -123938,6 +124273,7 @@ var init_provider_client = __esm({
|
|
|
123938
124273
|
init_google_egress();
|
|
123939
124274
|
init_native_provider_budget();
|
|
123940
124275
|
init_retired_model_source();
|
|
124276
|
+
init_provider_reply();
|
|
123941
124277
|
init_provider_observability();
|
|
123942
124278
|
init_api2();
|
|
123943
124279
|
init_network_debug();
|
|
@@ -124085,7 +124421,8 @@ var init_provider_client = __esm({
|
|
|
124085
124421
|
sanitizedError.runtimeProviderRequestId = providerRequestId(response);
|
|
124086
124422
|
sanitizedError.runtimeProviderDiagnostics = {
|
|
124087
124423
|
...marker2?.providerDiagnostics ?? {},
|
|
124088
|
-
...error48 instanceof NativeModelTimeoutError && error48.attemptCapExpired ? { timeout_bound: "attempt_cap" } : {}
|
|
124424
|
+
...error48 instanceof NativeModelTimeoutError && error48.attemptCapExpired ? { timeout_bound: "attempt_cap" } : {},
|
|
124425
|
+
...providerReplyDiagnostics(response, error48?.runtimeProviderReplyBody)
|
|
124089
124426
|
};
|
|
124090
124427
|
sanitizedError.runtimeRetryAfterSeconds = retryAfterDiagnostics(response).retry_after_seconds ?? null;
|
|
124091
124428
|
if (marker2?.googleQuotaFailure) sanitizedError.runtimeGoogleQuotaFailure = true;
|
|
@@ -124570,38 +124907,12 @@ var init_provider_client = __esm({
|
|
|
124570
124907
|
completionTokens: usage.completionTokens,
|
|
124571
124908
|
totalTokens: usage.totalTokens
|
|
124572
124909
|
});
|
|
124573
|
-
providerResponseSignals = /* @__PURE__ */ new WeakMap();
|
|
124574
124910
|
fetchProvider = async (url2, init2) => {
|
|
124575
124911
|
if (init2.signal?.aborted) throw init2.signal.reason ?? new DOMException("Cancelled", "AbortError");
|
|
124576
124912
|
const response = await awaitProviderOperation(startLongRequest(() => fetch(url2, init2)), init2.signal);
|
|
124577
124913
|
if (init2.signal) providerResponseSignals.set(response, init2.signal);
|
|
124578
124914
|
return response;
|
|
124579
124915
|
};
|
|
124580
|
-
readProviderPayload = async (response) => {
|
|
124581
|
-
if (typeof response?.text === "function") {
|
|
124582
|
-
const raw = await awaitProviderOperation(response.text(), providerResponseSignals.get(response));
|
|
124583
|
-
const normalizedRaw = typeof raw === "string" ? raw.trim() : "";
|
|
124584
|
-
if (!normalizedRaw) {
|
|
124585
|
-
return { payload: {}, rawText: "" };
|
|
124586
|
-
}
|
|
124587
|
-
try {
|
|
124588
|
-
return {
|
|
124589
|
-
payload: JSON.parse(normalizedRaw),
|
|
124590
|
-
rawText: normalizedRaw
|
|
124591
|
-
};
|
|
124592
|
-
} catch {
|
|
124593
|
-
return {
|
|
124594
|
-
payload: {},
|
|
124595
|
-
rawText: normalizedRaw
|
|
124596
|
-
};
|
|
124597
|
-
}
|
|
124598
|
-
}
|
|
124599
|
-
const payload = await awaitProviderOperation(response.json(), providerResponseSignals.get(response));
|
|
124600
|
-
return {
|
|
124601
|
-
payload,
|
|
124602
|
-
rawText: ""
|
|
124603
|
-
};
|
|
124604
|
-
};
|
|
124605
124916
|
emitRuntimeDelta = (onDelta, value) => {
|
|
124606
124917
|
if (typeof onDelta !== "function" || typeof value !== "string" || !value) {
|
|
124607
124918
|
return;
|
|
@@ -124655,10 +124966,10 @@ var init_provider_client = __esm({
|
|
|
124655
124966
|
}
|
|
124656
124967
|
onData(payload);
|
|
124657
124968
|
});
|
|
124658
|
-
providerStreamError = (payload, fallback) => {
|
|
124969
|
+
providerStreamError = (payload, fallback, event = payload) => {
|
|
124659
124970
|
const detail = extractProviderErrorDetail(payload, "") || fallback;
|
|
124660
124971
|
const diagnostic = sanitizeRuntimeDiagnosticValue(`Provider request failed: ${detail}`);
|
|
124661
|
-
return providerRejectedRequestError(diagnostic, detail, diagnostic);
|
|
124972
|
+
return Object.assign(providerRejectedRequestError(diagnostic, detail, diagnostic), { runtimeProviderReplyBody: JSON.stringify(event) });
|
|
124662
124973
|
};
|
|
124663
124974
|
extractOpenAiCompatibleDeltaText = (payload) => {
|
|
124664
124975
|
const choice = Array.isArray(payload?.choices) ? payload.choices[0] : null;
|
|
@@ -124707,6 +125018,7 @@ var init_provider_client = __esm({
|
|
|
124707
125018
|
} catch {
|
|
124708
125019
|
return;
|
|
124709
125020
|
}
|
|
125021
|
+
if (payload?.error) rememberProviderReplyBody(response, dataText);
|
|
124710
125022
|
onPayload?.(payload);
|
|
124711
125023
|
lastPayload = payload;
|
|
124712
125024
|
if (typeof payload?.model === "string") {
|
|
@@ -124760,42 +125072,6 @@ var init_provider_client = __esm({
|
|
|
124760
125072
|
}
|
|
124761
125073
|
};
|
|
124762
125074
|
};
|
|
124763
|
-
rawProviderTextForDebug = (payload, rawText) => {
|
|
124764
|
-
if (!rawText) {
|
|
124765
|
-
return null;
|
|
124766
|
-
}
|
|
124767
|
-
if (!payload || typeof payload === "object" && !Array.isArray(payload) && Object.keys(payload).length === 0) {
|
|
124768
|
-
return rawText;
|
|
124769
|
-
}
|
|
124770
|
-
return null;
|
|
124771
|
-
};
|
|
124772
|
-
extractProviderErrorDetail = (payload, rawText) => {
|
|
124773
|
-
const words7 = extractProviderErrorWords(payload, rawText);
|
|
124774
|
-
const outOfCreditCode = providerOutOfCreditErrorCode(payload);
|
|
124775
|
-
return outOfCreditCode && !words7.toLowerCase().includes(outOfCreditCode.toLowerCase()) ? `${words7}${words7 ? " " : ""}[${outOfCreditCode}]` : words7;
|
|
124776
|
-
};
|
|
124777
|
-
extractProviderErrorWords = (payload, rawText) => {
|
|
124778
|
-
const errorNode = payload?.error;
|
|
124779
|
-
if (typeof errorNode === "string" && errorNode.trim()) {
|
|
124780
|
-
return errorNode.trim();
|
|
124781
|
-
}
|
|
124782
|
-
if (typeof errorNode?.message === "string" && errorNode.message.trim()) {
|
|
124783
|
-
return errorNode.message.trim();
|
|
124784
|
-
}
|
|
124785
|
-
if (typeof errorNode?.detail === "string" && errorNode.detail.trim()) {
|
|
124786
|
-
return errorNode.detail.trim();
|
|
124787
|
-
}
|
|
124788
|
-
if (typeof payload?.detail === "string" && payload.detail.trim()) {
|
|
124789
|
-
return payload.detail.trim();
|
|
124790
|
-
}
|
|
124791
|
-
if (typeof payload?.message === "string" && payload.message.trim()) {
|
|
124792
|
-
return payload.message.trim();
|
|
124793
|
-
}
|
|
124794
|
-
if (rawText) {
|
|
124795
|
-
return sanitizeRuntimeDiagnosticValue(rawText).replace(/\s+/g, " ").slice(0, PROVIDER_ERROR_RAW_TEXT_MAX_CHARS);
|
|
124796
|
-
}
|
|
124797
|
-
return "";
|
|
124798
|
-
};
|
|
124799
125075
|
buildProviderFailureDiagnostic = ({ response, detail }) => {
|
|
124800
125076
|
const statusLabel = response.status ? ` (HTTP ${response.status}${response.statusText ? ` ${response.statusText}` : ""})` : "";
|
|
124801
125077
|
return sanitizeRuntimeDiagnosticValue(
|
|
@@ -125382,9 +125658,9 @@ var init_provider_client = __esm({
|
|
|
125382
125658
|
} else if (type === "response.completed" || type === "response.incomplete") {
|
|
125383
125659
|
completed = event.response ?? null;
|
|
125384
125660
|
} else if (type === "response.failed") {
|
|
125385
|
-
failure2 ??= providerStreamError(event.response, "OpenAI Responses stream failed");
|
|
125661
|
+
failure2 ??= providerStreamError(event.response, "OpenAI Responses stream failed", event);
|
|
125386
125662
|
} else if (type === "error") {
|
|
125387
|
-
failure2 ??= providerStreamError({ error: event }, "OpenAI Responses stream failed");
|
|
125663
|
+
failure2 ??= providerStreamError({ error: event }, "OpenAI Responses stream failed", event);
|
|
125388
125664
|
}
|
|
125389
125665
|
});
|
|
125390
125666
|
if (failure2) throw failure2;
|
|
@@ -125397,7 +125673,7 @@ var init_provider_client = __esm({
|
|
|
125397
125673
|
latencyMs: providerDispatchLatencyMs(marker2),
|
|
125398
125674
|
transport,
|
|
125399
125675
|
requestInputTokens: marker2.requestInputTokens,
|
|
125400
|
-
providerDiagnostics: marker2.providerDiagnostics,
|
|
125676
|
+
providerDiagnostics: { ...marker2.providerDiagnostics, ...providerReplyDiagnostics(response) },
|
|
125401
125677
|
providerRequestId: providerRequestId(response),
|
|
125402
125678
|
errorDetail: getSanitizedRuntimeErrorMessage(error48) || "Provider compatibility dispatch failed.",
|
|
125403
125679
|
// An empty reply is an unknown outcome with no status.
|
|
@@ -126032,7 +126308,7 @@ var init_provider_client = __esm({
|
|
|
126032
126308
|
latencyMs: providerDispatchLatencyMs(marker2),
|
|
126033
126309
|
transport: "google_generate_content_rest",
|
|
126034
126310
|
requestInputTokens: marker2.requestInputTokens,
|
|
126035
|
-
providerDiagnostics: { ...credentialDiagnostics, ...await extractProviderDiagnostics(payloadJson, answered) },
|
|
126311
|
+
providerDiagnostics: { ...credentialDiagnostics, ...await extractProviderDiagnostics(payloadJson, answered), ...providerReplyDiagnostics(answered) },
|
|
126036
126312
|
providerRequestId: providerRequestId(answered),
|
|
126037
126313
|
errorDetail,
|
|
126038
126314
|
statusCode: answered.status,
|
|
@@ -129477,9 +129753,9 @@ var init_local_analysis = __esm({
|
|
|
129477
129753
|
RUNTIME_SOURCE_DEFINITION_VERSION = "runtime-source-v1";
|
|
129478
129754
|
DECISION_INPUT_DEFINITION_VERSION = "decision-input-v1";
|
|
129479
129755
|
CONTEXT_ENVELOPE_DEFINITION_VERSION = "context-envelope-v2.1";
|
|
129480
|
-
CLIENT_RUNTIME_SOURCE_VERSION = typeof process !== "undefined" && true && "
|
|
129481
|
-
"
|
|
129482
|
-
) ? "
|
|
129756
|
+
CLIENT_RUNTIME_SOURCE_VERSION = typeof process !== "undefined" && true && "1fbd5d0b063d9c340fde67bbac63073001dc6b56".trim() && !["unknown", "unstamped", "development"].includes(
|
|
129757
|
+
"1fbd5d0b063d9c340fde67bbac63073001dc6b56".trim().toLowerCase()
|
|
129758
|
+
) ? "1fbd5d0b063d9c340fde67bbac63073001dc6b56".trim() : null;
|
|
129483
129759
|
CLIENT_MAIN_PROMPT_RENDERER = "client_runtime.buildLocalRuntimePromptArtifacts:v1";
|
|
129484
129760
|
CLIENT_REVIEW_PROMPT_RENDERER = "client_runtime.review_prompt_assembly:v1";
|
|
129485
129761
|
resolveEffectivePromptRuntimeProvenance = (input) => ({
|