Remove per-chunk UpdateMessage debug log#1896
Merged
trungutt merged 1 commit intodocker:mainfrom Mar 3, 2026
Merged
Conversation
During streaming, persistStreamingContent is called on every chunk received from the LLM, which in turn calls UpdateMessage on every chunk. The debug log in UpdateMessage fired once per chunk, producing ~120 identical log lines for a single short response (~1500 chars). The log carried no new information per call (same message_id, role, and agent on every line) and dominated the debug log file. The first message creation is already logged in persistStreamingContent via '[PERSIST] Created streaming message', which provides the message_id for correlation. The UpdateMessage path needs no additional log.
There was a problem hiding this comment.
Review Summary
✅ This PR looks good! The removal of the per-chunk debug log is a straightforward observability improvement.
What was verified:
- The debug log was firing 123+ times for a single streaming response
- Message creation is already logged once in
persistStreamingContent - Error handling remains intact through existing
slog.Warncalls - No functional impact — purely reduces log noise
This change improves log readability without losing diagnostic capability.
aheritier
approved these changes
Mar 3, 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.
Problem
During LLM streaming,
persistStreamingContentis called on every chunk received from the model. Each call invokesSQLiteSessionStore.UpdateMessage, which contained aslog.Debugthat fired once per chunk.For a single short response (~1500 characters, ~5 seconds of streaming), this produced 123 identical log lines:
The same
message_id,role, andagenton every line — no new information per call. This single pattern accounted for ~30% of all log output incagent.debug.login some specific situation. 30% might be optimistic.Fix
This PR suggests removing the
slog.Debugcall fromSQLiteSessionStore.UpdateMessage.The first message creation is already logged once in
persistStreamingContentvia[PERSIST] Created streaming message, which captures themessage_idfor correlation. Errors inUpdateMessage(sync failures,ErrNotFound) are still surfaced viaslog.Warn— so we can have enough info for a diagnostic if needed