mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-30 01:08:33 +00:00
* fix(anthropic): log the safeguards classifier and compaction summary calls in the parent request's session On /v1/messages, the safeguards classifier call and the compact_20260112 summary call each logged under a fresh session id, so their spend log rows never grouped with the Claude Code session that triggered them. The shared sub-call logging kwargs now carry the parent's top-level litellm_session_id and its resolved trace id. Metadata session keys stay out because deployment affinity reads them * fix(anthropic): keep a proxy-minted session out of the classifier's provider affinity header Carry the missing_session_id: generate marker into the safeguards classifier and compaction summary sub-call metadata, so a session the proxy minted is never sent upstream as an affinity header. The spend-row session test now asserts the row the Logs page groups by. * fix(anthropic): carry the parent's Langfuse trace and caller session to safeguards and compaction sub-calls * fix(anthropic): build the sub-calls' Langfuse trace from the live request, not the setup-time logging params The setup-time Logging params replaced the request's proxy_server_request with None and used Claude Code's Anthropic metadata.user_id in place of the proxy's litellm_metadata, so sub-calls joined a session-named trace instead of the parent call's. The merge order now matches the Responses path, where the request kwargs and litellm_metadata win * fix(anthropic): keep classifier and summary spend rows in the caller's session when it is sent in litellm_metadata or under missing_session_id omit * test(spend-logs): record the Rust golden row for a caller session under omit * fix(router): keep classifier and summary sub-calls out of the parent's routing session The sub-calls now carry the parent's session for logging, so Switchyard and the adaptive router would count them as turns of the caller's conversation. They are marked as inheriting the session, and both routers skip a session marked that way * fix(spend-logs): keep omit-mode session fallback to sub-calls that inherit it * fix(proxy): strip a client-sent inherited session marker --------- Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| native_budgets_golden | ||
| __init__.py | ||
| native_budgets_replica.py | ||
| test_background_interaction_settlement.py | ||
| test_baseline_accounting.py | ||
| test_budget_reservation.py | ||
| test_budget_reservation_redis_failure.py | ||
| test_budget_reservation_redis_failure_ledger.py | ||
| test_budget_reservation_rust.py | ||
| test_budget_reservation_rust_ledger.py | ||
| test_carried_budget_state.py | ||
| test_cloudzero_endpoints.py | ||
| test_committed_spend.py | ||
| test_compression_savings.py | ||
| test_cost_finalization.py | ||
| test_customer_budget_alerts.py | ||
| test_customer_cost_margin.py | ||
| test_customer_window_accounting.py | ||
| test_customer_window_accounting_rust.py | ||
| test_input_tokens.py | ||
| test_key_metadata_recovery.py | ||
| test_native_budget_checks.py | ||
| test_native_budgets.py | ||
| test_native_budgets_ledger.py | ||
| test_native_budgets_proxy_path.py | ||
| test_native_budgets_proxy_path_ledger.py | ||
| test_native_spend_log_row_type.py | ||
| test_performance_alerts.py | ||
| test_ptu_feature_flag.py | ||
| test_ptu_flat_cost_rollup.py | ||
| test_rust_spend_counters.py | ||
| test_savings.py | ||
| test_search_api_logging.py | ||
| test_session_page.py | ||
| test_session_spend_total.py | ||
| test_spend_capture_rate.py | ||
| test_spend_counter_batch.py | ||
| test_spend_counter_batch_ledger.py | ||
| test_spend_event.py | ||
| test_spend_event_producer.py | ||
| test_spend_log_error_logger.py | ||
| test_spend_logs_ledger_setting.py | ||
| test_spend_management_endpoints.py | ||
| test_spend_query_optimization.py | ||
| test_spend_tracking_utils.py | ||
| test_subscription_billing_periods.py | ||