- [x] Add language-specific chunkers with AST parsing (Go, Python, TypeScript)
- [x] Implement chunking manager to dispatch files to appropriate chunkers
- [x] Integrate code chunks into vector sync for semantic search
- [x] Add tree-sitter dependency for Python/TypeScript parsing
- [x] Reorder struct fields for consistency across codebase
- [x] Rename error variables to follow Go conventions (err → unmarshalErr, etc.)
- [x] Add code chunk metadata to vector documents (language, symbol name, line ranges)
- [x] Update worker service to initialize chunking pipeline with all three languages
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.