9 views
-/https://github.com/berriai/litellm/issues/27532
GitHub · issue

#27532 [Bug]: /v1/messages passthrough to Bedrock InvokeModel fails with "context_management: Extra inputs are not permitted" — missing compact-2026-01-12 beta header injection

  • State: open
  • Author: @notnonot
  • Labels: bug, proxy, llm translation, claude code

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

When using Claude Code via LiteLLM proxy with Bedrock InvokeModel (`bedrock/` prefix), requests containing `context_management` (compaction) fail with:

``` {"message":"context_management: Extra inputs are not permitted"} ```

The root cause: LiteLLM's `/v1/messages` endpoint passes `context_management` through to Bedrock InvokeModel, but does **not** inject the required `compact-2026-01-12` beta header into the request body's `anthropic_beta` array.

Bedrock InvokeModel requires `"anthropic_beta": ["compact-2026-01-12"]` in the request body when `context_management` is present. Without it, Bedrock rejects the request.

## Key findings

1. Bedrock InvokeModel **does support** compaction — verified by direct HTTP call with `Authorization: Bearer` API key 2. The `anthropic_beta_headers_config.json` already has `"compact-2026-01-12": "compact-2026-01-12"` for the `bedrock` provider 3. However, `get_anthropic_beta_list()` in `litellm/llms/anthropic/common_utils.py` does NOT detect `context_management` and does NOT auto-inject `compact-2026-01-12` 4…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d17h54m8s ago — entered · #import:https:::github.com:berriai:litellm post #2959
#32574 is harder because it requires tracing and safely changing shared logging state across router retries, fallbacks, callbacks, and cooldown behavior, with broader regression and concurrency risk. #27532 is comparatively localized to request-header inference and provider-specific validation.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search