mirror of
https://github.com/usestrix/strix.git
synced 2026-10-26 06:02:30 +00:00
html.unescape JSON body before json.loads in tool-call fallback
The <parameter> 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.
This commit is contained in:
parent
7327ca8324
commit
15c3910ded
1 changed files with 1 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue