Repository navigation
fix: honor bearer tokens in HTTP BGE rerankers - #2626
Merged
endxxxx merged 2 commits intoNov 18, 2026
Merged
Conversation
Collaborator
🤖 Open Code ReviewTarget: PR #2626 ✅ OpenCodeReview: Review complete: 0 finding(s) across 4 selected item(s). Generated by cloud-assistant via Open Code Review. |
This was referenced Nov 17, 2026
Collaborator
|
Thanks for wiring the configured Bearer token through both HTTP BGE rerankers. I pushed a follow-up in 8f109c1 to prevent Requests from replacing the configured token with Basic auth from .netrc when preparing the initial request. An explicit Authorization header in headers_extra still takes precedence, and requests without a configured token retain their existing behavior. I added regression coverage for both rerankers, and all 48 reranker tests passed on the development branch. |
endxxxx
approved these changes
Nov 18, 2026
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.
Description
Fixes #2625.
Configuring
tokenon either HTTP BGE reranker currently sends no Authorization header. Protected endpoints return 401 and the reranker silently falls back to the original order with zero scores. Both constructors already document bearer authentication.Add the bearer header when the token is nonempty, preserve explicit
headers_extraoverrides, and forward the existing option throughRerankerFactory.from_configfor both variants. No dependencies or API signatures change.Type of change
How Has This Been Tested?
poetry run pytest tests/reranker/ -q— 36 passed.make format— passed (643 files checked/formatted).The test runs real factory/constructor, strategy, ranking, Requests serialization/prepared headers and error handling. Only
requests.Session.sendis replaced with a controlled HTTP response that rejects missing authentication; no hosted model service was called.Full suite:
HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 make test— 1,017 passed, 9 skipped, 38 warnings. All optional dependencies were installed from the lockfile. The offline flags avoid downloading the unrelated Qwen example model intest_load_with_real_directory; no live-model success is claimed. The initial unrestricted run was interrupted while loading that example (472 passed, 8 skipped); the initial dev/test-only collection lacked optional Torch. Applicable actual commit hooks also pass.Checklist
Reviewer Checklist
Left for the reviewer; upstream checks and maintainer acceptance are pending.
AI assistance was used for investigation, implementation and local validation.