Repository navigation
fix(llm): bound same-key recovery for proxy token lookup failures - #6226
Open
MuonChaser wants to merge 1 commit into
Open
MuonChaser wants to merge 1 commit into
MuonChaser wants to merge 1 commit into
Conversation
Co-authored-by: openhands <openhands@all-hands.dev>
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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.
HUMAN:
I confirm the scope of this fix: one additional retry for specific non-streaming proxy token-lookup authentication failures, while preserving persistent authentication errors. The reported local tests were run by Codex. I agree to submit this change for maintainer review.
AGENT:
Why
A specific LiteLLM proxy token-lookup 401 currently surfaces immediately even when the next request with the same key would succeed. A lookup miss can also mean invalid credentials; this change does not establish a cache race.
Summary
num_retries=0and keep changed-key refresh precedence.Issue Number
Fixes #6225 (bounded SDK recovery; no proxy root-cause claim).
How to Test
Offline loopback HTTP tests use fabricated tokens and actual LiteLLM normalization. No paid API or private Cloud access.
Results: 1,596 scoped tests passed; four subsequently added latest-error propagation cases also passed. Pre-commit, including Pyright, passed.
Reproduce the original symptom from this PR checkout:
Base: four failures with
LLMAuthenticationError. Fixed code: all four recover. Regressions also cover exact persistent attempt counts, unchanged/changed refresh hooks, disabled retries, generic auth, budgets/fallbacks, secret-free logs, repeated public calls, and partial-stream failure without replay.Video/Screenshots
Nonvisual SDK change; executable HTTP reproduction above.
Design Doc
Not applicable: scoped recovery guard with no public schema change.
Type
Notes
AI-assisted implementation and validation by Codex. Reporter Cloud observations are third-party evidence; proxy causality and live Cloud behavior were not verified. Historical events are unchanged. Final exact/domain searches found no competing implementation; merged #5218 covers changed-key refresh only.
Companion docs: OpenHands/docs#1004
Jev-Fast-Audit
⚡ Jev fast audit · estimates · 0.30s · commit fafc516
Strongest signal: Weakened authentication · 24% estimated likelihood.
Evidence: F001H004 · openhands-sdk/openhands/sdk/llm/llm.py:1891–1907.
Coverage: complete supplied coverage; 9/9 hunks, 3/3 files.
All estimates and evidence