Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jan 29, 2026

Summary

This PR attempts to address Issue #11071 where GLM4.5 (and potentially other models) via LM Studio get stuck in a loop repeatedly reading the same file.

Root Cause

The issue was introduced in commit ed35b09 (Jan 29, 2026) which changed the parallel_tool_calls parameter default from false to true for the LM Studio handler. Not all models support this parameter, and when sent to models like GLM4.5 that do not support it, it can cause unexpected behavior such as the model getting stuck in a loop.

Solution

This fix changes the LM Studio handler to only include the parallel_tool_calls parameter when explicitly set to true (i.e., when metadata?.parallelToolCalls === true). This approach:

  1. Maintains compatibility with models that do not support parallel tool calls (e.g., GLM4.5)
  2. Still allows parallel tool calls when explicitly enabled for models that do support it
  3. Follows the same pattern used in commit 2d4dba0 for LiteLLM/Bedrock compatibility

Changes

  • Modified src/api/providers/lm-studio.ts to conditionally include parallel_tool_calls
  • Updated tests in src/api/providers/__tests__/lmstudio-native-tools.spec.ts to verify the new behavior

Testing

  • All existing tests pass
  • Tests verify that parallel_tool_calls is NOT included by default
  • Tests verify that parallel_tool_calls: true IS included when explicitly set

Fixes #11071

Feedback and guidance are welcome.


Important

LmStudioHandler now conditionally includes parallel_tool_calls only when explicitly enabled, fixing compatibility issues with certain models.

  • Behavior:
    • LmStudioHandler in lm-studio.ts now includes parallel_tool_calls only when metadata?.parallelToolCalls === true.
    • Ensures compatibility with models like GLM4.5 that do not support parallel_tool_calls.
  • Tests:
    • Updated lmstudio-native-tools.spec.ts to verify parallel_tool_calls is not included by default.
    • Added tests to confirm parallel_tool_calls: true is included when explicitly set.
  • Misc:

This description was created by Ellipsis for 332b66c. You can customize this summary. It will automatically update as commits are pushed.

This fixes an issue where GLM4.5 and other models via LM Studio get stuck
in a loop repeatedly reading the same file. The problem was introduced
in commit ed35b09 which changed parallel_tool_calls default from false
to true.

By only including the parallel_tool_calls parameter when explicitly set
to true, we maintain compatibility with models that do not support this
parameter (e.g., GLM4.5).

This follows the same pattern used in commit 2d4dba0 for LiteLLM/Bedrock
compatibility.

Fixes #11071
@roomote
Copy link
Contributor Author

roomote bot commented Jan 29, 2026

Rooviewer Clock   See task on Roo Cloud

Reviewed and no issues found. The fix correctly addresses the compatibility issue by only including parallel_tool_calls when explicitly enabled, allowing models like GLM4.5 that don't support this parameter to work without getting stuck in loops.

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[BUG] GLM4.5 via LMStudio as well as via an OpenAI-compatible endpoint stuck repeating file reads

1 participant