Skip to content

fix(bedrock)!: backport #47429 pass-through guardrailConfig and the integration test fixes to lts/1.108.x - #50568

Merged
yuneng-berri merged 4 commits into
lts/1.108.xfrom
litellm_/recursing-jones-b2e294
Nov 9, 2026
Merged

yuneng-berri merged 4 commits into
lts/1.108.xfrom
litellm_/recursing-jones-b2e294

Conversation

@yuneng-berri

@yuneng-berri yuneng-berri commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Handwritten 1-3 sentence description

backports an adjusted 47429 into LTS 108

Details

TLDR

Problem this solves:

  • 19 integration tests on lts/1.108.x fail on helpers only main has
  • The MCP progress and cancel test flakes on an SDK teardown race
  • /bedrock pass-through ignores the deployment's guardrailConfig, so calls go unguarded
  • The Together replay e2e test pins MiniMax-M3, which Together retired on 2026-11-06

How it solves it:

Intentional product change: on /bedrock/model/{name}/converse, converse-stream, invoke and invoke-with-response-stream, a deployment's guardrailConfig now reaches Bedrock and replaces any guardrail the caller sent. Callers lose the ability to swap in their own guardrail on a guarded deployment

User Flow

Before: a developer can skip a deployment's Bedrock guardrail by calling it through the pass-through route

  1. The admin adds a Bedrock deployment with guardrailConfig set, and /v1/chat/completions on it is blocked by that guardrail
  2. A developer sends POST https://litellm-domain/bedrock/model/{name}/converse with the same prompt
  3. Bedrock gets the request with no guardrail, or with whatever guardrail the developer put in the body or headers, and answers it
  4. The spend row bills the model call only, with no guardrail trace cost

After: the same pass-through call runs under the deployment's guardrail

  1. The admin keeps the same deployment
  2. The developer sends the same POST https://litellm-domain/bedrock/model/{name}/converse, or the invoke and streaming variants
  3. Bedrock gets the deployment's guardrail, in the body for Converse and as signed X-Amzn-Bedrock-Guardrail* headers for Invoke, and blocks the request
  4. The spend row includes the guardrail trace cost, and a deployment guardrail that cannot be sent on Invoke comes back as a 400

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*, make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • Every automated review on my PR's latest commit has finished, and I have addressed or replied to each of its findings before requesting a maintainer review

Adaptation notes

#49967's import hunk conflicted because the line keeps that test's local imports in a different order. It resolves to the line's order with _acknowledge_notifications_after_dispatch added, and the helper already exists in the line's tests/integration/_support/mcp.py. The client.py hunks are applied by hand. Main's Gateway also has a workers field from a later change, and that field is left out because nothing on the line reads it. Owned proxies on the line share the session database, so database_url=None makes rows() read the same database the proxy writes

#47429 sits on top of #47040 on main, and the line has neither the request metadata header nor _bedrock_endpoint_action. The signer here derives the action from the last path segment inline and merges only the guardrail headers through merge_bedrock_invoke_headers. The wire integration test and the passthrough/main.py hunk are identical to main. The unit tests drop the request metadata assertions and the identity argument that only #47040 needs, and add a trailing-slash converse case. bedrock_invoke_guardrail_headers is already public on the line, so main's rename is not needed

d06f5a5 was cherry-picked from #50601's branch commit 90f7ab6 before the PR merged. Its diff is identical to the merged commit 1d06a1c on main

Screenshots / Proof of Fix

E2E exception for the test-only part. The proof is the affected integration tests themselves, which each start a real proxy against a real Postgres, with Bedrock answered by the harness's scripted fake. Both sides ran in the same local env, tests/integration/run.py <group> --workers 2 from this worktree with its own Python 3.12 venv, a throwaway Postgres and no license

Launcher (same for every run)
env -i PATH=$TREE/.venv/bin:/usr/bin:/bin:/opt/homebrew/bin HOME=$HOME \
  PYTHONPATH=$TREE:$TREE/tests:$TREE/tests/e2e INTEGRATION_PYTHON=$TREE/.venv/bin/python \
  LITELLM_LOCAL_MODEL_COST_MAP=True LITELLM_MODE=PRODUCTION STORE_MODEL_IN_DB=True DO_NOT_TRACK=1 AWS_EC2_METADATA_DISABLED=true \
  LITELLM_MASTER_KEY=<random> LITELLM_SALT_KEY=sk-integration-salt \
  DATABASE_URL=postgresql://postgres@127.0.0.1:55432/postgres \
  INTEGRATION_PROXY_DATABASE_URL= INTEGRATION_PROXY_READ_REPLICA_URL= INTEGRATION_ROUTING= INTEGRATION_PEER_URL= \
  $TREE/.venv/bin/python tests/integration/run.py <group> --workers 2 --results <dir> <node ids>

Groups and node ids per case:

  • snapshot: accounting tests/integration/spend/test_failing_request_stored_snapshot.py
  • disconnect: extensions "tests/integration/observability/test_guardrail_effects.py::test_client_disconnect_during_the_body_upload_runs_no_endpoint_and_writes_no_spend_row"
  • Bedrock: providers tests/integration/providers/test_bedrock_native_guardrail_trace_spend.py tests/integration/providers/test_bedrock_passthrough_guardrail_config_wire.py
  • MCP: mcp "tests/integration/mcp/test_mcp_transports.py::test_sdk_progress_and_cancellation_reach_upstream_without_losing_session", run 5 times

Before (b7d579f)

Stored snapshot after retries and fallback

  1. Ran the snapshot case
  2. 1 failed, KeyError: 'x-litellm-call-id', the same failure as GHA run 42404569916

Client disconnect during body upload

  1. Ran both disconnect params
  2. 2 failed, both AttributeError: 'Gateway' object has no attribute 'rows'

Bedrock pass-through guardrail

  1. Ran the trace spend file at b7d579f
  2. 16 failed, all AttributeError: 'Gateway' object has no attribute 'rows'
  3. With only the test helpers applied (52f49b8), 5 failed, 11 passed. The 5 are the pass-through cases and fail on assert 0.007 == 0.0078, because the deployment's guardrail never reached Bedrock

MCP progress and cancellation

  1. Ran the MCP case 5 times
  2. 6 passed each time. The flake did not reproduce locally, and it failed once in CI on attempt 1 of run 42404569916

Together reasoning replay (live Together, Buildkite litellm-e2e build 833 at 52f49b8)

  1. Ran the full e2e suite against the line
  2. test_replayed_reasoning_content_reaches_together failed with a 400 from Together, "Endpoint has no deployments configured for routing", code endpoint_not_configured

After (4fb2f02, tip d06f5a5)

The integration cases ran at 4fb2f02. The tip only adds the Together e2e repin on top, which none of those integration tests import

Stored snapshot after retries and fallback

  1. Ran the snapshot case
  2. 1 passed

Client disconnect during body upload

  1. Ran both disconnect params
  2. 2 passed

Bedrock pass-through guardrail

  1. Ran the trace spend file and the new wire file together
  2. 36 passed, 2 skipped. The 2 skips are the file's own pytest.skip for the caller-header case on invoke, which main skips the same way

MCP progress and cancellation

  1. Ran the MCP case 5 times
  2. 6 passed each time

Together reasoning replay (live Together, Buildkite litellm-e2e-pr build 2199)

  1. Ran llm_translation/test_together_ai_e2e.py against the line with the repin applied
  2. 14 passed. That run's commit changed only the model constant, and d06f5a5 adds the same constant change plus the matching docstring wording

Type

🐛 Bug Fix
✅ Test

Caveats (if any)

Severe

  • Breaking change on /bedrock pass-through for guarded deployments
    • The caller's guardrail is replaced by the deployment's
    • An Invoke deployment guardrail with no identifier, or a non-object value, now returns 400 instead of going out unguarded

Low

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

…and MCP ack fix to lts/1.108.x

Backports test-only changes from main so the line's integration signal stops reporting stale helpers as failures.

Gateway.database_url and Gateway.rows come from #47213 (fc27dfd), and the name keyword on Scenario.model comes from #48917 (ebf84f8). Only those hunks of tests/integration/_support/client.py are taken. The rest of #47213 gives each owned proxy its own database and Redis, which none of the line's tests need, and the workers field from a later main change is left out.

The MCP progress and cancellation test wraps its upstream in _acknowledge_notifications_after_dispatch, from #49967 (b5952f2). The helper is already on the line.
@yuneng-berri
yuneng-berri requested a review from a team November 7, 2026 22:42
@codecov

codecov Bot commented Nov 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

… pass-through routes to lts/1.108.x

The router-model pass-through dropped a Bedrock deployment's guardrailConfig, so converse, converse-stream, invoke and invoke-with-response-stream reached Bedrock unguarded while /v1/chat/completions on the same deployment was blocked. The signer now sends it the way Bedrock reads it, in the body for Converse and as the X-Amzn-Bedrock-Guardrail* headers for Invoke, replacing any guardrail the caller sent

Adapted to the line, which does not have #47040. The guardrail headers are merged through merge_bedrock_invoke_headers without the request metadata header, and the unit tests drop the request metadata assertions and the identity argument that only #47040 needs
@yuneng-berri yuneng-berri changed the title test(integration): backport main's Gateway.rows, Scenario.model name and MCP ack fix to lts/1.108.x fix(bedrock)!: backport #47429 pass-through guardrailConfig and the integration test fixes to lts/1.108.x Nov 8, 2026
…1-Flash

MiniMax-M3 reached its 2026-11-06 deprecation date in the cost map, which names MiniMax-M3.1-Flash as its successor

(cherry picked from commit 90f7ab6)
@yuneng-berri
yuneng-berri merged commit 842ab91 into lts/1.108.x Nov 9, 2026
65 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_/recursing-jones-b2e294 branch November 9, 2026 19:23
doonga pushed a commit to greyrock-labs/home-ops that referenced this pull request Nov 10, 2026
…08.4) (#715)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/berriai/litellm](https://images.chainguard.dev/directory/image/wolfi-base/overview) ([source](https://github.com/BerriAI/litellm)) | patch | `v1.108.2` → `v1.108.4` |

---

### Release Notes

<details>
<summary>BerriAI/litellm (ghcr.io/berriai/litellm)</summary>

### [`v1.108.4`](https://github.com/BerriAI/litellm/releases/tag/v1.108.4): 1.108.4 (LTS)

[Compare Source](BerriAI/litellm@v1.108.3...v1.108.4)

> \[!TIP]
> The `lts` image tag always points to the latest LTS release. Pull `ghcr.io/berriai/litellm:lts` to stay on the newest LTS patch

#### Verify this release

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/e82a3c646908ba0a6ee0beddc4310d7a6cac4065/cosign.pub \
  ghcr.io/berriai/litellm:v1.108.4
```

Same command for `litellm-database`, `litellm-non_root` and the `docker.io/litellm/*` images

#### What's new in 1.108.4 (LTS)

10 PRs. 7 fixed, 1 changed. No action needed to upgrade

##### Changes

- **AWS Bedrock:** Fixed 400s from GLM, GPT-6 Luna and Nova 2 on Bedrock when the conversation carries Claude's signed thinking ([#&#8203;50399](BerriAI/litellm#50399))
- **AWS Bedrock:** Changed `/bedrock` pass-through routes to enforce the model's `guardrailConfig` over any guardrail the caller sends ([#&#8203;47429](BerriAI/litellm#47429))
- **Vertex AI and Gemini:** Fixed Vertex AI Claude batches failing with 404 at create ([#&#8203;50365](BerriAI/litellm#50365))
- **Messages API:** Fixed `chatgpt/` models on `/v1/messages` dropping encrypted reasoning between turns ([#&#8203;50456](BerriAI/litellm#50456))
- **Messages API:** Fixed `/v1/messages` to OpenAI sending `background: true` upstream, which billed full runs that came back empty ([#&#8203;50462](BerriAI/litellm#50462))
- **Embeddings, images and audio:** Fixed `/v1/videos` polls failing with per-model keys or hitting the wrong provider account with a 404 ([#&#8203;44614](BerriAI/litellm#44614))
- **Routing and fallbacks:** Fixed team keys being served by a proxy-wide wildcard instead of the team's own BYOK wildcard deployment ([#&#8203;48490](BerriAI/litellm#48490))
- **SDK:** Fixed `completion()`, `responses()` and `messages` with tools failing with `No module named 'mcp'` on a base install, broken since v1.106.0 ([#&#8203;45961](BerriAI/litellm#45961))

***

Backport [#&#8203;50568](BerriAI/litellm#50568) · Backport [#&#8203;50605](BerriAI/litellm#50605) · Backport [#&#8203;50693](BerriAI/litellm#50693) · [Full changelog](BerriAI/litellm@v1.108.3...v1.108.4)

### [`v1.108.3`](https://github.com/BerriAI/litellm/releases/tag/v1.108.3): 1.108.3 (LTS)

[Compare Source](BerriAI/litellm@v1.108.2...v1.108.3)

> \[!TIP]
> The `lts` image tag always points to the latest LTS release. Pull `ghcr.io/berriai/litellm:lts` to stay on the newest LTS patch

#### Verify this release

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/e82a3c646908ba0a6ee0beddc4310d7a6cac4065/cosign.pub \
  ghcr.io/berriai/litellm:v1.108.3
```

Same command for `litellm-database`, `litellm-non_root` and the `docker.io/litellm/*` images

#### What's new in 1.108.3 (LTS)

11 PRs. 3 fixed. No action needed to upgrade

##### Changes

- **AWS Bedrock:** Fixed every request failing on a Bedrock deployment with `api_base: ""`, which answered 500 or 400 ([#&#8203;50449](BerriAI/litellm#50449))
- **MCP:** Fixed tool results over 1 MiB failing with `SSE stream ended without a response`, broken since v1.103.0 ([#&#8203;47034](BerriAI/litellm#47034))
- **Guardrails:** Fixed model-level `post_call` guardrails checking each response twice and calling the moderation provider twice ([#&#8203;50463](BerriAI/litellm#50463))

***

Backport [#&#8203;50484](BerriAI/litellm#50484) · Backport [#&#8203;50487](BerriAI/litellm#50487) · [Full changelog](BerriAI/litellm@v1.108.2...v1.108.3)

</details>

---

### Configuration

📅 **Schedule**: (in timezone America/New_York)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yMjIuNSIsInVwZGF0ZWRJblZlciI6IjQ0LjIyMi41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19-->

Reviewed-on: https://git.greyrock.io/todd/home-ops/pulls/715
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.

2 participants