mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4754] [Engine] read typed scalar tool arguments the model writes in Python form #5164
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#5164
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/4754
Author: @Tsury
Created: 10/30/2026
Status: 🔄 Open
Base:
main← Head:fix-tool-scalar-args📝 Commits (1)
f80810b[Engine] read typed scalar tool arguments the model writes in Python form📊 Changes
3 files changed (+206 additions, -5 deletions)
View changed files
📝
serve/frontend.py(+43 -5)📝
serve/test_server.py(+22 -0)➕
serve/test_tool_argument_types.py(+141 -0)📄 Description
Problem and result
A model can write a scalar tool argument in a form that is not JSON:
False,None,+10.coerce_valuekeeps such a value as text, so a parameter declaredbooleanorintegerreaches the client as the string"False"or"+10". Strict clients refuse the call.After this change, the value is converted when the property's schema declares that type. A parameter declared
stringkeeps its text exactly. So do enum andanyOfproperties that are not declared with one of these types. A value that fits none of the declared types stays as it was.Related discussion
None found in issues or pull requests. It sits on top of the
coerce_valuework in v0.2.8.Approach
_coerce_tool_valuecallscoerce_valuefirst, then handles only the scalar literals thatcoerce_valueleft unchanged. The streaming path keeps the property's schema (sprops) so whole and streamed calls agree. This is not schema validation: valid JSON keeps its meaning.Validation
Passed:
main(870aedd9): 28 subtest and case failures. With the change: all pass.python -m unittest serve.test_tool_argument_types serve.test_server serve.test_structured: 373 tests pass (Linux, Python 3.14).Not run:
python -m unittest discover -s serveand any GPU or model run. This change was split from a maintained v0.2.8 build that runs on an RTX 5090 Laptop; the unit tests above are the evidence for this branch.Limits
Python-style
True/False/Noneare also accepted for a property that has no schema at all, where the value's type cannot be checked.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.