feat: restore parallel ops and diagnostics changes

This commit is contained in:
Codex
2026-07-14 06:40:02 +02:00
parent fcc5227cc1
commit a91238c200
22 changed files with 2039 additions and 63 deletions
@@ -398,8 +398,10 @@ export function renderTraceReport(
const failovers = recordArray(parsed.failovers);
const selectFailures = recordArray(parsed.selectFailures);
const upstreamErrors = recordArray(parsed.upstreamErrors);
const forwardFailures = recordArray(parsed.forwardFailures);
const tempUnschedulable = recordArray(parsed.tempUnschedulable);
const windowStats = isRecord(parsed.windowStats) ? parsed.windowStats : {};
const logs = isRecord(parsed.logs) ? parsed.logs : {};
const accountSnapshot = recordArray(parsed.accountSnapshot);
const lines: string[] = [];
lines.push([
@@ -409,6 +411,17 @@ export function renderTraceReport(
`outcome=${stringValue(summary.outcome) ?? "-"}`,
`reason=${stringValue(summary.reason) ?? "-"}`,
].join(" "));
lines.push([
"SOURCE",
`target=${textValue(parsed.targetId)}`,
`runtime=${textValue(parsed.runtimeMode)}`,
`logs=${textValue(logs.source)}`,
`context=${textValue(logs.contextSource)}`,
`exit=${textValue(logs.exitCode)}`,
].join(" "));
if (parsed.ok !== true && stringValue(logs.stderrTail) !== null) {
lines.push(`LOG ERROR ${shorten(stringValue(logs.stderrTail) ?? "", 240)}`);
}
lines.push([
"REQUEST",
`path=${request.path ?? final.path ?? "-"}`,
@@ -452,6 +465,19 @@ export function renderTraceReport(
]),
]));
}
if (forwardFailures.length > 0) {
lines.push("");
lines.push("FORWARD-FAILED");
lines.push(renderTable([
["AT", "ACCOUNT", "STATUS", "ERROR"],
...forwardFailures.map((item) => [
shortIso(item.at),
formatAccountRef(item),
textValue(item.statusCode),
shorten(stringValue(item.error) ?? "-", 72),
]),
]));
}
if (upstreamErrors.length > 0 || tempUnschedulable.length > 0) {
lines.push("");
lines.push("ACCOUNT SIGNALS");
@@ -482,13 +508,14 @@ export function renderTraceReport(
lines.push("");
lines.push("WINDOW STATS");
lines.push(renderTable([
["MATCH", "EVENTS", "FINAL_4XX_5XX", "FAILOVER", "SELECT_FAIL", "TEMP_UNSCHED", "ADMIN_SCHED"],
["MATCH", "EVENTS", "FINAL_4XX_5XX", "FAILOVER", "SELECT_FAIL", "FORWARD_FAIL", "TEMP_UNSCHED", "ADMIN_SCHED"],
[
textValue(windowStats.matchedLines),
textValue(windowStats.eventCount),
textValue(windowStats.finalErrorCount),
textValue(windowStats.failoverCount),
textValue(windowStats.selectFailedCount),
textValue(windowStats.forwardFailedCount),
textValue(windowStats.tempUnschedulableCount),
textValue(windowStats.adminSchedulableCount),
],