Skip to content

fix(llm): omit parallel_tool_calls on tool-less requests - #1029

Merged
0xallam merged 2 commits into
mainfrom
devin/1786278816-omit-parallel-tool-calls
Aug 9, 2026
Merged

fix(llm): omit parallel_tool_calls on tool-less requests#1029
0xallam merged 2 commits into
mainfrom
devin/1786278816-omit-parallel-tool-calls

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

Azure OpenAI rejects any chat.completions request that carries parallel_tool_calls without tools:

litellm.BadRequestError: AzureException BadRequestError - Invalid value for 'parallel_tool_calls': 'parallel_tool_calls' is only allowed when 'tools' are specified.

make_model_settings hardcodes parallel_tool_calls=False, and the openai-agents LiteLLM model forwards False even when tools=[], so every tool-less request fails on Azure. Since the scan preflight was added, that failure is fatal ("Scan failed") at startup. LiteLLM's drop_params does not drop this param (BerriAI/litellm#8980), so it must be omitted at the source.

 def make_model_settings(..., extra_headers=None,
+    has_tools: bool = True,
 ) -> ModelSettings:
     model_settings = ModelSettings(
-        parallel_tool_calls=False,
+        parallel_tool_calls=False if has_tools else None,  # None => omitted on the wire

The four tool-less call sites now pass has_tools=False: scan preflight (preflight_model_connection), dedupe-model warm-up, compaction _summarize, and finding dedupe _dedupe_model_settings. The agent loop is unchanged and keeps parallel_tool_calls=False.

Verified against a mock Azure endpoint enforcing the real invariant: before, the preflight sent {"parallel_tool_calls": false} with no tools and got the 400 above; after, the param is omitted and the preflight succeeds.

Link to Devin session: https://app.devin.ai/sessions/b7e52c0b8fbb4f148d2fb08fb00a1534
Requested by: @0xallam

@0xallam 0xallam self-assigned this Aug 9, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@greptile-apps

greptile-apps Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR conditionally omits parallel_tool_calls for requests without tools, preventing Azure OpenAI from rejecting startup preflight, warm-up, compaction, and finding-deduplication requests.

  • Adds a has_tools argument to the shared model-settings builder while preserving existing behavior for tool-enabled agents.
  • Marks all four known tool-less model call paths with has_tools=False.
  • Adds unit coverage for both tool-enabled and tool-less settings.

Confidence Score: 5/5

The PR appears safe to merge, with every identified tool-less caller updated consistently and no concrete regression found.

The shared default remains unchanged for the tool-enabled agent loop, while all four reachable calls that pass an empty tools list now request omission of the Azure-incompatible parameter.

Important Files Changed

Filename Overview
strix/core/inputs.py Adds the centralized tool-presence switch and maps tool-less requests to parallel_tool_calls=None.
strix/interface/main.py Marks the dedupe-model warm-up as tool-less, consistent with its empty tools list.
strix/interface/scan_setup.py Marks the startup model preflight as tool-less, preventing Azure from rejecting the request.
strix/llm/compaction.py Marks pure-text context summarization as tool-less without changing its token-limit settings.
strix/report/dedupe.py Marks finding-deduplication model requests as tool-less, consistent with the empty tools list.
tests/test_inputs.py Covers the settings-level behavior for both default tool-enabled calls and explicitly tool-less calls.

Reviews (1): Last reviewed commit: "fix(llm): omit parallel_tool_calls on to..." | Re-trigger Greptile

@usestrix usestrix deleted a comment from devin-ai-integration Bot Aug 9, 2026
@0xallam
0xallam merged commit ae07af6 into main Aug 9, 2026
1 check passed
@0xallam
0xallam deleted the devin/1786278816-omit-parallel-tool-calls branch August 9, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant