Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(test): update circuit breaker test to account for bedrock/ prefix (#59301)

mendral-app[bot]237bdb2dbe7d
diff --git a/services/llm-gateway/tests/test_anthropic.py b/services/llm-gateway/tests/test_anthropic.py
index 5d655c8dc3c1..844110d07204 100644
--- a/services/llm-gateway/tests/test_anthropic.py
+++ b/services/llm-gateway/tests/test_anthropic.py
@@ -999,7 +999,10 @@ class TestAnthropicCircuitBreakerIntegration:
assert response.status_code == 200
assert mock_anthropic.call_count == 1
forwarded_model = mock_anthropic.call_args.kwargs["model"]
- assert forwarded_model.startswith(("us.anthropic.", "eu.anthropic.", "anthropic."))
+ # The model is prefixed with 'bedrock/' for litellm routing
+ assert forwarded_model.startswith("bedrock/")
+ bedrock_model = forwarded_model.removeprefix("bedrock/")
+ assert bedrock_model.startswith(("us.anthropic.", "eu.anthropic.", "anthropic."))
breaker.record_outcome.assert_not_called()
@patch("llm_gateway.api.anthropic.litellm.anthropic_messages")