fix(console): terminate generation stats line with a newline (#2285)#2317
Closed
Anai-Guo wants to merge 1 commit into
Closed
fix(console): terminate generation stats line with a newline (#2285)#2317Anai-Guo wants to merge 1 commit into
Anai-Guo wants to merge 1 commit into
Conversation
…#2285) The post-generation stats line (`[time] CtxLimit:... Total:...`) was printed without a trailing newline, relying on the next koboldcpp print starting with ` `. When llama.cpp's `state_write_data: writing state` message (which has no leading newline) is emitted right after, it gets glued onto the end of the stats line. Append ` ` to the stats printf so the line is always terminated, regardless of what prints next. Assisted-by: Claude
LostRuins
added a commit
that referenced
this pull request
Jul 10, 2026
Owner
|
Thanks but I think this is overkill, we don't want a double newline every time this prints. Instead, we can simply add the missing newline before saving state. It's fine as it's just a tiny change. Fixed in 39654ab |
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.
Summary
Fixes #2285 — the post-generation stats line runs into the next log message with no line break:
Cause
The stats line in
gpttype_adapter.cppis printed with a leading\nand no trailing one:This relies on the next koboldcpp print also starting with
\n. But llama.cpp'sstate_write_data: writing statemessage (emitted when save-state runs right after generation) has no leading newline, so it gets glued onto the end of the stats line.Since that message comes from vendored llama.cpp, the correct-layer fix is to terminate koboldcpp's own stats line.
Fix
Append
\nto the statsprintfformat string so the line is always terminated regardless of what prints next. One-character change, no behavioral impact on the numbers reported.🤖 Generated with Claude Code