fix(ui): repoint the key detail URL to the rotated hash after regenerating - #37968
Merged
yuneng-berri merged 1 commit intoAug 24, 2026
Merged
Conversation
…ating
Regenerating a key from the key info page left the ?key= query param on the
old hash, so dismissing the dialog or reloading landed on a key that no longer
exists and the page rendered "Key not found".
Two defects had to line up. POST /key/{key}/regenerate returns the rotated
hash in token_id and leaves token null, but RegenerateKeyModal read
response.token || response.key_id, neither of which the endpoint populates, so
it always reported the old hash back to its parent. And KeyInfoView's
onKeyDataUpdate prop had no caller anywhere in the tree: VirtualKeysTable owns
the ?key= param and mounts the view but never passed it, so even a correct
hash went nowhere.
VirtualKeysTable now handles the update by pointing ?key= at the rotated hash
and refetching. KeyInfoView holds that callback until the regenerate dialog is
dismissed rather than firing it on the API response, because swapping the
selected key mid-dialog unmounts the view and tears down the one-time
plaintext key before the user can copy it.
Contributor
Greptile SummaryThis PR keeps regenerated key detail pages usable by propagating the rotated hash and updating the
Confidence Score: 5/5The PR appears safe to merge, with the rotated identifier propagated at the intended dismissal boundary The current regeneration endpoint returns the new lookup hash through
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/src/components/VirtualKeysPage/VirtualKeysTable.tsx | Updates the selected-key query parameter and refreshes the key list when regeneration supplies a new identifier |
| ui/litellm-dashboard/src/components/organisms/RegenerateKeyModal.tsx | Normalizes the regeneration response so the rotated token_id becomes the key lookup token |
| ui/litellm-dashboard/src/components/templates/key_info_view.tsx | Holds the regenerated-key update until modal dismissal while updating the visible detail data immediately |
| ui/litellm-dashboard/src/components/VirtualKeysPage/VirtualKeysTable.test.tsx | Verifies that dismissal repoints the detail URL to the rotated hash |
| ui/litellm-dashboard/src/components/organisms/RegenerateKeyModal.test.tsx | Verifies extraction of the rotated hash when the API returns it through token_id |
Reviews (1): Last reviewed commit: "fix(ui): repoint the key detail URL to t..." | Re-trigger Greptile
yuneng-berri
enabled auto-merge (squash)
August 23, 2026 05:37
ryan-crabbe-berri
approved these changes
Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Problem this solves:
How it solves it:
?key=at it on closeUser Flow
Before: an admin who regenerates a key from that key's detail page is dropped on a dead URL and loses the page
After: the same admin stays on a working detail page for the key they just regenerated
The secret stays on screen until the admin dismisses the dialog, so the URL swap never cuts short their chance to copy it
Relevant issues
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Shared setup, against a proxy on
:4000with an admin key, to create the key each case walks through:Both cases are also driven as Playwright runs against a real dashboard talking to a real proxy, no mocks and no stubbed responses. The runs cover four checks: the two cases below, plus two adjacent behaviours that must not change
Before (490c9f9)
Regenerating repoints the detail page URL
The detail page survives a reload after regenerating
Both cases as a browser run
After (713972f)
Regenerating repoints the detail page URL
The detail page survives a reload after regenerating
Both cases as a browser run
The proxy log for that run shows the dashboard asking for the rotated hash and getting it:
Type
🐛 Bug Fix
Caveats (if any)
token, so older proxies keep working