fix: keep full-window slow api details visible (#652)

Co-authored-by: Codex <codex@noreply.local>
This commit is contained in:
Lyon
2026-06-22 14:03:33 +08:00
committed by GitHub
parent 9924212bd9
commit e2ff85eb6f
+12 -3
View File
@@ -7646,7 +7646,7 @@ function runNodeWebProbeObserveAnalyze(options: NodeWebProbeObserveOptions, spec
"const srcPagePerformanceSummary = objectOrNull(srcPagePerformance?.summary);",
"const pagePerformance = srcPagePerformance ? { sameOriginApiPaths: srcPagePerformance.sameOriginApiPaths ?? srcPagePerformanceSummary?.sameOriginApiPathCount ?? null, slowPathCount: srcPagePerformance.slowPathCount ?? srcPagePerformanceSummary?.slowPathCount ?? null, slowSampleCount: srcPagePerformance.slowSampleCount ?? srcPagePerformanceSummary?.slowSampleCount ?? null, worstP95Ms: srcPagePerformance.worstP95Ms ?? srcPagePerformanceSummary?.worstP95Ms ?? null } : null;",
"const fullRecentWindow = objectOrNull(fullSource?.windows?.recent);",
"const fullPagePerformance = objectOrNull(fullRecentWindow?.pagePerformance) || objectOrNull(fullSource?.pagePerformance);",
"const fullPagePerformance = objectOrNull(fullSource?.pagePerformance) || objectOrNull(fullRecentWindow?.pagePerformance);",
"const sourceSlowApi = Array.isArray(source?.pagePerformanceSlowApi) && source.pagePerformanceSlowApi.some((item) => Array.isArray(item?.slowSamples) && item.slowSamples.length > 0) ? source.pagePerformanceSlowApi : (Array.isArray(fullPagePerformance?.sameOriginApiByPath) ? fullPagePerformance.sameOriginApiByPath.filter((item) => Number(item?.overFiveSecondCount ?? 0) > 0) : []);",
"const combinedFindings = sortFindings(mergeArrays(source?.findings, fullSource?.findings));",
"const srcPromptNetwork = objectOrNull(source?.promptNetwork);",
@@ -7696,7 +7696,7 @@ function runNodeWebProbeObserveAnalyze(options: NodeWebProbeObserveOptions, spec
" stderrTail: tail(readText(stderrPath))",
" }",
"};",
"const compactStdoutLimitBytes = 8000;",
"const compactStdoutLimitBytes = 4000;",
"const compactOutput = (value) => JSON.stringify(value);",
"let output = compactOutput(compact);",
"if (Buffer.byteLength(output, 'utf8') > compactStdoutLimitBytes) {",
@@ -7722,7 +7722,7 @@ function runNodeWebProbeObserveAnalyze(options: NodeWebProbeObserveOptions, spec
" pagePerformance: compact.pagePerformance ?? null,",
" promptNetwork: compact.promptNetwork ?? null,",
" findings: Array.isArray(compact.findings) ? compact.findings.slice(0, 4) : [],",
" pagePerformanceSlowApi: Array.isArray(compact.pagePerformanceSlowApi) ? compact.pagePerformanceSlowApi.slice(0, 3) : [],",
" pagePerformanceSlowApi: Array.isArray(compact.pagePerformanceSlowApi) ? compact.pagePerformanceSlowApi.slice(0, 2).map((item) => ({ ...item, slowSamples: Array.isArray(item.slowSamples) ? item.slowSamples.slice(0, 1) : [] })) : [],",
" runnerErrors: Array.isArray(compact.runnerErrors) ? compact.runnerErrors.slice(-4) : [],",
" turnTimingRecentUpdateJumps: Array.isArray(compact.turnTimingRecentUpdateJumps) ? compact.turnTimingRecentUpdateJumps.slice(0, 4) : [],",
" turnTimingElapsedZeroResets: Array.isArray(compact.turnTimingElapsedZeroResets) ? compact.turnTimingElapsedZeroResets.slice(0, 4) : [],",
@@ -7774,6 +7774,7 @@ function renderWebObserveAnalyzeTable(value: Record<string, unknown>): string {
const archiveSummary = record(analysis?.archiveSummary);
const sampleMetrics = record(analysis?.sampleMetrics);
const archiveMetrics = record(archiveSummary?.sampleMetrics);
const archivePagePerformance = record(archiveSummary?.pagePerformance);
const runtimeAlerts = record(analysis?.runtimeAlerts);
const pagePerformance = record(analysis?.pagePerformance);
const promptNetwork = record(analysis?.promptNetwork);
@@ -8034,6 +8035,14 @@ function renderWebObserveAnalyzeTable(value: Record<string, unknown>): string {
return rows.length > 0 ? rows : [["-", "-", "-", "-", "-", "-", "-", "-"]];
})()),
"",
"Archive page performance:",
webObserveTable(["SAME_ORIGIN_API", "SLOW_PATHS", "SLOW_SAMPLES", "WORST_P95"], [[
webObserveText(archivePagePerformance?.sameOriginApiPathCount ?? archivePagePerformance?.sameOriginApiPaths),
webObserveText(archivePagePerformance?.slowPathCount),
webObserveText(archivePagePerformance?.slowSampleCount),
webObserveText(archivePagePerformance?.worstP95Ms),
]]),
"",
"DOM diagnostics:",
webObserveTable(domDiagnostics.length > 0 ? ["COUNT", "FIRST", "LAST", "TEXT"] : ["SEQ", "TS", "META", "TEXT"], domDiagnosticRows.length > 0 ? domDiagnosticRows : [["-", "-", "-", "-"]]),
"",