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) {
|
||||
|
||||
@@ -1100,7 +1100,15 @@ console.log(JSON.stringify({
|
||||
pagePerformance: pagePerformance.summary,
|
||||
promptNetwork: promptNetwork.summary,
|
||||
runtimeAlerts: runtimeAlerts.summary,
|
||||
domDiagnosticGroups: runtimeAlerts.domDiagnosticsByFingerprint.slice(0, 5).map((item) => ({ count: item.count, firstAt: item.firstAt, lastAt: item.lastAt, text: String(item.text ?? "").slice(0, 160) })),
|
||||
domDiagnosticGroups: runtimeAlerts.domDiagnosticsByFingerprint.slice(0, 5).map((item) => ({
|
||||
diagnosticCode: item.diagnosticCode ?? null,
|
||||
count: item.count,
|
||||
firstAt: item.firstAt,
|
||||
lastAt: item.lastAt,
|
||||
promptIndexes: Array.isArray(item.promptIndexes) ? item.promptIndexes.slice(0, 6) : [],
|
||||
traceIds: Array.isArray(item.traceIds) ? item.traceIds.slice(0, 4) : [],
|
||||
text: String(item.preview ?? item.normalizedPreview ?? item.text ?? "").slice(0, 160),
|
||||
})),
|
||||
pagePerformanceSlowApi: pagePerformance.sameOriginApiByPath.filter((item) => item.overFiveSecondCount > 0).slice(0, 5).map((item) => ({ path: item.path, route: item.route, sampleCount: item.sampleCount, p95Ms: item.p95Ms, maxMs: item.maxMs, overFiveSecondCount: item.overFiveSecondCount })),
|
||||
findings: findings.slice(0, 8).map((item) => ({ kind: item.id ?? item.kind ?? item.code, severity: item.severity, count: item.count ?? item.sampleCount ?? null, summary: String(item.summary ?? item.message ?? "").slice(0, 180) })),
|
||||
valuesRedacted: true,
|
||||
|
||||
Reference in New Issue
Block a user