fix(board): reliability fixes for SSE lifecycle, watchdog, transport, and rendering#3563
Merged
Merged
Conversation
Reset watchdog on every SSE line, not just data frames; add keep-alives disable on the Unix transport; drain heartbeat goroutine before return; truncate both splitTitle lines; defer mutex unlock in SetSamplingWithToolsHandler. Assisted-By: claude-opus-4-5
Assisted-By: docker-agent
docker-agent
reviewed
Jul 9, 2026
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
The changes are well-reasoned and correctly address the stated reliability gaps in the SSE lifecycle. Here is a brief summary of the review findings:
- Watchdog timer reset (
client.go): MovingresetWatchdog()before the heartbeat-comment branch so every received SSE line (including:ping comments) resets the watchdog is logically correct and matches the advertised fix. DisableKeepAlives: trueon Unix socket transport (client.go): Correct — keep-alive probes are meaningless on Unix domain sockets and could generate spurious traffic; disabling them is appropriate.- Heartbeat goroutine drain (
server.go): TheheartbeatDonechannel approach correctly prevents the goroutine leak on reconnect; the deferred closure stops the heartbeat and waits forheartbeatDone, and the goroutine closes it on exit. splitTitletruncation (tui/view.go): Truncatingline1symmetrically with the remainder is the correct fix for the rendering inconsistency.defer c.mu.Unlock()(session_client.go): Replacing manualUnlock()withdeferis safer (panic-proof) and fixes the mutex lint warning as intended.- Tests: Timing margin widening and new regression tests for watchdog reset and title truncation are appropriate.
No bugs were found in the newly introduced code (+ lines). All changes appear correct and improve reliability.
trungutt
approved these changes
Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The board's SSE event stream had several reliability gaps that caused missed events, stalled connections, and occasional rendering glitches under real-world network conditions.
This change tightens the full SSE lifecycle: the watchdog timer now resets on every received line rather than only on data frames, so comment and keep-alive lines properly defer the timeout. Keep-alive probes are disabled on the Unix domain socket transport, which doesn't need them and was generating spurious traffic. The heartbeat goroutine is now drained before the function returns, preventing a subtle goroutine leak on reconnect. The title-truncation helper now trims both halves of a split title consistently. A
deferreplaces the manual unlock inSetSamplingWithToolsHandler, fixing the mutex lint warning. Regression tests cover the watchdog reset behaviour and the title truncation, and timing margins in the heartbeat test were widened to reduce flakiness on slower CI runners.All existing tests pass (
task test), the linter is clean (task lint), and the binary builds (task build). The watchdog and heartbeat paths were also verified with targeted-raceruns.