fix(ci): catch anthropic ImportError, pin acp <0.9, fix retry test#3312
Merged
fix(ci): catch anthropic ImportError, pin acp <0.9, fix retry test#3312
Conversation
…on auto-detection _try_anthropic() caught ImportError on the module import (line 667-669) but not on the build_anthropic_client() call (line 696). When the anthropic_adapter module imports fine but the anthropic SDK is missing, build_anthropic_client() raises ImportError at call time. This escaped _try_anthropic() entirely, killing get_available_vision_backends() and cascading to 7 test failures: - 4 setup wizard tests hit unexpected 'Configure vision:' prompt - 3 codex-auth-as-vision tests failed check_vision_requirements() The fix wraps the build_anthropic_client call in try/except ImportError, returning (None, None) when the SDK is unavailable — consistent with the existing guard at the top of the function.
StreamOfRon
pushed a commit
to StreamOfRon/hermes-agent
that referenced
this pull request
Mar 29, 2026
…on auto-detection (NousResearch#3312) _try_anthropic() caught ImportError on the module import (line 667-669) but not on the build_anthropic_client() call (line 696). When the anthropic_adapter module imports fine but the anthropic SDK is missing, build_anthropic_client() raises ImportError at call time. This escaped _try_anthropic() entirely, killing get_available_vision_backends() and cascading to 7 test failures: - 4 setup wizard tests hit unexpected 'Configure vision:' prompt - 3 codex-auth-as-vision tests failed check_vision_requirements() The fix wraps the build_anthropic_client call in try/except ImportError, returning (None, None) when the SDK is unavailable — consistent with the existing guard at the top of the function.
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
Three fixes to make CI green.
Fix 1: Catch ImportError from build_anthropic_client (auxiliary_client.py)
_try_anthropic()caught ImportError on the module import but not on thebuild_anthropic_client()call. When the SDK isn't installed,build_anthropic_client()raises ImportError at call time, killing the entire vision auto-detection chain and causing 7 test failures locally.Fix 2: Pin agent-client-protocol <0.9 (pyproject.toml)
acp0.9.0 removedAuthMethod(replaced withAuthMethodAgent/AuthMethodEnvVar/AuthMethodTerminal). Our code usesAuthMethod(id=..., name=..., description=...)which doesn't map 1:1 to the new types. Pin to<0.9until the new API is properly evaluated.Fix 3: Update retry-exhaust test (test_anthropic_error_handling.py)
test_429_exhausts_all_retries_before_raisingexpectedpytest.raises(_RateLimitError)but the agent no longer re-raises after exhausting retries. The fallback-provider feature changed the behavior: try fallback → return result dict with error infinal_response. Updated test to checkfinal_responsecontains429.CI impact
tests/acp/test_server.pyimport error in CItest_429_exhausts_all_retries_before_raisingin CI