feat(retry): restore legacy uipath-langchain-python chat-client retry parity#107
Open
vldcmp-uipath wants to merge 2 commits into
Open
feat(retry): restore legacy uipath-langchain-python chat-client retry parity#107vldcmp-uipath wants to merge 2 commits into
vldcmp-uipath wants to merge 2 commits into
Conversation
…orts The RetryableHTTPTransport defaults were materially weaker than the legacy uipath-langchain-python chat-client retryers (BedrockRetryer) they replaced: 3 attempts / ~6s absorption window vs 5 attempts / ~75s, Retry-After honored only on 429, no 524, no connection-error retries. Throttling episodes the legacy client absorbed silently now surface as run failures - on the Bedrock path (pre-uipath-langchain-client 1.14.1) as the misleading "No 'output' key found in the response from the Bedrock Converse API" error. uipath-llm-client 1.17.0: - Default budget: 5 attempts, backoff 5s initial / 120s cap (~5/10/20/40s) - Retry-After / x-retry-after honored on any error status: caps the wait for every UiPathAPIError and forces a retry even on otherwise non-retryable statuses (explicit server retry request); retry_after moved from UiPathRateLimitError up to UiPathAPIError - HTTP 524 retryable again via new UiPathOriginTimeoutError; 529 kept - httpx ConnectError / ConnectTimeout / ReadTimeout retried (botocore equivalents were retried by the legacy retryer) uipath-langchain-client 1.17.0: - UiPathBaseLLMClient.max_retries default 3 -> 5; requires uipath-llm-client>=1.17.0 Note: uipath-langchain's chat_model_factory still passes max_retries=3 explicitly on the new-clients path; a companion bump there is needed for agent runs to get the full 5-attempt budget. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
53a9d4e to
466e5b2
Compare
Clarified the retry behavior and budget for the BedrockRetryer, including changes to retry attempts, backoff timings, and error handling. Signed-off-by: Vlad Cimpeanu <vlad.cimpeanu@uipath.com>
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.
Summary
The
RetryableHTTPTransportdefaults are materially weaker than the legacy uipath-langchain-python chat-client retryers (BedrockRetryer) they replaced. Throttling episodes the legacy client absorbed silently now surface as run failures.UiPathOriginTimeoutError)ConnectError,ConnectTimeout,ReadTimeout)Changes
uipath-llm-client 1.17.0
_DEFAULT_MAX_RETRIES3→5, initial delay 2s→5s, max delay 60s→120sretry_any(typed exceptions, server-requested-retry)— anyUiPathAPIErrorcarrying Retry-After is retried regardless of statusretry_afterproperty moved fromUiPathRateLimitErrorup toUiPathAPIError; wait strategy honors it for every API error (capped at max delay)UiPathOriginTimeoutError(524) in the taxonomy, mapped and exported; 529 unchangedhttpx.ConnectError/ConnectTimeout/ReadTimeoutuipath-langchain-client 1.17.0
UiPathBaseLLMClient.max_retriesdefault 3→5; dependency floor bumped touipath-llm-client>=1.17.0Not in this PR (follow-ups)
uipath-langchain'schat_model_factorystill passesmax_retries=3explicitly on the new-clients path — companion bump needed in uipath-langchain-python for agent runs to get the 5-attempt budget (backoff window, Retry-After, 524 and connection-error behavior from this PR apply regardless).Test plan
tests/core/features/test_retry.py: full default retry set pinned, Retry-After honored on any status, 403+Retry-After retried / plain 403 not, 524 retried, connect errors retried then raised, default 5-attempt budget end-to-endtests/langchain/features/test_default_max_retries.pyupdated to pin 5🤖 Generated with Claude Code