fix: expose web-probe diagnostic previews (#623)

Co-authored-by: Codex <codex@noreply.local>
This commit is contained in:
Lyon
2026-06-22 02:44:34 +08:00
committed by GitHub
parent 3ebf23dc07
commit b1ae0b6408
2 changed files with 18 additions and 4 deletions
+9 -3
View File
@@ -7075,7 +7075,7 @@ function runNodeWebProbeObserveStatus(options: NodeWebProbeObserveOptions, spec:
observer: withWebObserveShortcuts(status, observerId),
index,
next: observerId === null ? null : webObserveNextCommands(observerId),
result: compactCommandResult(result),
result: compactCommandResultWithStdoutTail(result),
valuesRedacted: true,
});
}
@@ -7308,7 +7308,7 @@ function runNodeWebProbeObserveCollect(options: NodeWebProbeObserveOptions, spec
lane: options.lane,
workspace: spec.workspace,
collect,
result: compactCommandResult(result),
result: compactCommandResultWithStdoutTail(result),
valuesRedacted: true,
};
}
@@ -11268,12 +11268,18 @@ function compactCommandResult(result: CommandResult): Record<string, unknown> {
command: compactCommand(result.command),
exitCode: result.exitCode,
stdoutBytes: result.stdout.length,
stdoutTail: result.stdout.trim().slice(-2000),
stdoutTail: result.exitCode === 0 && !result.timedOut ? "" : result.stdout.trim().slice(-2000),
stderr: result.exitCode === 0 ? "" : result.stderr.trim().slice(0, 2000),
timedOut: result.timedOut,
};
}
function compactCommandResultWithStdoutTail(result: CommandResult): Record<string, unknown> {
const compact = compactCommandResult(result);
compact.stdoutTail = result.stdout.trim().slice(-2000);
return compact;
}
function compactCommandResultRedacted(result: CommandResult, secrets: string[]): Record<string, unknown> {
const compact = compactCommandResult(result);
if (typeof compact.stderr === "string" && compact.stderr.length > 0) {