Skip to content

chore(release): backport #32956 onto patch-1.93.0rc1 for the 1.93.0 rc2 cut - #33499

Merged
yuneng-berri merged 1 commit into
patch-1.93.0rc1from
litellm_backport_1930rc2
Jul 16, 2026
Merged

yuneng-berri merged 1 commit into
patch-1.93.0rc1from
litellm_backport_1930rc2

Conversation

@yuneng-berri

@yuneng-berri yuneng-berri commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Relevant issues

Backports #32956 onto a fresh base branch cut from the v1.93.0-rc.1 tag, so the 1.93.0 rc2 build carries the fix. #32956 forwards AWS credential kwargs (region, access key, secret, session token, web identity token, role name, session name) from the top-level completion() call into litellm_params, so a chat request that is routed through the chat -> Responses API bridge keeps Web Identity Federation auth instead of dropping the deployment's credentials. It also adds the bedrock-mantle:CreateInference action to the STS session policy so the same path works for the responses-only bedrock mantle models. Carries the LIT-3859 fix.

The other PR originally requested for this line, #33248 (left-anchor the Create Key and Create Team CTAs), is intentionally NOT included: rc1 predates the Teams/Keys UI migration, so it renders OldTeams.tsx and the legacy keys page, not the migrated Teams.tsx / VirtualKeysTable.tsx that #33248 edits. The cherry-pick conflicts in every file and has nothing to attach to on this line, so it is dropped rather than hand-adapted.

Linear ticket

Resolves LIT-3859

Pre-Submission checklist

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review

What is included

No version bump: rc1's pyproject.toml already reads 1.93.0 and final v1.93.0 is unreleased (no v1.93.0 tag, no release/v1.93.0 branch, DockerHub v1.93.0 returns 404; only v1.93.0-rc.1 is published). The pick rides the pending 1.93.0; release tooling cuts v1.93.0-rc.2 from this branch. No production .tsx is touched, so there is no UI rebuild.

Base branch and provenance

Base is patch-1.93.0rc1, a new branch created at the exact v1.93.0-rc.1 commit (10d5804b); git diff v1.93.0-rc.1 patch-1.93.0rc1 is empty. The one commit on this PR carries a (cherry picked from commit c75fccf) footer and that SHA is reachable from litellm_internal_staging. No merge commits, no _experimental/out/ artifacts.

Known noise on this line

None on the targeted test set once boto3 is present in the env. A bare env without boto3 fails 22 bedrock/WIF tests with ModuleNotFoundError: No module named 'boto3'; that is an environment gap, not a code failure, and CI installs boto3.

Screenshots / Proof of Fix

The original ticket reproducer needs a live Web Identity Federation setup (a Google-issued OIDC token plus a real IAM role and a bedrock mantle deployment), which is not reproducible on a local dev box, so the end-to-end WIF replay lives in #32956 itself. On this backport branch the evidence is the pick's own tests passing on the rc1 code, plus a live-proxy sanity pass that the credential-forwarding path is intact.

Targeted test delta, captured at fba058b865 (the pick) versus 10d5804b (rc1 baseline):

# baseline (rc1, pre-pick), boto3 present
94 passed
# post-pick (same set + the pick's new tests)
100 passed, 0 failed

The pick's own new tests, all passing on rc1:

tests/test_litellm/test_main.py::test_acompletion_forwards_aws_credentials_through_responses_bridge[static_keys] PASSED
tests/test_litellm/test_main.py::test_acompletion_forwards_aws_credentials_through_responses_bridge[web_identity] PASSED
tests/.../test_web_identity_session_policy.py::TestBedrockMantleActionsCovered::test_bedrock_mantle_create_inference_present PASSED
tests/.../test_web_identity_session_policy.py::TestBedrockMantleActionsCovered::test_bedrock_mantle_statement_allows PASSED
tests/.../test_web_identity_session_policy.py::TestBedrockMantleActionsCovered::test_bedrock_mantle_statement_carries_secure_transport_condition PASSED
tests/.../test_web_identity_session_policy.py::TestBedrockMantleActionsCovered::test_no_bedrock_mantle_wildcard PASSED

Live proxy on the built branch (fba058b865), real API calls:

# non-AWS completion hot path still works after the forwarding change
$ curl -s localhost:4001/v1/chat/completions -H 'Authorization: Bearer sk-1234' \
    -d '{"model":"claude-haiku-4-5","messages":[{"role":"user","content":"Reply with exactly: rc2 ok"}],"max_tokens":20}'
-> "rc2 ok"

# real bedrock call: credentials are forwarded and reach AWS (rejected only because the
# dev .env AWS creds are stale); a broken-forwarding regression would surface as
# missing-credentials, not an AWS-side token rejection
$ curl -s localhost:4001/v1/chat/completions -H 'Authorization: Bearer sk-1234' \
    -d '{"model":"bedrock-claude-sonnet-4.5","messages":[{"role":"user","content":"Reply with exactly: bedrock ok"}],"max_tokens":20}'
-> BedrockException Invalid Authentication - {"message":"The security token included in the request is invalid."}

Adversarial behavioral review (deep mode, five independent lenses including three refutation passes) sealed a SURVIVED verdict with zero verified findings: every symbol the pick references resolves on rc1; a revert-to-red delta proof (reverting the forwarding line turns the WIF-forwarding test red, restoring it turns it green) confirms the pick actually delivers the fix on this line; and OPTIONAL_KWARGS_KEYS membership plus the _OPTIONAL_KWARGS_KEYS backward-compat alias are byte-identical pre and post pick, so no existing caller of completion, get_litellm_params, or BaseAWSLLM is broken. The real STS AssumeRoleWithWebIdentity exchange was mocked here (it needs live AWS WIF, which is exercised end-to-end in #32956), so that boundary is covered there rather than on this branch.

Type

🐛 Bug Fix

Changes

Cherry-pick of #32956 only. No hand-written code; the single commit is a verbatim -x -m 1 pick of the staging merge, plus this PR targets the new patch-1.93.0rc1 base branch cut from the rc1 tag.

fix(completion): forward aws credential kwargs into litellm_params so the responses bridge keeps WIF auth

(cherry picked from commit c75fccf)
@greptile-apps

greptile-apps Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This backport cherry-picks #32956 onto patch-1.93.0rc1 to fix Web Identity Federation auth for the bedrock_mantle provider route. Two distinct bugs are addressed: AWS credential kwargs were not being forwarded from completion() into litellm_params (so the chat→Responses API bridge lost WIF credentials), and the STS session-policy ceiling was missing the bedrock-mantle:CreateInference action (causing OIDC-auth requests to 403 at the session layer).

  • litellm/main.py: The single explicit aws_bedrock_project_id= kwarg is replaced by a dict expansion over AWS_CREDENTIAL_KWARGS_KEYS, forwarding all AWS credential kwargs into litellm_params so the Responses API bridge can use them.
  • litellm/litellm_core_utils/get_litellm_params.py: OPTIONAL_KWARGS_KEYS is refactored to expose AWS_CREDENTIAL_KWARGS_KEYS as a named subset; the original union of keys and the _OPTIONAL_KWARGS_KEYS alias are preserved for backward compatibility.
  • litellm/llms/bedrock/base_aws_llm.py: A new BedrockMantleLiteLLM statement is added to the STS inline session policy, allowing bedrock-mantle:CreateInference under the aws:SecureTransport=true condition.

Confidence Score: 5/5

The change is safe to merge: it forwards AWS credential kwargs that were previously dropped on the chat→Responses API bridge and adds one targeted IAM action to the STS session-policy ceiling.

All five changed files have a well-scoped, clearly motivated change. The credential forwarding in main.py uses a dict expansion over a named constant, which correctly reaches the sparse-extraction loop in get_litellm_params without any duplicate-key risk. The session-policy addition in base_aws_llm.py follows the same pattern as the existing ClaudePlatformLiteLLM statement. Tests cover both the credential-forwarding path (parametrized over WIF and static-key cases) and all four structural properties of the new policy statement, using only mocks with no real network calls. No existing tests appear weakened.

No files require special attention.

Important Files Changed

Filename Overview
litellm/litellm_core_utils/get_litellm_params.py Refactors OPTIONAL_KWARGS_KEYS to split out AWS_CREDENTIAL_KWARGS_KEYS as a named subset; the union preserves the original key set and the backward-compat alias is intact.
litellm/main.py Replaces the single explicit aws_bedrock_project_id= kwarg with a dict-expansion over all AWS_CREDENTIAL_KWARGS_KEYS, so every AWS credential kwarg is forwarded into litellm_params and reaches the Responses API bridge.
litellm/llms/bedrock/base_aws_llm.py Adds bedrock-mantle:CreateInference to the STS session-policy ceiling so OIDC/WIF requests to bedrock_mantle routes are not blocked at the session-policy layer.
tests/test_litellm/test_main.py New parametrized test verifies that acompletion forwards both WIF and static-key AWS credentials through the responses bridge, using respx/monkeypatch mocks only — no real network calls.
tests/test_litellm/llms/bedrock/test_web_identity_session_policy.py Adds TestBedrockMantleActionsCovered with four assertions covering presence, Effect, resource scope, and SecureTransport condition of the new BedrockMantleLiteLLM policy statement.

Reviews (1): Last reviewed commit: "Merge pull request #32956 from BerriAI/l..." | Re-trigger Greptile

@yuneng-berri
yuneng-berri merged commit b5cd431 into patch-1.93.0rc1 Jul 16, 2026
3 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_backport_1930rc2 branch July 16, 2026 04:36
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

achraf-mer pushed a commit to achraf-mer/litellm that referenced this pull request Sep 30, 2026
Brings h2o-main (upstream 1.93.0 release line + the h2o commits) up to the
upstream v1.99.4 release. The 1.93.0 release-line backports on our side
(BerriAI#33499, BerriAI#33847, BerriAI#33869, BerriAI#33904) are all present in v1.99.4 from main, so
every file only they touched takes upstream's version; the h2o changes are
re-applied on top of upstream's new code.

Conflicted files and their resolution:

- Dockerfile, docker/Dockerfile.database, docker/Dockerfile.non_root: upstream
  (the /opt/prisma bake from the 1.93 backports is in v1.99.4; no h2o lines).
- litellm-rust/Cargo.lock, litellm-rust/crates/python-bridge/src/lib.rs:
  upstream (release-line backport only).
- pyproject.toml, uv.lock: upstream. No h2o commit added a dependency.
- litellm/litellm_core_utils/core_helpers.py, get_litellm_params.py,
  litellm/llms/anthropic/experimental_pass_through/messages/transformation.py,
  litellm/main.py, litellm/proxy/utils.py, litellm/router.py,
  litellm/types/guardrails.py, litellm/proxy/guardrails/guardrail_hooks/
  model_armor/{__init__,file_scanning,model_armor}.py: upstream (release-line
  backports, e.g. coerce_token_limit / skip_unscannable_attachments, already
  in v1.99.4).
- tests/test_litellm/proxy/guardrails/guardrail_hooks/test_model_armor.py,
  tests/test_litellm/proxy/test_proxy_utils.py, tests/test_litellm/test_main.py,
  tests/test_litellm/test_router.py: upstream (same backports).
- litellm/litellm_core_utils/get_llm_provider_logic.py: upstream code, h2o
  redaction kept -- "dynamic_api_key needs to be a string." never echoes the
  key.
- litellm/proxy/auth/user_api_key_auth.py: upstream's %-style logging, h2o
  redaction kept -- the custom-header debug line no longer logs the
  (abbreviated) key.
- litellm/proxy/route_llm_request.py: upstream. The h2o lazy DB reload
  (reload_models_on_demand) is DROPPED: v1.99.4's route_request retries a
  ProxyModelNotFoundError through model_registry_read_through, which loads the
  missing model from the DB (bounded by a miss TTL and a resync budget).
  Upstream's read-through requires store_model_in_db=True.
- litellm/llms/bedrock/chat/converse_transformation.py: upstream's fix for the
  same bug as h2o h2oai#24 (the toolChoice / tool_choice.type conflict and the
  missing type): native toolConfig.toolChoice keeps the caller's choice and the
  passthrough drops its type. h2o's rework that deleted the native toolChoice
  is dropped in its favour. Re-applied on top: the guards upstream lacks -- no
  passthrough without MAPPED tools, for tool_choice="none", or for a non-bool
  parallel_tool_calls (_drop_parallel_tool_use_config_with_nothing_to_say).
- tests/test_litellm/llms/bedrock/chat/test_converse_transformation.py: both
  sides kept; the h2o tests re-pinned to upstream's design (native toolChoice
  carries the choice, passthrough carries only disable_parallel_tool_use); the
  test of the removed h2o builder is dropped.

Also, outside the conflicts:
- litellm/llms/gemini/count_tokens/handler.py: upstream; its own
  "if not contents" guard supersedes the h2o None check.
- litellm/llms/vertex_ai/vertex_llm_base.py: h2o base64 credentials kept,
  ruff-formatted.
- litellm/integrations/h2o/router/h2orouter_policy.py: docstring no longer
  names the removed reload_models_on_demand.
- gateway/routes/allowlist.py: the h2o /v1/router/models endpoint added to
  the gateway component (v1.99.4 splits routes across gateway/backend and
  test_component_allowlists fails on an uncovered route).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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