Bug
generateClientID() in internal/serve/websocket.go produces non-printable control characters in the client ID when clientCounter > 0:
func generateClientID() string {
clientCounter++
return time.Now().Format("20060102150405") + "-" + string(rune(clientCounter))
}
string(rune(1)) produces "\x01" (SOH control character), not "1". The intent was decimal-stringification of clientCounter; the result is the Unicode codepoint at that integer value.
Repro
2026/05/20 12:00:00 WebSocket client connected: 20260520120000-\x01 (total: 1)
2026/05/20 12:00:05 WebSocket client connected: 20260520120000-\x02 (total: 2)
The IDs do differ across counter values, so client-identity tracking still technically works — but log lines contain non-printable characters, and any code that compares client IDs against printable strings (or persists them to a log scraper that escapes non-printable chars) will see drift.
Fix
return time.Now().Format("20060102150405") + "-" + strconv.FormatUint(uint64(clientCounter), 10)
Scope
Pre-existing on lvt main (verified across the d2ffa33..f2f7e61 range — generateClientID is untouched). Flagged by claude-review on lvt#330 and pulled out as a separate issue per Phase 5 scope discipline.
Out of scope for this issue
clientCounter is a package-level int with no mutex — a separate race-condition bug. Worth a second issue or rolled into a "WebSocketManager.generateClientID hardening" PR alongside this fix.
Bug
generateClientID()ininternal/serve/websocket.goproduces non-printable control characters in the client ID whenclientCounter > 0:string(rune(1))produces"\x01"(SOH control character), not"1". The intent was decimal-stringification ofclientCounter; the result is the Unicode codepoint at that integer value.Repro
The IDs do differ across counter values, so client-identity tracking still technically works — but log lines contain non-printable characters, and any code that compares client IDs against printable strings (or persists them to a log scraper that escapes non-printable chars) will see drift.
Fix
Scope
Pre-existing on lvt main (verified across the d2ffa33..f2f7e61 range —
generateClientIDis untouched). Flagged by claude-review on lvt#330 and pulled out as a separate issue per Phase 5 scope discipline.Out of scope for this issue
clientCounteris a package-levelintwith no mutex — a separate race-condition bug. Worth a second issue or rolled into a "WebSocketManager.generateClientID hardening" PR alongside this fix.