Skip to content

fix(ui): apply the custom favicon by removing the competing app/favicon.ico - #34920

Closed
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
litellm_fix_custom_favicon
Closed

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
litellm_fix_custom_favicon

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • Custom favicon set in UI Theme Customization never reaches the tab
  • Two <link rel="icon"> tags shipped; browsers picked the dead one

How it solves it:

  • Move app/favicon.ico to public/, so Next stops emitting it
  • Leaves /get_favicon as the single declared icon source

Relevant issues

Fixes #34916

Linear ticket

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to 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

The backend was always correct; /get_favicon redirects to whatever LITELLM_FAVICON_URL holds, and the theme endpoint sets that var. The break was in the exported HTML: src/app/favicon.ico triggers Next's favicon file convention, which injects its own icon link before the one from metadata.icons, and it points at /favicon.ico?favicon.<hash>.ico at the origin root, a path the proxy does not serve (the export is mounted under /ui). Because that link carries sizes="48x48" type="image/x-icon", browsers prefer it over the unsized /get_favicon, get a 404, and fall back to the generic page icon.

Live proxy on localhost:4000, started with a custom favicon configured the same way /update/ui_theme_settings configures it:

$ LITELLM_FAVICON_URL="https://www.google.com/favicon.ico" litellm --config favicon_config.yaml

$ curl -s -o /dev/null -w "get_favicon:%{http_code} redirect:%{redirect_url}\n" http://localhost:4000/get_favicon
get_favicon:307 redirect:https://www.google.com/favicon.ico
$ curl -s -o /dev/null -w "root favicon.ico:%{http_code}\n" http://localhost:4000/favicon.ico
root favicon.ico:404

Before (built at daf22ec, artifacts as committed); the head carries both links and the tab shows the generic icon instead of the configured one:

$ curl -s http://localhost:4000/ui/ | grep -o '<link[^>]*icon[^>]*>'
<link rel="icon" href="/favicon.ico?favicon.3arlap5n8tyzg.ico" sizes="48x48" type="image/x-icon"/>
<link rel="icon" href="/get_favicon"/>

proxy log:
INFO:  127.0.0.1:40950 - "GET /favicon.ico?favicon.3arlap5n8tyzg.ico HTTP/1.1" 404 Not Found

After (this branch, UI rebuilt with npm run build and served from litellm/proxy/_experimental/out); one link, and the tab renders the configured favicon:

$ curl -s http://localhost:4000/ui/ | grep -o '<link[^>]*icon[^>]*>'
<link rel="icon" href="/get_favicon"/>

To reproduce by hand: set a Custom Favicon URL at http://localhost:4000/ui/?page=ui-theme, hit Save Changes, then open the dashboard in a fresh tab (browsers cache favicons per origin, so reuse of an already-poisoned tab can mask the change). The tab icon should now be the configured image.

Note that litellm/proxy/_experimental/out is refreshed by the periodic "chore: update Next.js build artifacts" job, so this PR only changes source; the shipped export picks the change up on the next artifact refresh.

Type

🐛 Bug Fix

Changes

ui/litellm-dashboard/src/app/favicon.ico moves to ui/litellm-dashboard/public/favicon.ico. It still exports to out/favicon.ico, which is what /get_favicon serves as the default when no custom URL is set, but public assets are not auto-linked, so metadata.icons is the only thing declaring an icon.

src/app/layout.test.tsx pins all three halves of that contract: metadata points at /get_favicon, no favicon.ico lives in the app directory, and the default icon still ships as a public asset. The middle assertion fails if the file is put back.

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

Link to Devin session: https://app.devin.ai/sessions/8c271162352643bf90e4191b22d2f21e

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@CLAassistant

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 sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Moves the dashboard favicon from the App Router directory into the public assets directory, preventing Next.js from generating a competing icon declaration while retaining the default exported asset

  • Adds regression coverage for the /get_favicon metadata declaration
  • Verifies the app directory remains free of an auto-discovered favicon
  • Verifies the default favicon remains in the public assets directory

Confidence Score: 5/5

The PR appears safe to merge because the asset relocation removes the competing Next.js favicon declaration while preserving the existing default icon

The unchanged favicon is moved to the public directory, the explicit /get_favicon metadata remains authoritative, and the added tests pin the source-tree conditions required for that behavior

Important Files Changed

Filename Overview
ui/litellm-dashboard/public/favicon.ico Relocates the unchanged favicon into public assets so it remains part of static exports without triggering Next.js App Router icon metadata
ui/litellm-dashboard/src/app/layout.test.tsx Adds focused regression assertions covering the metadata icon endpoint and both required favicon file locations

Reviews (1): Last reviewed commit: "fix(ui): apply the custom favicon by rem..." | Re-trigger Greptile

@yuneng-berri
yuneng-berri deleted the branch main September 13, 2026 04:35
@yuneng-berri yuneng-berri reopened this Sep 13, 2026
@yuneng-berri
yuneng-berri self-requested a review as a code owner September 13, 2026 06:40
@devin-ai-integration
devin-ai-integration Bot changed the base branch from litellm_internal_staging to main September 23, 2026 15:27
@devin-ai-integration
devin-ai-integration Bot requested a review from a team September 23, 2026 15:27
@tin-berri

Copy link
Copy Markdown
Contributor

Closing as stale: no activity in the last 30 days. Feel free to reopen if this is still relevant.

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.

Inconsistency in custom favicon: favicon set via UI Theme Customization is not applied to the browser tab

3 participants