Fix token rendering and clean up tool-call output#1
Merged
Conversation
added 2 commits
May 21, 2026 08:04
- Remove broken needSpace logic that inserted spaces mid-word between streamed LLM tokens - Drop empty-name print at toolcall_start; show full "🔧 name args" on toolcall_end so parallel calls each render their own line - Disable JSON HTML-escaping so & < > are not mangled in args - For bash tool_execution_start, print just the command string instead of the full args JSON
Assign return values of io.Copy, enc.Encode, cmd.Process.Kill and cmd.Wait to blank identifier to satisfy errcheck linter.
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
needSpacelogic that inserted spaces mid-word between streamed LLM tokens (e.g.hel+lo→hel lo)toolcall_start; render the full🔧 name argsontoolcall_endso parallel tool calls each get their own line&,<,>in args are not mangled into&etc.bashtool_execution_start, print just thecommandvalue instead of full args JSONTest plan
go build ./...passesgo run main.go --model "GLM 5.1" --thinking off "powiedz mi krótką bajeczkę"— words no longer split mid-tokengo run main.go --model "GLM 5.1" -t "bash" "sprawdź jakie pliki są w repo"— parallel bash calls each render with name + clean command