Skip to content

fix(ci): catch anthropic ImportError, pin acp <0.9, fix retry test#3312

Merged
teknium1 merged 1 commit intomainfrom
hermes/hermes-cd318db6
Mar 27, 2026
Merged

fix(ci): catch anthropic ImportError, pin acp <0.9, fix retry test#3312
teknium1 merged 1 commit intomainfrom
hermes/hermes-cd318db6

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

@teknium1 teknium1 commented Mar 27, 2026

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 the build_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)

acp 0.9.0 removed AuthMethod (replaced with AuthMethodAgent/AuthMethodEnvVar/AuthMethodTerminal). Our code uses AuthMethod(id=..., name=..., description=...) which doesn't map 1:1 to the new types. Pin to <0.9 until the new API is properly evaluated.

Fix 3: Update retry-exhaust test (test_anthropic_error_handling.py)

test_429_exhausts_all_retries_before_raising expected pytest.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 in final_response. Updated test to check final_response contains 429.

CI impact

  • Fix 1: resolves 7 local test failures (vision/codex auth chain)
  • Fix 2: resolves tests/acp/test_server.py import error in CI
  • Fix 3: resolves test_429_exhausts_all_retries_before_raising in CI
…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.
@teknium1 teknium1 merged commit ad764d3 into main Mar 27, 2026
1 of 2 checks passed
@teknium1 teknium1 changed the title fix(auxiliary): catch ImportError from build_anthropic_client in vision auto-detection Mar 27, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant