Skip to content

fix: cap Retry-After, reject duplicate indices, trim baseURL slash - #18

Merged
TheGreatAxios merged 1 commit into
cl-9389-reranking-align-repo-scaffolding-with-the-package-standardfrom
cl-9449-reranking-harden-reply-and-retry-handling
Sep 27, 2026
Merged

TheGreatAxios merged 1 commit into
cl-9389-reranking-align-repo-scaffolding-with-the-package-standardfrom
cl-9449-reranking-harden-reply-and-retry-handling

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Closes CL-9449

  • extractRetryAfterMs clamps to [0, 60s], so a huge seconds value or a far-future date can no longer overflow the timer and fire immediately.
  • A reply that repeats an index is a protocol_mismatch RerankRequestError. Chose reject over dedupe: no supported provider repeats indices, so a repeat means a broken server, and a silent max-score dedupe would hide it.
  • apiStyle is resolved before the empty-docs short-circuit, so an unknown style throws on every call.
  • A trailing slash on baseURL is trimmed once in rerankDocuments, so built-in and custom adapters both get a clean root.

Tests for each were added first and failed before the fix.

Resolve apiStyle before the empty-docs short-circuit so a bad style
fails on every call. Refs CL-9449.
@TheGreatAxios
TheGreatAxios added this pull request to stack #15 September 27, 2026 02:02
@TheGreatAxios
TheGreatAxios merged commit 323d13f into main Sep 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant