Repository navigation
fix(rerank): apply per-connection proxy and strip top_n for Voyage AI #7420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
kamenkadmitry
wants to merge
11
commits into
cheaper-inference:release/v3.8.49
from
careerfactory:fix/rerank-proxy-and-voyage-topn
Closed
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
01ab5d1
chore(ci): add .mergify.yml to main — Mergify only reads config from …
diegosouzapw fb24740
fix(ci): add the auto-enqueue pull_request_rule to the Mergify config…
diegosouzapw fb25ebd
fix(ci): migrate Mergify auto-enqueue to merge_protections_settings.a…
diegosouzapw a795694
fix(ci): drop Mergify batch settings (batching is a paid-tier feature…
diegosouzapw 9875ccf
fix(ci): merge queue tolerates the advisory dast-smoke failure (its G…
diegosouzapw 0065f1b
test(ci): make the #6634 selfref guard hermetic — main's copy hard-fa…
diegosouzapw ddd6d09
chore(quality): tighten main's coverage baseline to the CI's real num…
diegosouzapw bf8f20b
fix(rerank): apply per-connection proxy and strip top_n for Voyage AI
kamenkadmitry bf3baa4
fix(rerank): map top_n→top_k and add voyage response transformer
kamenkadmitry 98e9ac2
fix(rerank): log proxy resolution failures + add changelog fragment
kamenkadmitry 63eadb7
Merge remote-tracking branch 'upstream/release/v3.8.49' into fix/rera…
kamenkadmitry File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # Mergify merge queue — WS3.4/D5 of the v3.8.49 quality/velocity master plan. | ||
| # | ||
| # WHY: ~85-100 active PR authors/month and 300+ PRs/week peaks, all merged by ONE | ||
| # identity. The manual merge-train validated batches by hand; this queue automates | ||
| # it with batching + automatic batch bisection (a red batch of N costs ~log2(N) | ||
| # revalidations instead of N). Mergify Open Source plan: free, unlimited, public repo. | ||
| # | ||
| # GOVERNANCE (non-negotiable, mirrors CLAUDE.md Hard Rules #21/#22 + the owner's | ||
| # pre-merge ⭐ gate): | ||
| # • A PR enters the queue ONLY via the `queue` label — applied by the owner (or a | ||
| # session acting for the owner) AFTER the pre-merge ⭐ report/decision. The label | ||
| # IS the merge approval; Mergify only executes it. | ||
| # • During a release-freeze (open issue labeled `release-freeze`), do NOT label PRs | ||
| # targeting the frozen branch — the freeze is a human-honored coordination signal | ||
| # the queue cannot see. Retarget to the active release/vX+1 first (Hard Rule #21). | ||
| # • Never label a PR another session is actively working (Hard Rule #22b). | ||
| # • Fallback path if Mergify misbehaves or the OSS plan changes: the manual | ||
| # merge-train runbook (docs/ops/MERGE_TRAIN.md) — remove labels, proceed by hand. | ||
|
|
||
| # Auto-enqueue (current Mergify model, 2026): auto_merge_conditions in | ||
| # merge_protections_settings — the rules-based queue action / autoqueue path is | ||
| # deprecated (EOL 2026-07-16). The owner-applied `queue` label IS the approval. | ||
| merge_protections_settings: | ||
| auto_merge_conditions: | ||
| - label = queue | ||
|
|
||
| queue_rules: | ||
| - name: release | ||
| # Any current or future release branch — the reason GitHub's native queue was | ||
| # rejected (no wildcard support on personal-account repos). | ||
| queue_conditions: | ||
| - base~=^release/v\d+\.\d+\.\d+$ | ||
| - label=queue | ||
| - -draft | ||
| - -conflict | ||
| # "Everything that ran is green, nothing still running, AND the always-on | ||
| # anchor check succeeded" — robust to the path-filtered fast-gates (docs-only | ||
| # PRs skip code jobs; matrix shard names vary) while never fail-open: a PR with | ||
| # zero checks cannot vacuously merge, because `Merge integrity` runs on EVERY | ||
| # non-draft PR (quality.yml) and must be an affirmative success. Review approval | ||
| # is intentionally NOT a condition here: the owner-applied `queue` label IS the | ||
| # approval in this repo's single-maintainer model (see governance header). | ||
| merge_conditions: | ||
| # "Zero failures" — EXCEPT the advisory dast-smoke: it is continue-on-error by | ||
| # design and its GH-hosted CLI build hangs recurrently (drafts #7184/#7221 were | ||
| # dequeued solely by it). Any OTHER failure still blocks (anti-fail-open kept). | ||
| - or: | ||
| - "#check-failure=0" | ||
| - and: | ||
| - "#check-failure=1" | ||
| - check-failure=dast-smoke | ||
| - "#check-pending=0" | ||
| - "#check-success>=1" | ||
| - check-success=Merge integrity (changelog + generated skills) | ||
| # NO batching: 'Merge Queue Batch' requires a paid Mergify tier (live finding | ||
| # 2026-07-15 — the queue command fails with "Cannot use Merge Queue batch" on | ||
| # the free plan). Serial queue (1 PR at a time) still automates the train. | ||
| # Squash keeps the one-commit-per-PR history the CHANGELOG reconciliation expects. | ||
| merge_method: squash | ||
|
|
||
| pull_request_rules: | ||
| - name: clean up the queue label after merge | ||
| conditions: | ||
| - merged | ||
| actions: | ||
| label: | ||
| remove: | ||
| - queue |
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
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
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
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Voyage AI's rerank API uses
top_kinstead oftop_nto limit the number of returned results. Simply strippingtop_nmeans Voyage AI will return all reranked documents, ignoring the user's requested limit (which wastes bandwidth and processing, and returns more results than expected).Additionally, Voyage AI's response format returns
documentas a raw string (e.g.,"document text"), whereas the Cohere rerank format expects an object with atextproperty (e.g.,{"text": "document text"}). Since the default response path returns the provider's raw response directly, clients expecting a Cohere-compatible response will fail to parse the document text.We should:
top_ntotop_kintransformRequestForProvider.transformResponseFromProviderto format thedocumentfield as{"text": string}(or omit it ifreturn_documentsis false), and add standard Cohere metadata.Don't forget to update the unit tests in
tests/unit/rerank-providers-5332.test.tsto assert thattop_kis correctly mapped and present in the transformed request.Here is how you can implement the response transformer in
transformResponseFromProvider: