fix: expose web-probe diagnostic previews (#623)
Co-authored-by: Codex <codex@noreply.local>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user