Repository navigation
Conversation
Qwen3.8 on exllamav3 writes `True` / `False` for boolean parameters. json.loads rejects them, so the call carried the string where the schema asks for a boolean. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012VGZjFp8LFECH1cWgdagpB
This branch has not been deployed
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.
Is your pull request related to a problem? Please describe.
With
tool_format: qwen3_coderand Qwen3.8 on exllamav3, the model writesTrue/False(Python spelling) for parameters the tool schema declares asboolean.coerce_param_valuetriesjson.loads, which rejectsTrue, and falls back to the plain string, so the tool call reaches the client with"recursive": "True"where the schema asks for a boolean. llama.cpp avoids it because its grammar forcestrue. Clients that validate arguments against the schema reject or retry the call.Why should this feature be added?
Now that
coerce_param_valueknows the declared type (#513 and the typed-parameter work), the declaredbooleanis the right place to accept the other spelling. It is local to that case: a declaredbooleanwhose value istrueorfalsein any capitalization becomes a boolean. Declared strings stay verbatim, other declared types are untouched, and untyped values keep the previous guess (Truestays a string).Examples
Before:
recursive = 'True'(str) in the parsed arguments of a call whose schema has"recursive": {"type": "boolean"}. After:recursive = True(bool). The new assertions intests/test_tool_param_types.pycoverTrue,False(with surrounding newlines),true, a non-boolean word underboolean(yesstays a string),Trueunderstring, and untypedTrue.Additional context
Passed:
tests/test_tool_param_types.py(12 tests, run withPYTHONPATH=.. python -m unittest test_tool_param_typesfromtests/); a live check against a Qwen3.8-27B EXL3 server on a 7900 XTX, where a request with a boolean-typed tool parameter returnedTrueas a bool (one check, one model).Not run:
ruff(not installed here; the lines respect the 100-column limit), the other tool formats, other models. Run from the repository root the same module fails on an unrelated import (test_tool_delta_streaming), also without this change.🤖 Generated with Claude Code
https://claude.ai/code/session_012VGZjFp8LFECH1cWgdagpB