fix(agent): exclude ssl.SSLError from local validation error check#14434
Closed
nftpoetrist wants to merge 1 commit into
Closed
fix(agent): exclude ssl.SSLError from local validation error check#14434nftpoetrist wants to merge 1 commit into
nftpoetrist wants to merge 1 commit into
Conversation
ssl.SSLCertVerificationError inherits from SSLError → OSError → ValueError. The is_local_validation_error guard incorrectly classified certificate errors as programming bugs and triggered a non-retryable abort, even though the error classifier already returns retryable=True for all OSError subclasses. Fix: add ssl.SSLError to the exclusion tuple alongside UnicodeEncodeError. Add import ssl (stdlib, no new dependency). Fixes NousResearch#14367
Collaborator
Contributor
Author
|
Closing in favor of the earlier #14374 which covers the same fix. |
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.
What does this PR do?
ssl.SSLCertVerificationErrorinherits fromSSLError → OSError → ValueError. Theis_local_validation_errorguard inrun_agent.pycaught it viaisinstance(api_error, ValueError)and triggered a non-retryable abort — even though the error classifier already returnsretryable=Truefor allOSErrorsubclasses (transport heuristic, step 7).The inline
isinstancecheck fires beforeclassified.retryableis consulted, so the classifier's correct verdict is overridden. Fix: addssl.SSLErrorto the exclusion tuple alongside the existingUnicodeEncodeError, mirroring the same pattern already in place.Related Issue
Fixes #14367
Type of Change
Changes Made
run_agent.py: addimport ssl(stdlib, no new dependency); extend exclusion tuple to(UnicodeEncodeError, ssl.SSLError)with inline comment explaining the MROtests/run_agent/test_14367_ssl_local_validation.py: new test file covering the reported case (SSLCertVerificationError), the parent class (ssl.SSLError), the MRO prerequisite, the preservedUnicodeEncodeErrorexclusion, and regression checks that plainValueError/TypeErrorremain local errorsHow to Test
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/A