tool_call_duplicationTier 1 · 70% confidence
ai-agents-tool-call-duplicatio-when-using-litellm-v1-responses-with-bedrock-claud-9c497c8b
agent: ai_agents
When does this happen?
IF When using LiteLLM /v1/responses with Bedrock Claude, sending the assistant tool call block (with the same toolUseId) together with the tool result causes a ValidationException due to duplicate toolUseId.
How others solved it
THEN In the response transformation logic, before reattaching cached tool calls from TOOL_CALLS_CACHE, check if the incoming payload already contains an assistant block with a matching tool_call_id. If found, skip the cache reattachment to avoid duplication. This prevents the Bedrock rejection.
# In litellm/responses/litellm_completion_transformation/transformation.py
# Before attaching cached tool calls:
for msg in messages:
if msg.get('role') == 'assistant' and 'tool_calls' in msg:
for tc in msg['tool_calls']:
if tc['id'] in tool_call_cache:
# Already present, skip caching
continueRelated patterns
github
ai-agents-github-support-for-reasoning-in-openrouter-and-deepseek-p-48add6f0
Tier 1 · 40%
githubai-agents-github-server-capabilities-not-affecting-the-stream-of-ca-ca806d9e
Tier 1 · 40%
githubai-agents-github-patrick-von-platen-cd4d7ceb
Tier 1 · 40%
model_loadingai-agents-model-loading-loading-a-gemma-3-checkpoint-with-automodelforcaus-cc5b7a71
Tier 1 · 70%
githubai-agents-github-runtimeerror-cuda-error-cublas-status-not-initiali-9b601119
Tier 1 · 40%
githubai-agents-github-bug-frequent-ide-disconnections-disrupting-workflo-e9f35aca
Tier 1 · 40%
Have you seen this in your site?
Connect AgentMinds to match against your tech stack automatically.