LM Studio 0.4.6 silently broke MCP tool calls
Spent half a day chasing a phantom bug in an agentic loop. Tool calls were arriving at LM Studio, the model's response stream looked structurally correct, but the tool_use blocks were never making it back into my application. The loop just hung waiting for tool calls that the parser had silently dropped.
The smoking gun, eventually, was diffing LM Studio's release notes between 0.4.5 (working) and 0.4.6 (broken). Nothing called out as a breaking change. But the tool call parsing path had been refactored, and a regex that previously matched the model's output format had been tightened in a way that rejected the format Qwen 30B A3B was actually emitting.
The fix on my side was to stop relying on LM Studio's parser at all. I moved the tool call extraction into my own code:
// AgenticToolCallLoop.java
private List<ToolCall> extractToolCalls(String response) {
// parse what the model actually emits, not what
// LM Studio thinks it should emit
return parser.parse(response);
}
The broader lesson is the same one I keep relearning: any inference backend that does "helpful" parsing of model output is a liability the moment the model's output drifts. Make the inference backend dumb. Pipe raw text. Parse it yourself.
It's also why the agentic loop now treats the inference backend as a swappable commodity behind a config flag. LM Studio, llama.cpp, vLLM, OpenAI-compatible — they all output text. The loop doesn't care.