gateway: remove duplicate health monitor toggle

This commit is contained in:
Tak Hoffman 2026-03-14 20:13:03 -05:00
parent 3658475238
commit 84292d92bf
8 changed files with 2 additions and 23 deletions

View File

@ -102,8 +102,6 @@ export const FIELD_HELP: Record<string, string> = {
"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":

View File

@ -83,7 +83,6 @@ export const FIELD_LABELS: Record<string, string> = {
"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",

View File

@ -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.

View File

@ -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(),

View File

@ -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",

View File

@ -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") {

View File

@ -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,

View File

@ -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