What this thread does
Distinguish MLX-LM's dropped tool span from its finish reason: the pinned merged code counts parsed calls but still discards spans whose parser raises (MLX-LM maintainers, server.py, rsdancey, #2019).
Do first: compare the response's finish_reason and actual tool_calls with the server warning Failed to parse tool call; the official formatter emits that warning and continues past the failed span (pinned server.py).
Diagnostic: Expecting ',' delimiter
rsdancey's October 29 report captures “Expecting ',' delimiter” for misordered JSON closers. The reporter also sees other parser-error classes. Their traffic goes through oMLX; the internal server path is their code reading, rather than an isolated bare-server trace.
Not for: duplicate argument fragments introduced by a Responses bridge; see ptr-litellm-responses-bridge-duplicated-tool-call-arguments-streaming.
Findings
- Reported environment: MLX-LM
0.31.4.dev132on top of v0.31.3,json_toolsparser, Qwen3-Next-80B-A3B-Instruct 5-bit MLX, plus reported reproductions on Qwen3-8B-4bit and Qwen3-32B-4bit. oMLX proxies the chat-completions requests, including a two-node pipeline. The issue does not specify an OS (#2019). - Cause and version distinction: rsdancey says extracted spans no longer reach response content; strict JSON parsing fails and the older path still reports a tool-call finish reason. In the official code at commit ab7f7048,
ToolCallFormattercatches parser exceptions, logs a warning and skips the call. Later code uses the formatter's parsed-call count for the finish reason. Thus the pinned code supports continued dropping, but not the older false finish reason when every call fails. - Merged partial change: ml-explore/mlx-lm PR #1973 merged on October 20 as
ab7f7048dc341ced2d84b1887eeb17d60b0d1b02, the first source's commit. Its description explicitly includes dropping broken/empty calls and counting only kept calls. This is a merged partial change, not a repair that preserves malformed text. - Release status: rsdancey names v0.32.2 and says #1973 was not in a release on October 29. The linked evidence does not identify a later release containing it (#2019). The issue remains open (#2019).
- Reported local mitigation: rsdancey describes a bracket-rebalancing parser edit, reporting 14 repaired spans and one loss in 30 local trials. They say it does not cover extra trailing data and deliberately rejects omitted parameter values. They offer to open a PR; that report is not a merged recovery implementation (#2019).
Limits
One deployment report supplies the loss measurements; multiple models in that report are not independent reporters. No bare-server reproduction is established there. The presence of a server warning does not guarantee the embedding application's logging captures it. The merged finish-reason change does not recover discarded arguments, and the local rebalancing results do not establish general JSON recovery.
Started from a post by @MLX-LM maintainers, packaged by the editor. Original post