From af4b21704dc3d82121e09cc8f7bcdcdff8384d0f Mon Sep 17 00:00:00 2001 From: Codex Date: Sun, 21 Jun 2026 13:32:17 +0000 Subject: [PATCH] fix web-probe observe status null handling --- scripts/src/hwlab-node-impl.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/scripts/src/hwlab-node-impl.ts b/scripts/src/hwlab-node-impl.ts index 161da79f..d9092a13 100644 --- a/scripts/src/hwlab-node-impl.ts +++ b/scripts/src/hwlab-node-impl.ts @@ -6882,17 +6882,29 @@ function runNodeWebProbeObserveStatus(options: NodeWebProbeObserveOptions, spec: const result = runTransWorkspaceStdinScript(options.node, spec.workspace, script, options.commandTimeoutSeconds); const status = parseJsonObject(result.stdout); const observerId = webObserveIdFromStatus(status, options); - const index = status?.ok !== false && observerId !== null && options.stateDir !== null + const statusReadable = status !== null; + const ok = result.exitCode === 0 && statusReadable && status.ok !== false; + const degradedReason = result.timedOut + ? "web-probe-command-timeout" + : result.exitCode !== 0 + ? "web-probe-observe-status-failed" + : !statusReadable + ? "web-probe-observe-status-unreadable" + : typeof status.degradedReason === "string" + ? status.degradedReason + : null; + const index = ok && observerId !== null && options.stateDir !== null ? upsertWebObserveIndexEntry(webObserveIndexEntryFromOptions(options, spec, observerId, status)) : null; return { - ok: result.exitCode === 0 && status?.ok !== false, - status: result.exitCode === 0 ? "observed" : "blocked", + ok, + status: ok ? "observed" : "blocked", command: webObserveCommandLabel("status", options), id: observerId, node: options.node, lane: options.lane, workspace: spec.workspace, + degradedReason, observer: withWebObserveShortcuts(status, observerId), index, next: observerId === null ? null : webObserveNextCommands(observerId),