Commit Graph

3 Commits

Author SHA1 Message Date
Sameer Kankute 15351a93dc Fix: empty assistant message for converse API 2026-02-04 09:50:58 +05:30
Simon Lynch 07bffddbfa fix(bedrock): deduplicate toolResult and toolUse blocks in Converse message transformation (#20049)
Bedrock rejects requests when toolResult or toolUse blocks within a
single message contain duplicate IDs. The Converse message transformer
merges consecutive tool/assistant messages without checking for
duplicate toolUseId values, causing BedrockException errors.

Add _deduplicate_bedrock_content_blocks() — a generalized helper that
removes duplicate blocks by ID, logs a warning for each dropped
duplicate via verbose_logger, and preserves non-tool blocks (e.g.
cachePoint). Apply it at all four merge sites (sync/async × toolResult/
toolUse).

The Anthropic /messages path was fixed in PR #19324; this applies the
equivalent fix to the Bedrock Converse path.

Fixes #20048

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 18:23:43 +05:30
0x1f99d 1cce718551 fix(bedrock): deduplicate tool calls in assistant history (#15178) (#19324)
* fix: Avoid attaching tool calls when a call_id already exists

* fix: Prevent MCP responses from reviving past tool calls via previous_response_id

* test: Parametrize MCP streaming test to cover OpenAI and Anthropic models

* test: Fail MCP streaming test when LiteLLM logs errors during follow-up calls

* test: Let MCP tool-execution mock accept new kwargs for streaming tests

* chore: fix lint error

* docs: Add Google Workload Identity Federation (WIF) documentation to Vertex AI (#19320)

- Added new section documenting WIF support for Vertex AI authentication
- Included SDK and Proxy configuration examples
- Added sample WIF credentials file format for AWS federation
- Mentioned LLM Credentials UI as an alternative for credential management
- Added link to Google Cloud WIF documentation

Co-authored-by: Cursor Agent <cursoragent@cursor.com>

* fix(bedrock): deduplicate tool calls in assistant history (#15178)

* fix(types): add missing Set import to factory.py

---------

Co-authored-by: Yuta Saito <uc4w6c@bma.biglobe.ne.jp>
Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: YutaSaito <36355491+uc4w6c@users.noreply.github.com>
2026-01-19 10:56:49 -08:00