litellm/tests/logging_callback_tests
Ishaan Jaff 81dadb698a
Ishaan - March 18th changes (#24056)
* add DD Tracing (#24033)

* feat(models): add Azure GPT-5.4 mini and nano variants (#24045)

Add `azure/gpt-5.4-mini` and `azure/gpt-5.4-nano` to the model
database with official pricing from Azure OpenAI:

- GPT-5.4 mini: $0.75/M input, $0.075/M cached, $4.5/M output
- GPT-5.4 nano: $0.20/M input, $0.02/M cached, $1.25/M output

Both models support:
- 1.05M input / 128K output context window
- Chat, batch, and responses endpoints
- Function calling, tools, vision, reasoning
- Prompt caching with automatic tiered pricing

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* Add new model pricing details for volcengine Doubao-Seed-2.0 series (#23871)

Add entries for volcengine Doubao-Seed-2.0 series

* fix(mcp): support refresh_token grant type in OAuth token endpoint (#23701)

* fix(mcp): support refresh_token grant type in OAuth token endpoint (#23700)

The .well-known/oauth-authorization-server metadata advertises
refresh_token as a supported grant type, but the token endpoint
rejected it with HTTP 400. This adds refresh_token grant support
so MCP clients can refresh expired tokens without re-authenticating.

* test(mcp): add tests for refresh_token grant type in OAuth token endpoint

* fix(mcp): move code_verifier guard into authorization_code branch

code_verifier is only relevant for authorization_code grants (PKCE).
Move it inside the else branch so it doesn't apply to refresh_token.

* fix(mcp): guard None client_secret and forward scope in token exchange

- Conditionally include client_secret in form data to prevent httpx
  from sending the literal string "None" (applies to both
  authorization_code and refresh_token branches)
- Forward optional scope parameter per RFC 6749 §6, allowing clients
  to request a subset of originally-granted scopes on refresh

* fix(mcp): validate code param in authorization_code grant

Guard against None code being form-encoded as literal string "None"
by httpx, symmetric with the existing refresh_token guard.

* docs: add incident report for guardrail logging secret exposure (#24059)

Add blog post documenting the guardrail logging path exposing internal
request data (e.g. Authorization headers) in spend logs and OTEL traces.
Fix available in LiteLLM 1.82.3+.

Made-with: Cursor

* [Fix] Datadog LLM Observability tags format (env, service, version missing) (#23673)

* tag fix

* greptile comment

* fix(ci): stabilize 6 failing CI jobs

1. mypy: remove duplicate type annotation for token_data in discoverable_endpoints.py
2. integrations tests: add parameterized to CI test deps
3. doc quality: document OTEL_IGNORE_CONTEXT_PROPAGATION env key
4. security: allowlist CVE-2026-2673, CVE-2026-3644, CVE-2026-4224 (no fix available)
5. proxy_store_model_in_db: fix missing x-litellm-call-id header on error responses
6. google tests: add --retries 3 for transient Vertex AI rate limits

Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>

* fix(streaming): handle RuntimeError during model_copy in streaming handler

The race condition occurs when model_copy(deep=True) tries to deepcopy
_hidden_params dict while it's being concurrently modified by logging
callbacks. Fall back to shallow copy if the deep copy fails.

Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>

* fix(cost): handle non-string traffic_type in cost calculator + add retries

1. Fix AttributeError in _map_traffic_type_to_service_tier when traffic_type
   is an integer (cast to str before calling .upper()). This was causing
   pass-through vertex spend logging to fail silently.
2. Add --retries to llm_translation_testing for flaky external API calls.

Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>

---------

Co-authored-by: Emerson Gomes <emerson.gomes@thalesgroup.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: ExMatics HydrogenC <33123710+HydrogenC@users.noreply.github.com>
Co-authored-by: Jack Venberg <jack.venberg@rover.com>
Co-authored-by: milan-berri <milan@berri.ai>
Co-authored-by: Shivam Rawat <161387515+shivamrawat1@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
2026-03-19 10:20:35 -07:00
..
gcs_pub_sub_body fix(tests): update gcs pubsub v1 fixture with new SpendLogsMetadata fields (#21779) 2026-02-21 10:40:26 -08:00
langfuse_expected_request_body Add JSON exact match test for vLLM embeddings 2026-02-26 16:49:34 +05:30
base_test.py Litellm dev 11 11 2024 (#6693) 2024-11-12 00:16:35 +05:30
conftest.py Fix logging_testing: capture true defaults at conftest import time 2026-03-15 19:52:46 -07:00
create_mock_standard_logging_payload.py (fixes) datadog logging - handle 1MB max log size on DD (#6996) 2024-12-02 23:01:42 -08:00
gettysburg.wav (Testing) - Add e2e testing for langfuse logging with tags (#7922) 2025-01-22 09:09:25 -08:00
log.txt test: update test 2025-04-10 14:04:57 -07:00
test_alerting.py Replace deprecated model names in tests that were removed from remote model cost map 2026-03-12 14:12:07 -07:00
test_amazing_s3_logs.py fix tests 2025-10-25 10:19:24 -07:00
test_assemble_streaming_responses.py test(test_assemble_streaming_responses.py): update test to use correct type 2025-03-17 18:17:01 -07:00
test_azure_blob_storage.py (feat) Add Azure Blob Storage Logging Integration (#7265) 2024-12-16 22:18:22 -08:00
test_bedrock_knowledgebase_hook.py fix(tests): read CI_CD_DEFAULT_ANTHROPIC_MODEL env var instead of hardcoding model (#21781) 2026-02-21 10:46:49 -08:00
test_built_in_tools_cost_tracking.py fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
test_custom_callback_router.py fix tests 2025-10-25 10:19:24 -07:00
test_datadog.py Ishaan - March 18th changes (#24056) 2026-03-19 10:20:35 -07:00
test_datadog_llm_obs.py [Feat] Allow redacting message / response content for specific logging integrations - DD LLM Observability (#13158) 2025-07-31 16:44:16 -07:00
test_dynamic_otel_keys.py Litellm fix langfuse otel trace (#20382) 2026-02-03 22:40:19 -08:00
test_gcs_pub_sub.py Fix test_async_gcs_pub_sub_v1 2026-02-26 10:46:01 +05:30
test_generic_api_callback.py Add log_format parameter to GenericAPILogger (#18587) 2026-01-02 23:28:30 +05:30
test_humanloop_unit_tests.py HumanLoop integration for Prompt Management (#7479) 2024-12-30 22:26:03 -08:00
test_langfuse_e2e_test.py [Staging] - Ishaan March 17th (#23903) 2026-03-18 15:09:01 -07:00
test_langfuse_unit_tests.py add tests for fix 2026-03-15 00:58:08 +05:30
test_langsmith_unit_test.py Fix flaky test_langsmith_queue_logging: poll instead of fixed sleep 2026-03-15 20:25:11 -07:00
test_log_db_redis_services.py LiteLLM Minor Fixes & Improvements (12/05/2024) (#7037) 2024-12-05 00:02:31 -08:00
test_logging_redaction_e2e_test.py Reapply "feat: add model_cost aliases expansion support" 2026-03-12 13:36:57 -03:00
test_moderations_api_logging.py fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
test_opentelemetry_unit_tests.py Use already configured opentelemetry providers 2026-01-01 19:06:55 -08:00
test_otel_logging.py fix(test): update Phoenix OTEL test for dedicated TracerProvider architecture 2026-02-26 06:40:24 -05:00
test_pagerduty_alerting.py [Refactor] Make Pagerduty a free feature (#10857) 2025-05-15 10:12:06 -07:00
test_posthog.py posthog serilization fix (#20668) 2026-02-07 14:24:32 -08:00
test_spend_logs.py Fix CI: Revert security scan changes and add GitGuardian ignore rules (#18358) 2025-12-22 17:03:53 -08:00
test_sqs_logger.py Add Langfuse OTEL and SQS to health check (#16514) 2025-11-12 18:25:30 -08:00
test_standard_logging_payload.py Fix azure model router 2026-03-12 12:40:37 +05:30
test_standard_logging_payload_excluded_fields.py feat: add standard_logging_payload_excluded_fields config option (#20831) 2026-02-10 22:16:41 -08:00
test_token_counting.py test_stream_token_counting_anthropic_with_include_usage 2025-10-31 20:24:58 -07:00
test_unit_test_litellm_logging.py (performance improvement - litellm sdk + proxy) - ensure litellm does not create unnecessary threads when running async functions (#7680) 2025-01-10 17:57:22 -08:00
test_unit_tests_init_callbacks.py fix(logging): avoid shared callback list references (#20984) 2026-02-13 18:32:41 +05:30
test_view_request_resp_logs.py Fix CI: Revert security scan changes and add GitGuardian ignore rules (#18358) 2025-12-22 17:03:53 -08:00