From 15c3910ded52618143acd393bd41abca91ecffe2 Mon Sep 17 00:00:00 2001 From: n1majne3 <24203125+n1majne3@users.noreply.github.com> Date: Sun, 3 May 2026 19:48:11 -0700 Subject: [PATCH] html.unescape JSON body before json.loads in tool-call fallback The path on line 113 already unescapes HTML entities; the JSON fallback path didn't, so any MiniMax JSON body that arrived with HTML-escaped characters (either in string values like <script> or in the JSON syntax itself like "path") would either fail to parse or produce values with literal entity text instead of the original character. --- strix/llm/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strix/llm/utils.py b/strix/llm/utils.py index fd7e4784..8b3e4cd2 100644 --- a/strix/llm/utils.py +++ b/strix/llm/utils.py @@ -113,7 +113,7 @@ def parse_tool_invocations(content: str) -> list[dict[str, Any]] | None: args[param_name] = param_value if not args: - body_stripped = fn_body.strip() + body_stripped = html.unescape(fn_body.strip()) if body_stripped.startswith("{"): try: parsed = json.loads(body_stripped)