Skip to content

fix(bedrock): restore parallel_tool_calls mapping in map_openai_params#22333

Merged
jquinter merged 2 commits intomainfrom
fix/bedrock-parallel-tool-calls-map-params
Feb 28, 2026
Merged

fix(bedrock): restore parallel_tool_calls mapping in map_openai_params#22333
jquinter merged 2 commits intomainfrom
fix/bedrock-parallel-tool-calls-map-params

Conversation

@jquinter
Copy link
Contributor

Summary

  • The revert in 8565c70e53 removed parallel_tool_calls handling from map_openai_params
  • The subsequent fix d0445e1e33 only re-added the transform_request consumption (with is_claude_4_5_on_bedrock guard) but forgot to re-add the map_openai_params producer that sets _parallel_tool_use_config
  • This meant parallel_tool_calls=False was silently ignored for all Bedrock models
  • Restores both the supported params entry and the map_openai_params handler

Test plan

  • test_parallel_tool_calls_newer_model_adds_disable_flag passes
  • test_parallel_tool_calls_older_model_drops_disable_flag passes
  • CI passes

🤖 Generated with Claude Code

jquinter and others added 2 commits February 27, 2026 22:53
…ion behavior

Tests were asserting no response.create/conversation.item.create sent to
backend when guardrail blocks, but the implementation intentionally sends
these to have the LLM voice the guardrail violation message to the user.

Updated assertions to verify the correct guardrail flow:
- response.cancel is sent to stop any in-progress response
- conversation.item.create with violation message is injected
- response.create is sent to voice the violation
- original blocked content is NOT forwarded

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The revert in 8565c70 removed the parallel_tool_calls handling from
map_openai_params, and the subsequent fix d0445e1 only re-added the
transform_request consumption but forgot to re-add the map_openai_params
producer that sets _parallel_tool_use_config. This meant parallel_tool_calls
was silently ignored for all Bedrock models.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Feb 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Building Building Preview, Comment Feb 28, 2026 1:56am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 28, 2026

Greptile Summary

This PR restores the parallel_tool_calls parameter handling in Bedrock's map_openai_params that was lost during a revert/fix cycle (8565c70e reverted the original fix, and d0445e1e only re-added the transform_request consumer but not the map_openai_params producer). Without this fix, parallel_tool_calls=False was silently ignored for all Bedrock models.

  • Adds "parallel_tool_calls" back to get_supported_openai_params return list
  • Restores the map_openai_params handler that converts parallel_tool_calls to _parallel_tool_use_config (the internal representation consumed by transform_request)
  • Updates realtime streaming guardrail test assertions to match the current behavior where guardrails inject violation voice messages (response.cancel + conversation.item.create + response.create) rather than simply blocking responses
  • Both the newer-model and older-model test cases pass, verifying the is_claude_4_5_on_bedrock guard correctly gates the feature

Confidence Score: 5/5

  • This PR is safe to merge — it restores previously working functionality with proper test coverage.
  • The bedrock change is a straightforward restoration of code that was accidentally removed during a revert cycle. The implementation matches the established pattern for param handling in map_openai_params, and the transform_request consumer (with is_claude_4_5_on_bedrock guard) was already in place on main. Two dedicated tests verify both the newer-model and older-model paths. The realtime streaming test updates are assertion adjustments that align with current guardrail behavior.
  • No files require special attention

Important Files Changed

Filename Overview
litellm/llms/bedrock/chat/converse_transformation.py Restores parallel_tool_calls to supported params list and adds the map_openai_params handler that converts it to _parallel_tool_use_config. Clean, correct fix that matches the existing pattern used by other param handlers in the same method.
tests/test_litellm/litellm_core_utils/test_realtime_streaming.py Updates realtime guardrail test assertions to match new behavior where guardrails inject violation messages (response.cancel + conversation.item.create + response.create) instead of simply blocking. All tests use mocks, no network calls.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["User passes parallel_tool_calls=False"] --> B["get_supported_openai_params"]
    B -->|"'parallel_tool_calls' in list"| C["map_openai_params"]
    C -->|"Sets _parallel_tool_use_config"| D["optional_params"]
    D --> E["transform_request"]
    E --> F{"is_claude_4_5_on_bedrock?"}
    F -->|Yes| G["Merge into additionalModelRequestFields\n(disable_parallel_tool_use: true)"]
    F -->|No| H["Drop _parallel_tool_use_config\n(older models don't support it)"]
    G --> I["Send to Bedrock API"]
    H --> I
Loading

Last reviewed commit: aa899b5

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@jquinter
Copy link
Contributor Author

@shin-bot-litellm evaluate this PR

@jquinter jquinter merged commit 9278a31 into main Feb 28, 2026
31 of 35 checks passed
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