From d77825bfa82d17d15e6e8f7866a61c9e56c7db75 Mon Sep 17 00:00:00 2001 From: Yucheng Zhu Date: Wed, 26 Aug 2026 01:44:21 -0700 Subject: [PATCH] test(proxy): pass the read response to the non-inference predicate The poller test called is_unbilled_non_inference_call with the pre-background signature, so it broke when the predicate gained the response it classifies. It now hands the predicate a foreground read, and asserts that the same read is free without the origin stamp, so the stamp is what the test proves. --- tests/proxy_unit_tests/test_check_responses_cost.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/proxy_unit_tests/test_check_responses_cost.py b/tests/proxy_unit_tests/test_check_responses_cost.py index 9a1968e940a..e806e9a3394 100644 --- a/tests/proxy_unit_tests/test_check_responses_cost.py +++ b/tests/proxy_unit_tests/test_check_responses_cost.py @@ -787,5 +787,7 @@ class TestCheckResponsesCost: await check_responses_cost_instance.check_responses_cost() metadata = mock_aget.call_args[1]["litellm_metadata"] + foreground_read = {"background": False} assert metadata[INTERNAL_CALL_ORIGIN_METADATA_KEY] == "background_response_cost_poll" - assert is_unbilled_non_inference_call("aget_responses", metadata) is False + assert is_unbilled_non_inference_call("aget_responses", metadata, foreground_read) is False + assert is_unbilled_non_inference_call("aget_responses", None, foreground_read) is True