Repository navigation
fix(llm): keep non-ascii text readable in mcp results and task group tool description - #7565
Merged
davidzhao merged 1 commit intoOct 3, 2026
Conversation
avionicharshit-byte
marked this pull request as ready for review
October 1, 2026 09:02
Contributor
Author
davidzhao
approved these changes
Oct 3, 2026
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.
two places still put text into the llm context through
json.dumpswith the defaultensure_ascii=True, so hindi (or any non-ascii text) reaches the model as\uXXXXescapes:llm/mcp.py_default_tool_result_resolver: an mcp tool result with 2+ content items. the single-item path usesmodel_dump_json()and keeps the text readable, so the same tool output looks different depending on how many items it returns.beta/workflows/task_group.py_build_out_of_scope_tool: task descriptions are embedded in theout_of_scopetool description, so"ईमेल पता पूछें"becomes"ईमेल ...".escaped text is harder for the model to read and costs more tokens (one short hindi sentence: 104 tokens escaped vs 19 readable,
o200k_base). #2622 already turnedensure_asciioff for logging; this does the same for these two llm-facing paths.tests:
tests/test_llm_text_non_ascii.py, both fail on main and pass with the fix. unit suite passes (9test_room.pyerrors need a locallivekit-server, same on main),make type-checkclean.