Skip to content

revert: "feat(usage): search keys beyond the top-N usage subset (#42827)" - #43378

Merged
yuneng-berri merged 2 commits into
litellm_revert_42857from
litellm_revert_42827
Sep 28, 2026
Merged

yuneng-berri merged 2 commits into
litellm_revert_42857from
litellm_revert_42827

Conversation

@yassin-berriai

Copy link
Copy Markdown
Contributor

Reverts #42827

TLDR

Problem this solves:

How it solves it:

  • Plain git revert of the squash commit 5a8ec13, no conflicts
  • Removes the GET /user/daily/activity/aggregated/search route, its types, tests and the Key Activity panel's remote search

User Flow

Before: on Usage > Key Activity, typing the alias of a key below the top 100 finds it through a server search

  1. They open http://localhost:4000/ui/?page=usage, open Key Activity and type the alias
  2. The dashboard calls GET http://localhost:4000/user/daily/activity/aggregated/search?search=... and shows the key

After: the page behaves as it did before #42827

  1. They open http://localhost:4000/ui/?page=usage, open Key Activity and type the alias
  2. The search filters only the loaded top-N keys and reports "No keys match"; GET http://localhost:4000/user/daily/activity/aggregated/search returns 404

Type

🧹 Refactoring

Caveats (if any)

Low

🤖 Generated with Claude Code

@CLAassistant

CLAassistant commented Sep 26, 2026 •

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

❌ devin-ai-integration[bot]
❌ yassin-berriai
You have signed the CLA already but the status is still pending? Let us recheck it.

@greptile-apps

greptile-apps Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Removes a search feature from the usage tracking API.

The PR should not merge as-is because it removes existing key-search behavior without the user-controlled compatibility option required by the repository.

Findings

  1. P1 Key search misses existing keys ▶

Summary

The PR reverts server-side Key Activity search beyond the loaded top-N keys, removing its proxy route, dashboard integration, types, and tests.

  • The dashboard returns to filtering only loaded keys.
  • The search API is no longer available.

Reviews (1) · Last reviewed commit: "Revert "feat(usage): search keys beyond ..."

apiKeyTruncation={spendFetchState.apiKeyTruncation}
searchKeys={searchKeys}
/>
<KeyActivityPanel keyMetrics={keyMetrics} apiKeyTruncation={spendFetchState.apiKeyTruncation} />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Key search misses existing keys

When more keys have activity than the top-N limit, this panel now searches only the loaded keys. Searching for an existing lower-spend key therefore shows “No keys match.” This revert also removes the search API, so existing clients calling it receive a 404. The repository requires avoiding backwards-incompatible changes without a user-controlled flag, but this revert provides no way to retain the previous behavior.

Rule Used: What: avoid backwards-incompatible changes without user-controlled flags Why: This breaks current behaviour for users using existing functionality Example of BAD: this PR (#22164) introduced run_post_custom... (source)

@codecov

codecov Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…r the usage dashboard (#41324)" (#43595)

* Revert "Merge pull request #41324 from BerriAI/litellm_daily_global_spend_table"

* Revert "Merge pull request #41293 from BerriAI/litellm_usage_key_free_aggregate_split" (#43596)

Co-authored-by: yassin <yassin@berri.ai>

---------

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@yuneng-berri
yuneng-berri merged commit 1903cec into litellm_revert_42857 Sep 28, 2026
49 of 53 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_revert_42827 branch September 28, 2026 21:40
WHERE {where_clause}
GROUP BY GROUPING SETS (
(date),
(date, api_key),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Low: Unbounded per-key usage response

An authenticated user can request aggregated activity for a key-heavy user or team and force the proxy to materialize every per-key grouping row, look up metadata for every distinct key, and serialize the full result without pagination. Repeated requests against a large history can exhaust worker memory. Keep the overall totals complete, but bound or paginate the per-key breakdowns separately.

@veria-ai

veria-ai Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

PR overview

This PR reverts the change that searched usage keys beyond the top-N usage subset. The affected code handles daily activity aggregation and per-key usage breakdowns.

One issue remains open: an authenticated user can request a large per-key activity breakdown that is materialized and returned without a bound or pagination. Repeated requests for key-heavy users or teams could exhaust proxy worker memory. No issues have been addressed yet.

Open issues (1)

Fixed/addressed: 0 · PR risk: 5/10

yuneng-berri pushed a commit that referenced this pull request Sep 28, 2026
…sage view (#42857)" (#43377)

* Revert "feat(usage): search team keys beyond the top-N in the Team usage view (#42857)"

* revert: "feat(usage): search keys beyond the top-N usage subset (#42827)" (#43378)

* Revert "feat(usage): search keys beyond the top-N usage subset (#42827)"

* revert: "feat(proxy): add LiteLLM_DailyGlobalSpend key-free rollup for the usage dashboard (#41324)" (#43595)

* Revert "Merge pull request #41324 from BerriAI/litellm_daily_global_spend_table"

* Revert "Merge pull request #41293 from BerriAI/litellm_usage_key_free_aggregate_split" (#43596)

Co-authored-by: yassin <yassin@berri.ai>

---------

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>

This branch is waiting to be deployed

1 waiting deployment
e2e-changed — aece1ba7 Waiting Sep 28, 2026 by yuneng-berri via oauth #1670
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants