refactor: dedupe health record helper

This commit is contained in:
Peter Steinberger
2026-04-06 23:05:50 +01:00
parent dc08aea25f
commit 08c0018536

View File

@@ -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<string, unknown> | null =>
value && typeof value === "object" ? (value as Record<string, unknown>) : null;
isRecord(value) ? value : null;
async function inspectHealthAccount(plugin: ChannelPlugin, cfg: OpenClawConfig, accountId: string) {
return (