From f9cb19ee04dd66d8bd465f3b0ab257dd680edbbf Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 8 Nov 2026 01:51:07 +0000 Subject: [PATCH] test(router): the regress5 single-attempt case uses ocr, and the sync responses() fallback note has its own case --- .../core/test_parity_regress5_errors.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/unit/test_router/core/test_parity_regress5_errors.py b/tests/unit/test_router/core/test_parity_regress5_errors.py index 3e8537af878..ae010d76518 100644 --- a/tests/unit/test_router/core/test_parity_regress5_errors.py +++ b/tests/unit/test_router/core/test_parity_regress5_errors.py @@ -118,8 +118,22 @@ def test_a_single_attempt_endpoint_raises_with_no_note(make_core: MakeCore, host show_router_debug(host) host.answer("openai/a", server_error()) with pytest.raises(litellm.InternalServerError) as raised: - core.responses(model="a", input="hi") # pyright: ignore[reportAttributeAccessIssue, reportUnknownMemberType] # an endpoint + core.ocr(model="a", document={"type": "document_url", "document_url": "https://example.test/a.pdf"}) # pyright: ignore[reportAttributeAccessIssue, reportUnknownMemberType] # an endpoint assert NOTE not in str(raised.value) + assert host.deployments_called() == ["a"] + + +def test_the_sync_responses_endpoint_falls_back_and_notes_the_failed_fallback( + make_core: MakeCore, host: EndpointHost +) -> None: + core: Final = build(make_core, fallbacks=[{"a": ["b"]}]) + show_router_debug(host) + host.answer("openai/a", server_error()) + host.answer("openai/b", server_error()) + with pytest.raises(litellm.InternalServerError) as raised: + core.responses(model="a", input="hi") # pyright: ignore[reportAttributeAccessIssue, reportUnknownMemberType] # an endpoint + assert f"{NOTE} 'a' failed with the error above. Fallback to b also failed" in str(raised.value) + assert host.deployments_called() == ["a", "b"] async def test_an_empty_request_list_says_no_fallbacks_are_configured(make_core: MakeCore, host: EndpointHost) -> None: