[PR #1955] [CLOSED] Tool calls: a boolean parameter written as True/False is a boolean #3775

Closed
opened 2026-11-07 15:30:40 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1955
Author: @ChrizzzXX
Created: 10/11/2026
Status: ❌ Closed

Base: main ← Head: fix/boolean-tool-arguments


📝 Commits (1)

  • 6fc26d8 Tool calls: a boolean parameter written as True/False is a boolean

📊 Changes

2 files changed (+19 additions, -0 deletions)

View changed files

📝 serve/frontend.py (+2 -0)
📝 serve/test_frontend.py (+17 -0)

📄 Description

Title

Tool calls: a boolean parameter written as True/False reaches the client as a boolean

Summary

With huihui-ai/Huihui-Qwen3.8-Flash-Next-abliterated-GGUF (swift-IQ2_XS, engine 0.1.42, RTX 5090 Laptop) the model writes boolean
tool parameters the Python way:

<function=licht_schalten>
<parameter=an>
True
</parameter>
...

parse_tool_call JSON-decodes non-string parameters, json.loads("True") fails, and the value is passed on as the string "True".
A client that checks the schema (or does if args["an"] is True) then gets a string instead of a boolean. It happened in 4 of 4
calls of the same request in our test; integer and string parameters of the same call were fine.

What changed

  • serve/frontend.py (parse_tool_call): when the tool's schema declares the parameter "type": "boolean" and the value is
    true/false in any case (surrounding spaces ignored), it becomes a boolean. Everything else is unchanged: string parameters stay
    strings ("True" in a string field is kept as written), other values are still JSON-decoded, and an unparseable boolean value
    (maybe) is still passed through as before.
  • serve/test_frontend.py: BooleanToolArguments covers True/False/true/false/TRUE, a string parameter holding True,
    an integer next to it, and the pass-through of an invalid value.

python -m unittest serve.test_frontend serve.test_server passes (306 tests on our machine). After the change the same request
returns {"raum": "Wohnzimmer", "an": true, "helligkeit": 40}.

Extra Notes

Only the XML-style <parameter=...> path is touched; the JSON tool-call path (json_tool_call) already gets real JSON booleans.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1955 **Author:** [@ChrizzzXX](https://github.com/ChrizzzXX) **Created:** 10/11/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/boolean-tool-arguments` --- ### 📝 Commits (1) - [`6fc26d8`](https://github.com/Niko1221/Strata/commit/6fc26d8598c69bcdbfb639f47ced3c4648cd2eda) Tool calls: a boolean parameter written as True/False is a boolean ### 📊 Changes **2 files changed** (+19 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `serve/frontend.py` (+2 -0) 📝 `serve/test_frontend.py` (+17 -0) </details> ### 📄 Description ## Title Tool calls: a boolean parameter written as `True`/`False` reaches the client as a boolean ## Summary With `huihui-ai/Huihui-Qwen3.8-Flash-Next-abliterated-GGUF` (`swift-IQ2_XS`, engine 0.1.42, RTX 5090 Laptop) the model writes boolean tool parameters the Python way: ``` <function=licht_schalten> <parameter=an> True </parameter> ... ``` `parse_tool_call` JSON-decodes non-string parameters, `json.loads("True")` fails, and the value is passed on as the string `"True"`. A client that checks the schema (or does `if args["an"] is True`) then gets a string instead of a boolean. It happened in 4 of 4 calls of the same request in our test; integer and string parameters of the same call were fine. ## What changed - `serve/frontend.py` (`parse_tool_call`): when the tool's schema declares the parameter `"type": "boolean"` and the value is `true`/`false` in any case (surrounding spaces ignored), it becomes a boolean. Everything else is unchanged: string parameters stay strings (`"True"` in a string field is kept as written), other values are still JSON-decoded, and an unparseable boolean value (`maybe`) is still passed through as before. - `serve/test_frontend.py`: `BooleanToolArguments` covers `True`/`False`/`true`/`false`/` TRUE `, a string parameter holding `True`, an integer next to it, and the pass-through of an invalid value. `python -m unittest serve.test_frontend serve.test_server` passes (306 tests on our machine). After the change the same request returns `{"raum": "Wohnzimmer", "an": true, "helligkeit": 40}`. ## Extra Notes Only the XML-style `<parameter=...>` path is touched; the JSON tool-call path (`json_tool_call`) already gets real JSON booleans. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:30:40 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3775
No description provided.