Repository navigation
refactor(logging): flush the flight recorder directly from sockets - #1144
Merged
Merged
Conversation
Replace the onConnectionFailure callback threaded through CoderApi with a BufferedLogger type. ReconnectingWebSocket flushes the logger it already holds, and getLogger() returns the buffered logger so getConnectionLogBuffer() is removed.
EhabY
force-pushed
the
refactor/buffered-logger
branch
2 times, most recently
from
October 9, 2026 14:48
0cf4336 to
eb6d2ed
Compare
code-asher
approved these changes
Oct 9, 2026
code-asher
left a comment
Member
There was a problem hiding this comment.
Nice! As an aside, we have been calling this a "flight recorder" rather than a "buffered logger" in other repos (since "buffered" could have other meanings), might make sense to match that name in this repo one day.
aqandrew
approved these changes
Oct 9, 2026
aqandrew
left a comment
Contributor
There was a problem hiding this comment.
Much simpler, thanks!
Also +1 to Asher's comment re: suggesting renaming "buffered logger" to "flight recorder". See these PRs:
Match the flight recorder naming from coder/slog. Logger now carries flush, so consumers take a plain Logger again; the write-only side (output channel, prefixLogger) becomes LogSink. BufferingLogger is renamed to FlightRecorder and is only named where it is constructed.
aqandrew
reviewed
Oct 9, 2026
aqandrew
approved these changes
Oct 9, 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.
Simplifies how sockets flush the connection log buffer, and renames the buffer to match the flight recorder naming in coder/slog.
The
onConnectionFailurecallback was threaded from the container throughCoderApi.createinto everyReconnectingWebSocket, even though the logger it flushed was already passed along the same path.Loggergainsflush, so sockets, the remote session, and the support bundle command call it on the logger they already hold. The write-only side (the output channel andprefixLogger) is a newLogSinktype.BufferingLoggeris renamed toFlightRecorder(src/logging/flightRecorder.ts), matching feat: add FlightRecorder sink for deferred low-level logging slog#237 and feat: buffer CLI session logs and flush on connection failure coder#29752. Only the container names it; consumers take a plainLogger.getLogger()returns the recorder, sogetConnectionLogBuffer()andConnectionLogBufferare removed.BufferingLogger.onConnectionFailure.No behavior change: the flushed
<reason> <route>strings are identical, and thecoder.connectionLogBuffer.sizesetting and[buffered]output marker are unchanged.🤖 Generated with Claude Code