Skip to content

fix(desktop): render codicons when running hgui from a worktree - #40735

Closed
OutThisLife wants to merge 1 commit into
mainfrom
bb/vite-worktree-fs-allow
Closed

fix(desktop): render codicons when running hgui from a worktree#40735
OutThisLife wants to merge 1 commit into
mainfrom
bb/vite-worktree-fs-allow

Conversation

@OutThisLife

Copy link
Copy Markdown
Collaborator

Summary

Codicons (and the @nous-research/ui Collapse font) silently fail to render whenever the desktop app is launched via hgui from a git worktree — the glyphs just disappear.

Root cause: hgui symlinks the worktree's node_modules back to the main checkout. Vite calls realpath before enforcing server.fs.allow, so requests like @vscode/codicons/dist/codicon.ttf resolve to …/hermes-agent/node_modules/… — outside the worktree root — and get rejected:

The request id ".../node_modules/@vscode/codicons/dist/codicon.ttf" is outside of Vite serving allow list.

Fix: whitelist the real node_modules locations in server.fs.allow, resolving symlinks via realpathSync. Works from any worktree and is a no-op in the main checkout.

Test plan

  • hgui <worktree> → codicons + Collapse font render, no outside of Vite serving allow list warnings
  • hgui from the main checkout still works unchanged

`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.
@daimon-nous daimon-nous Bot added type/bug Something isn't working P3 Low — cosmetic, nice to have labels Jun 6, 2026
@OutThisLife

Copy link
Copy Markdown
Collaborator Author

The server.fs.allow fix (realpath-resolved node_modules whitelist) already landed on main independently, so there's nothing left to merge from this branch — the rest of its diff is just staleness. Folded into the combined desktop dev-experience PR #69938. Closing as implemented on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant