fix(web-probe): harden observe analyze recovery (#780)

Co-authored-by: Codex <codex@noreply.local>
This commit is contained in:
Lyon
2026-06-24 04:54:45 +08:00
committed by GitHub
parent be9b6dce23
commit e6fe4ca053
2 changed files with 61 additions and 5 deletions
+2 -1
View File
@@ -8873,7 +8873,8 @@ function runNodeWebProbeObserveAnalyze(options: NodeWebProbeObserveOptions, spec
});
}
function recoverWebObserveAnalyzeTurnDetails(options: NodeWebProbeObserveOptions, spec: HwlabRuntimeLaneSpec, analysis: Record<string, unknown>): Record<string, unknown> {
function recoverWebObserveAnalyzeTurnDetails(options: NodeWebProbeObserveOptions, spec: HwlabRuntimeLaneSpec, analysis: Record<string, unknown> | null): Record<string, unknown> | null {
if (analysis === null || typeof analysis !== "object") return analysis;
const sampleMetrics = record(analysis.sampleMetrics);
const hasRounds = Array.isArray(sampleMetrics?.rounds) && sampleMetrics.rounds.length > 0;
const hasColumns = Array.isArray(sampleMetrics?.turnColumns) && sampleMetrics.turnColumns.length > 0;