fix(web-probe): expose exact command artifacts

This commit is contained in:
Codex
2026-07-10 12:06:31 +02:00
parent 70bf798d46
commit 3a26e77e25
4 changed files with 226 additions and 5 deletions
+18 -1
View File
@@ -37,6 +37,10 @@ function renderWebObserveStatusTable(value: Record<string, unknown>): string {
const heartbeat = record(observer?.heartbeat);
const diagnostics = record(observer?.diagnostics) ?? record(value.diagnostics);
const commands = record(observer?.commands);
const exactCommand = record(observer?.exactCommand);
const exactResult = record(exactCommand?.result);
const exactError = record(exactCommand?.error);
const exactErrorDetails = record(exactError?.details);
const tails = record(observer?.tails);
const result = record(value.result);
const samples = Array.isArray(tails?.samples) ? tails.samples.map(record).filter((item): item is Record<string, unknown> => item !== null).slice(-5) : [];
@@ -158,6 +162,19 @@ function renderWebObserveStatusTable(value: Record<string, unknown>): string {
]]),
"",
] : []),
...(Object.keys(exactCommand).length > 0 ? [
"Exact command:",
webObserveTable(["COMMAND", "TYPE", "PHASE", "OK", "STATUS", "REPORT_SHA", "DETAIL"], [[
webObserveShort(webObserveText(exactCommand.commandId), 40),
exactCommand.type,
exactCommand.phase,
exactCommand.ok,
exactResult.status,
webObserveShort(webObserveText(exactResult.reportSha256 ?? exactErrorDetails.reportSha256), 32),
webObserveShort(webObserveText(exactError.message ?? exactResult.reportPath ?? exactErrorDetails.reportPath), 96),
]]),
"",
] : []),
"Recent samples:",
webObserveTable(["SEQ", "TS", "PATH", "ROUTE_SESSION", "ACTIVE_SESSION", "MSG", "TRACE"], samples.length > 0 ? samples.map((sample) => [
sample.seq,
@@ -255,7 +272,7 @@ function renderWebObserveCommandTable(value: Record<string, unknown>): string {
] : []),
"",
"Next:",
` bun scripts/cli.ts web-probe observe status ${id}`,
` bun scripts/cli.ts web-probe observe status ${id} --command-id ${webObserveText(value.commandId)}`,
` bun scripts/cli.ts web-probe observe analyze ${id}`,
` bun scripts/cli.ts web-probe observe collect ${id} --view turn-summary --command-id ${webObserveText(value.commandId)}`,
"",