Skip to content

fix(llm): default Gemini supportsParallelTools to false - #212

Closed
yablokolabs wants to merge 1 commit into
AtomicBot-ai:mainfrom
yablokolabs:fix/gemini-parallel-tools-flag
Closed

yablokolabs wants to merge 1 commit into
AtomicBot-ai:mainfrom
yablokolabs:fix/gemini-parallel-tools-flag

Conversation

@yablokolabs

Copy link
Copy Markdown
Contributor

Summary

Follow-up to PR #207 (fixes #104). The review on #207 flagged that the provider-capability half of the fix is currently inert for Gemini — every built-in provider kind sets supportsParallelTools from supportsTools, and since Gemini supports tools, the capability is always true. The only provider that declared false was subscription-cli.

This adds an explicit supportsParallelTools?: boolean field to the provider config entry and the user config schema. Every provider kind reads it with fallback to supportsTools, but Gemini defaults to false — overriding the fallback. Users can explicitly set supportsParallelTools: true on a Gemini entry to opt in if their deployment supports it.

Changes

  • src/config/llm-config.ts — new supportsParallelTools?: boolean field on UserLlmProviderEntry + parser
  • src/config/config-schema.ts — schema acceptance for the new field
  • src/llm/provider/registry/provider-types.ts — new field on LlmProviderConfigEntry
  • src/llm/provider/registry/register-built-in-providers.ts — all kinds use entry.supportsParallelTools ?? entry.supportsTools ?? true; Gemini uses entry.supportsParallelTools ?? false

Test coverage

7 new tests:

  • Config: round-trip through parseLlmProviderEntry (explicit true and false), absent field stays undefined, non-boolean rejected
  • Registry: Gemini defaults supportsParallelTools to false, explicit true override respected

Verification

  • npm run lint clean
  • 909 tests pass across src/llm/, src/agent/, src/config/

…alse

The previous fix (PR AtomicBot-ai#207) threaded provider capabilities through to
the parallel_tool_calls wire, but every built-in provider kind set
supportsParallelTools from supportsTools — so Gemini (which supports
tools) always got true, and the capability term was inert for the exact
use case issue AtomicBot-ai#104 describes.

This adds an explicit supportsParallelTools?: boolean field to
LlmProviderConfigEntry and the user config schema. Every provider kind
reads it with fallback to supportsTools, but Gemini defaults to false
overriding that fallback. Users can explicitly set supportsParallelTools:
true on a Gemini entry to opt in.

7 new tests (3 config round-trip, 2 registry Gemini default/override,
2 rejection).
@sosidudku1

Copy link
Copy Markdown
Collaborator

Thank you @yablokolabs, and apologies for the month without a reply. The change is clean and well tested, but main has moved underneath it.

The case for defaulting Gemini to supportsParallelTools: false was #104: Gemini's OpenAI-compatible stream sent parallel calls without an index, and our consumer merged them into one call. That root cause was fixed in ce68f35 for #103. src/llm/provider/openai/openai-stream-consumer.ts now keys index-less deltas by their id, so distinct calls stay distinct, and GeminiProvider inherits that path. With the fix in place, turning parallel calls off for every Gemini user would cost latency without fixing a bug we know of.

So we are closing this one. If you still see merged or dropped calls with Gemini on v0.6.4, please open an issue with a captured stream and we will pick it up. A standalone supportsParallelTools override per provider entry, with no Gemini default, would be a fine small PR if you hit a provider that needs it.

@sosidudku1 sosidudku1 closed this Sep 24, 2026
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.

maxParallelToolCalls=1 still sends parallel_tool_calls: true to OpenAI-compatible providers

2 participants