litellm/litellm
ryan-crabbe-berri a507394841
fix(ui): find logs by request id across pages and dates (LIT-3981) (#31743)
* fix(spend): resolve spend logs by request_id across all dates (LIT-3981)

The /spend/logs/ui search only filtered the page already loaded, so a log id
copied from another page or from outside the active date window could not be
found. request_id is the primary key of LiteLLM_SpendLogs, so when it is
supplied on the internal UI route the mandatory date window is dropped and the
lookup resolves across all time. The date window stays required when no
request_id is given, and the public /spend/logs/v2 contract is unchanged.

A non-admin id lookup is gated by the same ownership check the detail endpoint
uses, so the relaxed window cannot be used to read another tenant's log by id

* fix(ui): send the logs request_id search to the server (LIT-3981)

The "Search by Request ID" box filtered only the rows already on the current
page, so an id from another page never matched. It now feeds the existing
server-side request_id filter via handleFilterChange, which debounces, resets
to page one, and rides the existing react-query key. The dead client-side
filter and its searchTerm state are removed; the session composition and dedup
logic is unchanged.

The box is now an exact request_id lookup, matching its label; the incidental
client-side model and user substring matching it used to do is dropped in
favor of the dedicated filters

* refactor(spend): model the request_id spend-log lookup as an explicit point lookup (LIT-3981)

The date-window relaxation for request_id lookups rode an apply_date_window flag threaded through the date validation and parsing. Model the two intents directly instead. A UI request_id query is a point lookup on the @id primary key that drops the time window and authorizes by row ownership; every other query, including the public /spend/logs/v2 route, takes the range-scan path that still requires a window

Because the ownership check fully authorizes the single row, the general user/team scoping is now skipped for id lookups rather than layered on top redundantly. The confusing `is_v2 or request_id is None` guard is gone, and moving the date requirement into the range-scan branch lets the type checker narrow the dates it parses

Behavior is preserved: the v2 contract still requires dates even when a request_id is supplied, and a non-owner is still rejected with 403. A regression test covers the non-admin owner id lookup, which resolves across all time and filters by the primary key alone
2026-07-23 16:40:19 -07:00
..
a2a_protocol fix(responses): stop scheduling sync success_handler concurrently with async_success_handler (#32239) 2026-07-07 09:13:50 -07:00
anthropic_interface style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
assistants style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
batch_completion style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
batches Revert "chore(ci): sync litellm_internal_staging into daily OSS branch (#33337)" (#33339) 2026-07-14 19:32:25 -07:00
caching fix(cache): make in-memory and disk cache increments atomic (#34013) 2026-07-20 15:51:01 -07:00
completion_extras style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
compression style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
containers style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
endpoints/speech/speech_to_completion_bridge style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
evals style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
experimental_mcp_client fix(mcp): sanitize Anthropic tool schemas and stop encoding gateway names 2026-07-17 10:33:28 -07:00
files style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
fine_tuning chore(lint): zero out crash-class pyright rules and ban new type: ignore comments (#32152) 2026-07-04 16:56:12 -07:00
google_genai fix(logging): classify async anthropic_messages and generate_content as async (#33589) 2026-07-16 20:56:47 -07:00
images style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
integrations feat(guardrails): add only_scan_new_messages for per-session incremental scanning (#33278) 2026-07-22 09:56:59 -07:00
interactions fix(responses): stop scheduling sync success_handler concurrently with async_success_handler (#32239) 2026-07-07 09:13:50 -07:00
litellm_core_utils fix(budget): resolve word-form budget_duration so it no longer silently resets daily (#34250) 2026-07-22 19:58:23 -07:00
llms Merge pull request #34338 from BerriAI/litellm_lit_4313_sagemaker_chat_streaming_ttft 2026-07-23 00:37:39 -07:00
models feat(mcp): issuer-anchored OAuth discovery (RFC 8414 §3.3) as the trust anchor 2026-07-15 16:59:01 -07:00
ocr test: litellm fix failing tests (#32577) 2026-07-09 13:54:45 -07:00
passthrough fix(logging): classify allm_passthrough_route as async to prevent duplicate success callbacks (#32265) 2026-07-06 15:04:05 -07:00
proxy fix(ui): find logs by request id across pages and dates (LIT-3981) (#31743) 2026-07-23 16:40:19 -07:00
proxy_auth style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
rag fix(rag): track LLM completion usage and spend for /v1/rag/query (#32438) 2026-07-17 17:45:27 +00:00
realtime_api fix(vertex): forward realtime health check params (#32550) 2026-07-08 17:30:46 -07:00
repositories fix(team): make team member add atomic to prevent concurrent-add member loss (#34185) 2026-07-22 21:47:22 +00:00
rerank_api fix(rerank): log optional_rerank_params at debug to stop leaking request content (#32533) 2026-07-08 18:48:03 -07:00
responses Merge pull request #33422 from BerriAI/litellm_fix_responses_reasoning_items 2026-07-22 19:42:09 -07:00
router_strategy feat(complexity-router): add return_raw_model_name toggle for response model field (#33875) 2026-07-18 19:24:56 -07:00
router_utils fix(router): keep team wildcard routers fresh and prioritize them over global patterns 2026-07-17 18:19:02 -07:00
rust_bridge perf(bedrock): audio transcription via rust core (py->rust bridge) (#33990) 2026-07-20 14:09:41 -07:00
sandbox style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
search style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
secret_managers fix(proxy): harden secret name validation for external secret manager integrations (LIT-4201) (#32092) 2026-07-08 10:36:00 -07:00
skills style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
types Merge pull request #33978 from BerriAI/litellm_cost_optimization_tools 2026-07-23 13:43:23 -07:00
vector_store_files style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
vector_stores style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
videos style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
__init__.py feat(proxy): add overwrite_user_with_key_hash to stamp outgoing user param with key hash (#34417) 2026-07-23 16:38:01 -07:00
_internal_context.py fix(proxy): harden request parameter handling 2026-04-16 01:38:12 +00:00
_lazy_imports.py style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
_lazy_imports_registry.py feat(tencent): add Tencent TokenHub as a provider (#31903) 2026-07-02 18:31:59 -07:00
_logging.py style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
_redis.py fix(redis): honor ssl value instead of key presence when building async connection pool (#32590) 2026-07-16 13:38:01 -07:00
_redis_credential_provider.py style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
_service_logger.py style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
_uuid.py build(deps-dev): bump black to 26.3.1 and apply formatting (#28525) 2026-05-21 17:24:18 -07:00
_version.py
anthropic_beta_headers_config.json fix(bedrock-invoke): retain clear_tool_uses_20250919 context_management edits and emit context-management-2025-06-27 beta (LIT-3393) (#32658) 2026-07-09 14:31:27 -07:00
anthropic_beta_headers_manager.py style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
blog_posts.json docs(blog): add WebRTC blog post link 2026-03-13 17:54:33 +05:30
budget_manager.py style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
constants.py Merge pull request #34146 from BerriAI/litellm_lit4662_autorouter_budget 2026-07-22 14:00:13 -07:00
cost.json
cost_calculator.py Revert "chore(ci): sync litellm_internal_staging into daily OSS branch (#33337)" (#33339) 2026-07-14 19:32:25 -07:00
exceptions.py feat(logging): add structured budget fields to budget rejection failure logs (#33460) 2026-07-16 12:39:04 -07:00
main.py fix(router): stop per-deployment num_retries from double-counting as provider max_retries (#34129) 2026-07-21 21:13:32 +00:00
model_prices_and_context_window_backup.json feat(gemini): day-0 pricing for gemini-3.6-flash and gemini-3.5-flash-lite 2026-07-21 08:50:40 -07:00
policy_templates_backup.json
provider_endpoints_support_backup.json chore: litellm oss staging (#30968) 2026-06-23 07:31:44 -07:00
py.typed
router.py fix(router): stop custom model_info leaking onto shared backend cost map key 2026-07-20 15:49:19 -07:00
scheduler.py style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
setup_wizard.py feat(anthropic): add Claude Sonnet 5 2026-06-30 18:47:08 +00:00
timeout.py style: unify ruff format width on 120 (#31518) 2026-06-27 12:39:29 -07:00
utils.py fix(router): honor request-level num_retries over global litellm_settings.num_retries (#34124) 2026-07-21 21:32:34 +00:00