fix(mcplocal): bounded, legible MCP failures — no request can hang forever #127

Merged
michal merged 9 commits from fix/bounded-mcp-failures into main 2026-08-25 23:03:51 +00:00
Showing only changes of commit 14eb2623bc - Show all commits

View File

@@ -144,9 +144,14 @@ export function createTraceCommand(deps?: Partial<TraceCommandDeps>): Command {
if (degraded !== null) degradedCount++; if (degraded !== null) degradedCount++;
if (err !== null) errorCount++; if (err !== null) errorCount++;
const ms = num(e.payload['durationMs']) ?? num(e.payload['totalDurationMs']); // Only real steps compete for "slowest" — tool_call_trace and
const label = str(e.payload['stage']) ?? e.eventKind; // pipeline_execution are aggregates OF those steps, so including them
if (ms !== null && (slowest === null || ms > slowest.ms)) slowest = { name: label, ms }; // would always name the total and tell you nothing.
const ms = num(e.payload['durationMs']);
const label = str(e.payload['stage']);
if (ms !== null && label !== null && (slowest === null || ms > slowest.ms)) {
slowest = { name: label, ms };
}
const marks = [ const marks = [
degraded !== null ? `${degraded}` : null, degraded !== null ? `${degraded}` : null,