Repository navigation
feat: add max_retries to the messages handler factories - #214
Open
aknight-ld wants to merge 1 commit into
Open
aknight-ld wants to merge 1 commit into
aknight-ld wants to merge 1 commit into
Conversation
aknight-ld
force-pushed
the
AIC-3084-max-retries-passthrough
branch
from
October 27, 2026 14:24
3072cbf to
4bed864
Compare
aknight-ld
marked this pull request as ready for review
October 27, 2026 15:17
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.
Add in a max retries passthrough argument to let handler factories natively retry.
Note
Overview
Adds an optional
max_retriesknob on the messages handler factories (Claude, OpenAI, LangChain, LiteLLM) and their convenience wrappers, so callers can raise provider-level retries for bursty workloads (e.g. concurrent eval workers) without touchingmodel.parameters.Shared
validate_max_retriesinlaunchdarkly_ai_serverenforcesNoneor a non-negativeintat handler construction (including rejectingbool). Omitted values leave each SDK’s default unchanged;model.parameterscannot override the handler setting.Wiring differs by integration: native Anthropic/OpenAI clients get
max_retriesonly when set; LangChain applies it to auto-built chat models and errors if combined with a customllm; LiteLLM picksmax_retriesvsnum_retriesper route (OpenAI/Azure vs everything else) so retries stay on one layer.Reviewed by Cursor Bugbot for commit 4bed864. Bugbot is set up for automated code reviews on this repo. Configure here.