fix(slack,web): harden thread hints and monitor tuning

This commit is contained in:
Peter Steinberger
2026-02-22 22:05:39 +00:00
parent 57b75678d4
commit b534dfa3e0
6 changed files with 107 additions and 44 deletions

View File

@@ -154,9 +154,10 @@ export async function monitorWebChannel(
let _lastInboundMsg: WebInboundMsg | null = null;
let unregisterUnhandled: (() => void) | null = null;
// Watchdog to detect stuck message processing (e.g., event emitter died)
const MESSAGE_TIMEOUT_MS = 30 * 60 * 1000; // 30 minutes without any messages
const WATCHDOG_CHECK_MS = 60 * 1000; // Check every minute
// Watchdog to detect stuck message processing (e.g., event emitter died).
// Tuning overrides are test-oriented; production defaults remain unchanged.
const MESSAGE_TIMEOUT_MS = tuning.messageTimeoutMs ?? 30 * 60 * 1000; // 30m default
const WATCHDOG_CHECK_MS = tuning.watchdogCheckMs ?? 60 * 1000; // 1m default
const backgroundTasks = new Set<Promise<unknown>>();
const onMessage = createWebOnMessageHandler({