Changes from fix/dev-server-hang

This commit is contained in:
gsxdsm
2026-03-02 23:03:36 -08:00
parent b2915f4de1
commit fc6c69f03d
8 changed files with 108 additions and 42 deletions

View File

@@ -923,17 +923,19 @@ export class HttpApiClient implements ElectronAPI {
this.ws.onmessage = (event) => {
try {
const data = JSON.parse(event.data);
logger.info(
'WebSocket message:',
data.type,
'hasPayload:',
!!data.payload,
'callbacksRegistered:',
this.eventCallbacks.has(data.type)
);
// Only log non-high-frequency events to avoid progressive memory growth
// from accumulated console entries. High-frequency events (dev-server output,
// test runner output, agent progress) fire 10+ times/sec and would generate
// thousands of console entries per minute.
const isHighFrequency =
data.type === 'dev-server:output' ||
data.type === 'test-runner:output' ||
data.type === 'auto_mode_progress';
if (!isHighFrequency) {
logger.info('WebSocket message:', data.type);
}
const callbacks = this.eventCallbacks.get(data.type);
if (callbacks) {
logger.info('Dispatching to', callbacks.size, 'callbacks');
callbacks.forEach((cb) => cb(data.payload));
}
} catch (error) {