From 98c2d90f5c7d0770c183c3340a3517bc218bac77 Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Wed, 15 Apr 2026 12:23:33 -0700 Subject: [PATCH] fix(logging): update test_get_additional_headers to reflect provider header passthrough --- .../test_standard_logging_payload.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/logging_callback_tests/test_standard_logging_payload.py b/tests/logging_callback_tests/test_standard_logging_payload.py index 163e2d9435..4c3fcdc8fc 100644 --- a/tests/logging_callback_tests/test_standard_logging_payload.py +++ b/tests/logging_callback_tests/test_standard_logging_payload.py @@ -158,12 +158,15 @@ def test_get_additional_headers(): additional_logging_headers = StandardLoggingPayloadSetup.get_additional_headers( additional_headers ) - assert additional_logging_headers == { - "x_ratelimit_limit_requests": 2000, - "x_ratelimit_remaining_requests": 1999, - "x_ratelimit_limit_tokens": 160000, - "x_ratelimit_remaining_tokens": 160000, - } + # Typed rate-limit fields are coerced to int + assert additional_logging_headers is not None + assert additional_logging_headers.get("x_ratelimit_limit_requests") == 2000 + assert additional_logging_headers.get("x_ratelimit_remaining_requests") == 1999 + assert additional_logging_headers.get("x_ratelimit_limit_tokens") == 160000 + assert additional_logging_headers.get("x_ratelimit_remaining_tokens") == 160000 + # Provider-specific headers are preserved verbatim (not dropped) + assert additional_logging_headers.get("llm_provider-request-id") == "req_01F6CycZZPSHKRCCctcS1Vto" + assert additional_logging_headers.get("llm_provider-anthropic-ratelimit-requests-reset") == "2024-10-29T23:57:40Z" def all_fields_present(standard_logging_metadata: StandardLoggingMetadata):