fix(desktop): render codicons when running hgui from a worktree - #40735
Closed
OutThisLife wants to merge 1 commit into
Closed
fix(desktop): render codicons when running hgui from a worktree#40735OutThisLife wants to merge 1 commit into
OutThisLife wants to merge 1 commit into
Conversation
`hgui` symlinks a worktree's node_modules to the main checkout. Vite realpaths those before enforcing server.fs.allow, so codicon/font assets resolved outside the worktree root and 404'd — codicons silently failed to render in any worktree dev session. Whitelist the real node_modules locations so the fix holds from any checkout.
7 tasks
6 tasks
Collaborator
Author
|
The |
This was referenced Jul 28, 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.
Summary
Codicons (and the
@nous-research/uiCollapse font) silently fail to render whenever the desktop app is launched viahguifrom a git worktree — the glyphs just disappear.Root cause:
hguisymlinks the worktree'snode_modulesback to the main checkout. Vite callsrealpathbefore enforcingserver.fs.allow, so requests like@vscode/codicons/dist/codicon.ttfresolve to…/hermes-agent/node_modules/…— outside the worktree root — and get rejected:Fix: whitelist the real
node_moduleslocations inserver.fs.allow, resolving symlinks viarealpathSync. Works from any worktree and is a no-op in the main checkout.Test plan
hgui <worktree>→ codicons + Collapse font render, nooutside of Vite serving allow listwarningshguifrom the main checkout still works unchanged