Repository navigation
fix(anthropic): send customHeaders from the model builder - #2920
Merged
Merged
Conversation
geoand
approved these changes
Oct 5, 2026
This comment has been minimized.
This comment has been minimized.
geoand
reviewed
Oct 10, 2026
This comment has been minimized.
This comment has been minimized.
Collaborator
|
Thanks. Can you please squash the commits? |
Apply the model builder's customHeadersSupplier through a ClientHeadersFactory so the Quarkus Anthropic client forwards custom gateway authentication headers. Cover both blocking and streaming requests with HTTP-level assertions. Fixes quarkiverse#2918
CryoThrust
force-pushed
the
fix/anthropic-custom-headers
branch
from
October 13, 2026 06:00
ab04c14 to
73b461b
Compare
Contributor
Author
|
Squashed into |
Status for workflow
|
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.
What does this PR do?
QuarkusAnthropicClientreplaced langchain4j's Anthropic client but never readbuilder.customHeadersSupplier, so headers passed through the model builder were dropped on the floor.QuarkusOpenAiClienthas applied them through aClientHeadersFactorysince #1927; the Anthropic client is the one that got missed.A gateway in front of Anthropic that authenticates on its own header therefore received unauthenticated calls, with no warning: the builder accepts the option and the call succeeds against anything that does not check the header.
How it was fixed
Same shape as the OpenAI client: when
customHeadersSupplieris set, register aClientHeadersFactorythat returns those headers for the outgoing request, before the REST API is built. Placing it next to the existingModelAuthProviderfilter keeps the ordering unchanged — the filter still adds the credential header afterwards, sox-api-key/Authorizationbehaviour is untouched.QuarkusAnthropicClientignorescustomHeadersfrom theAnthropicChatModel/AnthropicStreamingChatModelbuilder #2918