From 08c001853688006c79d2e67b0845f3e0bf87e172 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 6 Apr 2026 23:05:50 +0100 Subject: [PATCH] refactor: dedupe health record helper --- src/commands/health.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/commands/health.ts b/src/commands/health.ts index a8c86c008af..2a2cf61db74 100644 --- a/src/commands/health.ts +++ b/src/commands/health.ts @@ -20,6 +20,7 @@ import { normalizeAgentId } from "../routing/session-key.js"; import { type RuntimeEnv, writeRuntimeJson } from "../runtime.js"; import { styleHealthChannelLine } from "../terminal/health-style.js"; import { isRich } from "../terminal/theme.js"; +import { isRecord } from "../utils.js"; import { logGatewayConnectionDetails } from "./status.gateway-connection.js"; export type ChannelAccountHealthSummary = { @@ -164,7 +165,7 @@ const buildSessionSummary = (storePath: string) => { }; const asRecord = (value: unknown): Record | null => - value && typeof value === "object" ? (value as Record) : null; + isRecord(value) ? value : null; async function inspectHealthAccount(plugin: ChannelPlugin, cfg: OpenClawConfig, accountId: string) { return (