fix(agent): set retryable=False for auth errors in _classify_by_message - #7033
Closed
JiayuuWang wants to merge 1 commit into
Closed
fix(agent): set retryable=False for auth errors in _classify_by_message#7033JiayuuWang wants to merge 1 commit into
JiayuuWang wants to merge 1 commit into
Conversation
Auth errors (401/403) should not be retried with the same credential, matching the behavior of _classify_by_status(). The should_rotate_credential flag already signals the correct recovery action. Fixes NousResearch#7026. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
Closed in favor of #7027 which includes the same fix plus an explanatory inline comment. Your fix was identical and correct — thanks for the contribution, @JiayuuWang! |
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
In
agent/error_classifier.py, the_classify_by_message()function (the fallback path when no HTTP status code is available) marks auth errors asretryable=True. This is inconsistent with the_classify_by_status()path which correctly usesretryable=Falsefor 401/403 auth errors.Fix
Change
retryable=True→retryable=Falsein the auth pattern branch of_classify_by_message(). Auth errors indicate the credential is invalid; retrying with the same key will always fail. Theshould_rotate_credential=Truealready signals the correct recovery action.Impact
When an API response lacks an HTTP status code but contains an auth-related message, the classifier previously returned
retryable=Truefor auth failures. This caused:Fixing this aligns the message-based path with the status-code path behavior.
Test plan
pytest tests/agent/test_error_classifier.py -vretryable=FalseFixes #7026.