Repository navigation
fix(providers): forward default_headers to Anthropic/Bedrock clients - #38
Merged
Merged
Conversation
_build_anthropic dropped cfg['default_headers'] even though AnthropicClient accepts and forwards them for both the direct and Bedrock transports. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_build_anthropicdroppedcfg["default_headers"], althoughAnthropicClientalready passes them to bothAsyncAnthropicand the Bedrock transport. Gateway routing/auth headers therefore never reachedprotocol: anthropic/bedrockrequests.dict(cfg.get("default_headers") or {})); missing key →{}, same as before on the wire.Why
ApodexHarness PR #611 (Toolathlon) worked around this by turning
miroharness.infra.protocol_clientfrom a pure alias into a product adapter that re-implements the Anthropic builder and calls the private_enabled_thinking_budget. Once this ships and the pin is bumped, that shim can go back to an 8-line alias.Test plan
test_anthropic_builders_forward_default_headers(anthropic + bedrock, with and without headers)uv run pytest -q: 1572 passed, 2 skippeduv run ruff check .clean🤖 Generated with Claude Code