6 months ago
a0da456Memory leak fixes: - Cap allMessages at 1000 in HistoryManager (preserves system message) - Cap turns at 512 in SessionCostTracker with recalculateTotals() - Cap feed at 2000 in SessionSnapshotProjector - Fix cost tracker listener leak in AgentSession.dispose() - Null manager refs in AgentSession.dispose() to aid GC - Add 5-min idle eviction for sessionBindings with no live sinks - Delete threadJournalWriteQueues entry after flush completes - Delete workspaceControlStateIds when subscribers drop to zero WebSocket backpressure: - Add per-connection send queue (max 500) with drain flushing - Make sendJsonRpc backpressure-aware (checks ws.send() return) - Evict stream deltas first from queue when full - Update dispatchJsonRpcMessage to accept optional send callback Desktop consolidation (Phase 1): - Add thread/hydrate endpoint (combines resume + read) - Add cowork/workspace/bootstrap endpoint (threads + state) Tests: - test/server.memory.test.ts - test/server.backpressure.test.ts
Parentc801381