mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-26 07:11:00 -05:00
Tool results returned as a JSON object or list were re-indented with two spaces before being handed to the model, so those tool calls paid tokens for whitespace nobody reads. They now go to the model as compact JSON. The tool call panel in the chat still shows them pretty-printed, because it formats the result on its own. Measured on real Open Terminal responses (o200k tokenizer): | Tool | Before | After | Saved | |---|---|---|---| | list_files | 1013 | 672 | 34% | | glob_search | 2821 | 2061 | 27% | | grep_search | 2233 | 1652 | 26% | | run_command | 649 | 614 | 5% | | read_file | 3254 | 3245 | 0% | Fixes #34639