Tinker
Resources
Agent logs
Agent memories
Agent sessions
Agent terminal logs
Agents
Comments
Epics
Projects
Proposals
Tickets
Avo user
Resources
Agent logs
Agent memories
Agent sessions
Agent terminal logs
Agents
Comments
Epics
Projects
Proposals
Tickets
Avo user
Home
Comments
104
Details
104
Go back
Delete
Edit
Id
104
Ticket
Reduce WebSocket log noise - hide normal reconnection messages
Agent
tinker-reviewer
Content
## Code Review: Ticket #127 - WebSocket Log Noise Fix ✓ PASS ### Bug Normal WebSocket closures (`StatusNormalClosure`) were logged as ERROR, flooding terminal with: ``` [BRIDGE ERROR] WebSocket read error: ... StatusNormalClosure ... [BRIDGE] WebSocket disconnected. Reconnecting in 5s... ``` ### Root Cause All WebSocket disconnections logged identically, regardless of whether they were: - Normal closures (server-side disconnect, expected) - Actual errors (network failures, timeouts) ### Fix Applied **Changes in `agent-bridge.go`:** 1. **Added `disconnectionError` flag** (line 250): ```go disconnectionError := false ``` Tracks whether disconnection was due to error vs normal closure. 2. **Type assertion for CloseError** (lines 257-263): ```go if closeErr, ok := err.(*websocket.CloseError); ok && closeErr.StatusCode == websocket.StatusNormalClosure { disconnectionError = false // Silent reconnection } else { disconnectionError = true // Log actual error log.Printf("[BRIDGE ERROR] WebSocket read error: %v", err) } ``` - Uses proper Go type assertion with `ok` check - Compares `StatusCode` to `websocket.StatusNormalClosure` - Only logs actual errors 3. **Conditional reconnection message** (lines 296-298): ```go if disconnectionError { log.Printf("[BRIDGE] WebSocket disconnected. Reconnecting in %v...", backoff) } ``` - Silent for normal closures - Only shown for actual errors ### Acceptance Criteria Met - ✓ Normal closures not logged as ERROR - ✓ Automatic reconnection messages hidden for normal closures - ✓ Only actual errors logged to terminal - ✓ Quiet mode for successful reconnections ### Code Quality - Proper Go type assertion: `err.(*websocket.CloseError)` - Follows nhooyr.io/websocket library conventions - Clear variable naming and comments - No breaking changes to existing error handling - Minimal, targeted fix (16 lines added, 2 removed) ### No Issues Found Clean bug fix that reduces terminal noise while preserving error visibility. Ready to merge.
Comment type
code_review
Avo
· © 2026 AvoHQ ·
v3.27.0
Close modal
Are you sure?
Yes, I'm sure
No, cancel