Fix branch follower performance status visibility

This commit is contained in:
Codex
2026-07-04 13:07:34 +00:00
parent 3d52db184c
commit c3e97e2745
4 changed files with 388 additions and 314 deletions
+15
View File
@@ -110,6 +110,7 @@ function renderStatusHuman(payload: Record<string, unknown>, _options: ParsedOpt
const next = asOptionalRecord(payload.next);
const errors = Array.isArray(payload.errors) ? payload.errors : [];
const timingRows = followers.flatMap(timingRowsForFollower).slice(0, 48);
const performanceRows = followers.flatMap(performanceRowsForFollower).slice(0, 24);
const evidenceRows = followers.flatMap(evidenceRowsForFollower).slice(0, 48);
const reconcileRows = followers.flatMap(reconcileRowsForFollower).slice(0, 48);
const rawStateRows = followers.flatMap(rawStateRowsForFollower).slice(0, 24);
@@ -123,6 +124,7 @@ function renderStatusHuman(payload: Record<string, unknown>, _options: ParsedOpt
"",
table(["FOLLOWER", "PHASE", "ADAPTER", "OBSERVED", "TARGET", "TRIGGERED", "SUCCEEDED", "IN_FLIGHT", "BUDGET", "MESSAGE"], rows),
timingRows.length === 0 ? "" : `\nSTAGE TIMINGS\n${table(["FOLLOWER", "STAGE", "STATUS", "SECONDS", "BUDGET", "OBJECT"], timingRows)}`,
performanceRows.length === 0 ? "" : `\nSLOW STAGES\n${table(["FOLLOWER", "STAGE", "STATUS", "SECONDS", "SOURCE", "OBJECT"], performanceRows)}`,
evidenceRows.length === 0 ? "" : `\nEVIDENCE\n${table(["FOLLOWER", "TYPE", "STATUS", "DETAIL", "OBJECT"], evidenceRows)}`,
reconcileRows.length === 0 ? "" : `\nRECONCILE TIMELINE\n${table(["FOLLOWER", "STEP", "STATUS", "SECONDS", "STARTED", "OBJECT"], reconcileRows)}`,
rawStateRows.length === 0 ? "" : `\nRAW STATE DIAGNOSTIC\n${table(["FOLLOWER", "STATE_BYTES", "COMMAND", "TIMELINE", "STEPS", "TIMELINE_BYTES", "REASON"], rawStateRows)}`,
@@ -231,6 +233,19 @@ function timingRowsForFollower(item: Record<string, unknown>): unknown[][] {
return rows;
}
function performanceRowsForFollower(item: Record<string, unknown>): unknown[][] {
const performance = asOptionalRecord(item.performance);
if (performance === null) return [];
return arrayRecords(performance.slowStages).map((stage) => [
item.id,
stage.stage ?? "-",
stage.status ?? "-",
formatSeconds(numberOrNull(stage.seconds)),
stringOrNull(stage.source) ?? "-",
stringOrNull(stage.object) ?? "-",
]);
}
function reconcileRowsFromRunOnce(payload: Record<string, unknown>, followers: Record<string, unknown>[]): unknown[][] {
const timeline = asOptionalRecord(payload.reconcileTimeline);
if (timeline !== null) return reconcileRowsForTimeline(timeline, null);