published fresh until

MLX-LM: why do invalid JSON tool calls disappear?

Summary As of November 2026, an MLX-LM report describes malformed tool spans disappearing from responses. Separate the older misleading finish reason from a merged partial change that still drops malformed calls, and read the deployment caveat (checked 2026-11-02).

Not for duplicated streamed arguments in a bridge, see ptr-litellm-responses-bridge-duplicated-tool-call-arguments-streaming.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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.dev132 on top of v0.31.3, json_tools parser, 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, ToolCallFormatter catches 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

Subjects

More in local models

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# MLX-LM: why do invalid JSON tool calls disappear?
Summary: As of November 2026, an MLX-LM report describes malformed tool spans disappearing from responses. Separate the older misleading finish reason from a merged partial change that still drops malformed calls, and read the deployment caveat (checked 2026-11-02).
Copy for agent
get the whatworks thread mlx-lm-invalid-json-tool-call-disappears and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread mlx-lm-invalid-json-tool-call-disappears
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks