chore: add debug logging to web:broadcastUserInput handler

Add debug logging to help diagnose web broadcast issues. Logs webServer
existence and client count when broadcastUserInput is called.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Raza Rauf
2026-01-21 03:36:18 +05:00
parent b1b8736e04
commit 3a8155368a

View File

@@ -45,7 +45,12 @@ export function registerWebHandlers(deps: WebHandlerDependencies): void {
'web:broadcastUserInput',
async (_, sessionId: string, command: string, inputMode: 'ai' | 'terminal') => {
const webServer = getWebServer();
if (webServer && webServer.getWebClientCount() > 0) {
const clientCount = webServer?.getWebClientCount() ?? 0;
logger.debug(
`web:broadcastUserInput called - webServer: ${webServer ? 'exists' : 'null'}, clientCount: ${clientCount}`,
'WebBroadcast'
);
if (webServer && clientCount > 0) {
webServer.broadcastUserInput(sessionId, command, inputMode);
return true;
}