Fix 1: HTTP Server timeouts (service.go)
- Added IdleTimeout: 120s - closes idle keep-alive connections
- Added ReadTimeout: 30s - prevents hung connections waiting for request data
Fix 2: SSE dead client cleanup (broadcaster.go) - This was the real leak
- Bug: When Write() failed on a disconnected client, it just logged and continued - the dead client stayed in the clients map forever
- Effect: Dead clients accumulated and every Broadcast() call would try (and fail) to write to them
- Fix: Now tracks failed writes and removes dead clients from the map
The SSE bug was likely the main cause. Every time a browser tab closed or connection dropped, the client stayed registered. On each broadcast (processing status updates happen frequently), it would try to write to dead connections, fail, but never clean up.
1. Version mismatch restart loop (pkg/hooks/worker.go):
- Added versionsCompatible() and extractBaseVersion() functions
- Hooks no longer restart worker when base versions match (e.g., v0.3.5-dirty ≈ v0.3.5-2-gca711a8-dirty)
2. Auto-update detection (internal/update/update.go):
- isNewerVersion() now extracts base version before comparing
- No longer always reports updates for dirty/dev builds
3. Non-blocking ChromaDB sync (internal/worker/handlers.go):
- SyncUserPrompt now runs in a goroutine with 10-second timeout
- /api/sessions/init responds immediately without waiting for ChromaDB