mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1955] [CLOSED] Tool calls: a boolean parameter written as True/False is a boolean #3775
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3775
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 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)
6fc26d8Tool 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/Falsereaches the client as a booleanSummary
With
huihui-ai/Huihui-Qwen3.8-Flash-Next-abliterated-GGUF(swift-IQ2_XS, engine 0.1.42, RTX 5090 Laptop) the model writes booleantool parameters the Python way:
parse_tool_callJSON-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 4calls 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 istrue/falsein any case (surrounding spaces ignored), it becomes a boolean. Everything else is unchanged: string parameters staystrings (
"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:BooleanToolArgumentscoversTrue/False/true/false/TRUE, a string parameter holdingTrue,an integer next to it, and the pass-through of an invalid value.
python -m unittest serve.test_frontend serve.test_serverpasses (306 tests on our machine). After the change the same requestreturns
{"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.