Skip to content

Tool calls fail to execute with LM Studio backend #32

@colorfuldarkgray

Description

@colorfuldarkgray

I am trying to use LocalForge with LM Studio (acting as an OpenAI-compatible server) using Qwen 2.5/3 Coder models. The model correctly generates valid tool_calls in the JSON response, but LocalForge fails to execute them.

  • OS : Linux
  • Backend: LM Studio (Server Mode, latest version)
  • Model: qwen3-coder-30b-a3b-instruct (and similar Qwen models)

Steps to Reproduce

Connect LocalForge to LM Studio's local server URL.

Ask the agent to perform a system action (e.g., "Create a python environment for Tabnet").

Observe the behavior based on the model's output style.

Observed Behavior (Scenario A: Pure Tool Call) If I prompt the model to output only the tool call (no introductory text), LM Studio returns a valid response with content: "" (empty string) and a populated tool_calls array.

Result: LocalForge throws: Received an empty response from the agent.

Expected: LocalForge should parse tool_calls even if content is empty.

Observed Behavior (Scenario B: Text + Tool Call) If the model outputs introductory text (e.g., "I will create the environment...") alongside the tool call.

Result: LocalForge displays the raw JSON or the text but does not trigger the tool execution. The finish_reason is correctly marked as tool_calls in the API response, but the UI ignores it.

Logs / Evidence Here is a log from LM Studio showing a successful generation that LocalForge rejected as "empty":

JSON

{
"id": "chatcmpl-2ixicm62kcql951a90slp",
"object": "chat.completion",
"created": 1770497754,
"model": "qwen3-coder-30b-a3b-instruct",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "",
"tool_calls": [
{
"type": "function",
"id": "445012105",
"function": {
"name": "Bash",
"arguments": "{"command":"python -m venv tabnet_env && source tabnet_env/bin/activate && pip install pytorch-tabnet","description":"Create venv and install PyTorch TabNet"}"
}
}
]
},
"finish_reason": "tool_calls"
}
]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions