You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MLX: object-typed tool parameters returned as JSON strings in tool_calls arguments (MLX side of #75?) #87
Environment: Mac Studio M3 Ultra, 512 GB, macOS 27.2 · TensorFold 0.3.6.2 · MLX 0.32.2 · Vontra/Qwen3.8-Flash-Next-MLX-4bit-MTP, --parallel auto
What happens
When the model writes an object-typed tool parameter as JSON text, the MLX server returns it as a JSON string inside arguments instead of an object. The tool schema says "type": "object", so a client that parses arguments gets str where it expects dict. This looks like the MLX side of what #75 fixes for CUDA ("types Qwen tool parameters by the tool's schema").
Repro (non-streamed, deterministic: TensorFold's seeded sampling returns the same reply each time)
The same request without the "description" on script returns a proper object: {"job":{"name":"disk-check","schema":{"trigger":{…}}}}. The description changes the rendered prompt, which changes how the model writes the value; the parser then passes the text through.
oMLX 0.7.0.dev4 serving the same model (8-bit MTP) returns job as an object for both variants.
Suggested behaviour: decode a parameter's text as JSON when its schema type is object or array (and coerce integer / number / boolean), as #75 does for CUDA.
Thanks for the clear report! Fixed in 0.4.0: object and array tool arguments that the model leaves one closing bracket short are now closed, and kept when they then match the schema, so they come back as objects rather than JSON strings. Update with pip install -U git+https://github.com/ashhart/TensorFold.git. If you still see a string where an object belongs, reopen with the tool schema and we'll dig in.
Activity
MLX 0.32.3, faster Flash Next before M5, DeepSeek-V4 draft-head folde…
ashhart commentedon Sep 29, 2026
Thanks for the clear report! Fixed in 0.4.0: object and array tool arguments that the model leaves one closing bracket short are now closed, and kept when they then match the schema, so they come back as objects rather than JSON strings. Update with
pip install -U git+https://github.com/ashhart/TensorFold.git. If you still see a string where an object belongs, reopen with the tool schema and we'll dig in.docs: triage notes for parked upstream issues (ashhart#85, ashhart#87, …
MLX 0.32.3, faster Flash Next before M5, DeepSeek-V4 draft-head folde…