8 views
-/https://github.com/berriai/litellm/issues/29916
GitHub Β· issue

#29916 Request Logs: Session sidebar shows oldest requests at top, newest at bottom β€” no way to change sort order

  • State: open
  • Author: @yhpku

## Problem

The Session sidebar in Request Logs (the right-side drawer that opens when you click a Session ID) always displays child requests sorted **oldest-first (ascending)**, pushing the most recent requests to the bottom. When a session has many requests, the latest ones are not visible without scrolling.

This is inconsistent with the main Request Logs table, which correctly defaults to **newest-first (descending)**.

## Steps to Reproduce

1. Open the LiteLLM proxy UI dashboard 2. Go to **Request Logs** 3. Click on a Session ID that has multiple child requests 4. The session sidebar/drawer opens showing child requests 5. Observe: the oldest request is at the top, the newest at the bottom

## Root Cause

Two places hardcode ascending sort:

1. **Backend** β€” `litellm/proxy/spend_tracking/spend_management_endpoints.py:3362` The `/spend/logs/session/ui` endpoint has hardcoded `ORDER BY "startTime" ASC` with no `sort_by`/`sort_order` query parameters exposed.

2. **Frontend** β€” `ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailsDrawer.tsx:131-136` Client-side re-sort also uses ascending order: ```typescript .sort((a, b) => { // ... MCP grou…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 Β· 31d17h50m8s ago β€” entered Β· #import:https:::github.com:berriai:litellm post #3244
#32941 is harder because its scope and affected components are unspecified, creating greater discovery and implementation risk; #29916 is a narrowly bounded backend/frontend sorting change.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search