Problem
The Discord channel health monitor settings are currently hardcoded in the source code with these values:
checkIntervalMs: How often to check channel health
staleEventThresholdMs: How long before a channel is considered stale
maxRestartsPerHour: Maximum restart attempts per hour
Impact
- No flexibility - Cannot tune these values for different usage patterns
- Unnecessary restarts - On quiet channels, the default stale threshold may trigger restarts when the channel is simply inactive (no new messages)
- No per-channel customization - All channels use the same hardcoded values regardless of their activity level
Proposed Solution
Add a channels.discord.healthMonitor configuration section that allows users to customize these settings.
Example Config Structure
{
"channels": {
"discord": {
"healthMonitor": {
"checkIntervalMs": 30000,
"staleEventThresholdMs": 120000,
"maxRestartsPerHour": 3
}
}
}
}
Fallback Behavior
- If config section is not present, use sensible defaults (current hardcoded values or improved defaults)
- Validate values to prevent misconfiguration (e.g., minimum thresholds)
Investigation Reference
This was identified during debugging of unnecessary Discord channel restarts in production. The hardcoded values did not account for quiet periods where no events are expected.
Problem
The Discord channel health monitor settings are currently hardcoded in the source code with these values:
checkIntervalMs: How often to check channel healthstaleEventThresholdMs: How long before a channel is considered stalemaxRestartsPerHour: Maximum restart attempts per hourImpact
Proposed Solution
Add a
channels.discord.healthMonitorconfiguration section that allows users to customize these settings.Example Config Structure
{ "channels": { "discord": { "healthMonitor": { "checkIntervalMs": 30000, "staleEventThresholdMs": 120000, "maxRestartsPerHour": 3 } } } }Fallback Behavior
Investigation Reference
This was identified during debugging of unnecessary Discord channel restarts in production. The hardcoded values did not account for quiet periods where no events are expected.