From 84292d92bfa0027c1998d95d3bfc99de2c8d3875 Mon Sep 17 00:00:00 2001 From: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> Date: Sat, 14 Mar 2026 20:13:03 -0500 Subject: [PATCH] gateway: remove duplicate health monitor toggle --- src/config/schema.help.ts | 2 -- src/config/schema.labels.ts | 1 - src/config/types.gateway.ts | 6 ------ src/config/zod-schema.ts | 1 - src/gateway/config-reload-plan.ts | 5 ----- src/gateway/server-channels.ts | 4 ---- src/gateway/server-reload-handlers.ts | 3 +-- src/gateway/server.impl.ts | 3 +-- 8 files changed, 2 insertions(+), 23 deletions(-) diff --git a/src/config/schema.help.ts b/src/config/schema.help.ts index 97b2ef02e5c..7fbfdec76d8 100644 --- a/src/config/schema.help.ts +++ b/src/config/schema.help.ts @@ -102,8 +102,6 @@ export const FIELD_HELP: Record = { "Explicit gateway-level tool denylist to block risky tools even if lower-level policies allow them. Use deny rules for emergency response and defense-in-depth hardening.", "gateway.channelHealthCheckMinutes": "Interval in minutes for automatic channel health probing and status updates. Use lower intervals for faster detection, or higher intervals to reduce periodic probe noise.", - "gateway.channelHealthMonitorEnabled": - "Global enable switch for the gateway channel health monitor. Set false to disable all health-monitor-initiated channel restarts; per-channel healthMonitor.enabled overrides can further disable individual channels or accounts when the global monitor stays on.", "gateway.channelStaleEventThresholdMinutes": "How many minutes a connected channel can go without receiving any event before the health monitor treats it as a stale socket and triggers a restart. Default: 30.", "gateway.channelMaxRestartsPerHour": diff --git a/src/config/schema.labels.ts b/src/config/schema.labels.ts index 394f2095880..e700f2329b4 100644 --- a/src/config/schema.labels.ts +++ b/src/config/schema.labels.ts @@ -83,7 +83,6 @@ export const FIELD_LABELS: Record = { "gateway.tools": "Gateway Tool Exposure Policy", "gateway.tools.allow": "Gateway Tool Allowlist", "gateway.tools.deny": "Gateway Tool Denylist", - "gateway.channelHealthMonitorEnabled": "Gateway Channel Health Monitor Enabled", "gateway.channelHealthCheckMinutes": "Gateway Channel Health Check Interval (min)", "gateway.channelStaleEventThresholdMinutes": "Gateway Channel Stale Event Threshold (min)", "gateway.channelMaxRestartsPerHour": "Gateway Channel Max Restarts Per Hour", diff --git a/src/config/types.gateway.ts b/src/config/types.gateway.ts index be21668112d..88a5350ab1d 100644 --- a/src/config/types.gateway.ts +++ b/src/config/types.gateway.ts @@ -425,12 +425,6 @@ export type GatewayConfig = { allowRealIpFallback?: boolean; /** Tool access restrictions for HTTP /tools/invoke endpoint. */ tools?: GatewayToolsConfig; - /** - * Global enable switch for the channel health monitor. - * Set to false to disable health-monitor-driven channel restarts entirely. - * Default: true. - */ - channelHealthMonitorEnabled?: boolean; /** * Channel health monitor interval in minutes. * Periodically checks channel health and restarts unhealthy channels. diff --git a/src/config/zod-schema.ts b/src/config/zod-schema.ts index 2e7eb8d151b..dac3e61f94c 100644 --- a/src/config/zod-schema.ts +++ b/src/config/zod-schema.ts @@ -695,7 +695,6 @@ export const OpenClawSchema = z }) .strict() .optional(), - channelHealthMonitorEnabled: z.boolean().optional(), channelHealthCheckMinutes: z.number().int().min(0).optional(), channelStaleEventThresholdMinutes: z.number().int().min(1).optional(), channelMaxRestartsPerHour: z.number().int().min(1).optional(), diff --git a/src/gateway/config-reload-plan.ts b/src/gateway/config-reload-plan.ts index 238d4431fc2..63eddd31c54 100644 --- a/src/gateway/config-reload-plan.ts +++ b/src/gateway/config-reload-plan.ts @@ -36,11 +36,6 @@ type ReloadAction = const BASE_RELOAD_RULES: ReloadRule[] = [ { prefix: "gateway.remote", kind: "none" }, { prefix: "gateway.reload", kind: "none" }, - { - prefix: "gateway.channelHealthMonitorEnabled", - kind: "hot", - actions: ["restart-health-monitor"], - }, { prefix: "gateway.channelHealthCheckMinutes", kind: "hot", diff --git a/src/gateway/server-channels.ts b/src/gateway/server-channels.ts index 4ce992fca3d..8e5e1164dc8 100644 --- a/src/gateway/server-channels.ts +++ b/src/gateway/server-channels.ts @@ -132,10 +132,6 @@ export function createChannelManager(opts: ChannelManagerOptions): ChannelManage const isHealthMonitorEnabled = (channelId: ChannelId, accountId: string): boolean => { const cfg = loadConfig(); - if (cfg.gateway?.channelHealthMonitorEnabled === false) { - return false; - } - const channelConfig = cfg.channels?.[channelId] as RawChannelConfig | undefined; const accountOverride = channelConfig?.accounts?.[accountId]?.healthMonitor?.enabled; if (typeof accountOverride === "boolean") { diff --git a/src/gateway/server-reload-handlers.ts b/src/gateway/server-reload-handlers.ts index 1bd810907b5..008f0977d37 100644 --- a/src/gateway/server-reload-handlers.ts +++ b/src/gateway/server-reload-handlers.ts @@ -104,11 +104,10 @@ export function createGatewayReloadHandlers(params: { if (plan.restartHealthMonitor) { state.channelHealthMonitor?.stop(); - const enabled = nextConfig.gateway?.channelHealthMonitorEnabled !== false; const minutes = nextConfig.gateway?.channelHealthCheckMinutes; const staleMinutes = nextConfig.gateway?.channelStaleEventThresholdMinutes; nextState.channelHealthMonitor = - !enabled || minutes === 0 + minutes === 0 ? null : params.createHealthMonitor({ checkIntervalMs: (minutes ?? 5) * 60_000, diff --git a/src/gateway/server.impl.ts b/src/gateway/server.impl.ts index 1d7e38b8cea..5453ff8fcee 100644 --- a/src/gateway/server.impl.ts +++ b/src/gateway/server.impl.ts @@ -755,9 +755,8 @@ export async function startGatewayServer( } : startHeartbeatRunner({ cfg: cfgAtStart }); - const healthMonitorEnabled = cfgAtStart.gateway?.channelHealthMonitorEnabled !== false; const healthCheckMinutes = cfgAtStart.gateway?.channelHealthCheckMinutes; - const healthCheckDisabled = !healthMonitorEnabled || healthCheckMinutes === 0; + const healthCheckDisabled = healthCheckMinutes === 0; const staleEventThresholdMinutes = cfgAtStart.gateway?.channelStaleEventThresholdMinutes; const maxRestartsPerHour = cfgAtStart.gateway?.channelMaxRestartsPerHour; let channelHealthMonitor = healthCheckDisabled