You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
toLocaleString() thousands separators leak into LLM-facing tool results #768
12,345 costs more tokens than 12345 and carries no additional meaning for a model. Thousands separators are a human-readability affordance.
This is correct for the Ink display layer, which is why the pattern exists. It is just wrong on the path that feeds the LLM.
Fix
Use plain numbers in any string returned from a tool execute, and keep toLocaleString() in the formatter components that render to the terminal.
Worth a quick grep for other instances beyond the ones listed, since the two paths are easy to confuse. The distinction to apply: anything inside a Formatter React component is display and should stay; anything inside an execute function is LLM payload and should not.
Notes for a first-time contributor
Mechanical and low-risk, but it does require care to only change the LLM-facing path and leave the display path alone. Good way to get familiar with how nanocoder separates tool execution from tool rendering.
Activity
will-lamerton commentedon Aug 3, 2026
Part of #772.
Dashetty commentedon Aug 3, 2026
Hello there, I'd like to work on this.
fix: drop toLocaleString() thousands separators from LLM-facing tool …