Skip to content

Fix token rendering and clean up tool-call output#1

Merged
s2x merged 2 commits into
mainfrom
fix-token-rendering
May 21, 2026
Merged

Fix token rendering and clean up tool-call output#1
s2x merged 2 commits into
mainfrom
fix-token-rendering

Conversation

@s2x
Copy link
Copy Markdown
Contributor

@s2x s2x commented May 21, 2026

Summary

  • Remove broken needSpace logic that inserted spaces mid-word between streamed LLM tokens (e.g. hel + lohel lo)
  • Drop empty-name print at toolcall_start; render the full 🔧 name args on toolcall_end so parallel tool calls each get their own line
  • Disable JSON HTML-escaping so &, <, > in args are not mangled into & etc.
  • For bash tool_execution_start, print just the command value instead of full args JSON

Test plan

  • go build ./... passes
  • Manual: go run main.go --model "GLM 5.1" --thinking off "powiedz mi krótką bajeczkę" — words no longer split mid-token
  • Manual: go run main.go --model "GLM 5.1" -t "bash" "sprawdź jakie pliki są w repo" — parallel bash calls each render with name + clean command

Piotr Hałas 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.
@s2x s2x merged commit d7be275 into main May 21, 2026
2 checks passed
@s2x s2x deleted the fix-token-rendering branch May 21, 2026 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant