fix(dashboard): advertise truecolor to the embedded chat TUI#60576
Merged
Conversation
Headless/hosted deploys run the dashboard server without COLORTERM in the process environment, so chalk inside the PTY-spawned TUI child downgraded every skin hex color to the xterm 256 palette — the default skin's bronze banner border (#CD7F32) snapped to palette 173 (#D7875F, salmon red) and the gold caduceus rendered red/yellow on fresh cloud instances. Local launches never reproduced it because the operator's interactive terminal leaks COLORTERM=truecolor into the server env. xterm.js always renders 24-bit RGB, so the dashboard PTY child should always advertise truecolor: backfill COLORTERM=truecolor in _resolve_chat_argv via setdefault (an explicit operator value wins). Verified with a clean-env PTY probe of the real TUI binary: no COLORTERM -> 0 truecolor SGRs / 165 palette-256 (salmon 38;5;173); with the backfill -> 166 truecolor SGRs, exact bronze 38;2;205;127;50.
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
Fresh hosted/cloud dashboards render the embedded chat TUI banner salmon-red instead of gold: headless servers have no
COLORTERM, so chalk inside the PTY-spawned TUI child downgrades every skin hex color to the xterm 256 palette. This PR backfillsCOLORTERM=truecolorinto the dashboard PTY child env, restoring exact 24-bit skin colors.Root cause: the TUI child inherits the dashboard server's environment. Under a process manager (container init, systemd) there is no
COLORTERM, so chalk picks the 256-color path and the default skin's bronze banner border#CD7F32snaps to palette 173 (#D7875F— salmon red); gold#FFD700snaps to 220. Local launches never reproduce it because the operator's interactive terminal leaksCOLORTERM=truecolorinto the server env. xterm.js renders 24-bit RGB unconditionally, so degrading was never correct for this surface.Changes
hermes_cli/web_server.py:_resolve_chat_argv()—env.setdefault("COLORTERM", "truecolor")for the dashboard PTY child.setdefaultso an explicit operator value wins. Native CLI/TUI usage untouched.tests/hermes_cli/test_web_server.py: 2 tests — backfill fires whenCOLORTERMis unset; operator-setCOLORTERM=24bitis respected.Validation
Clean-env PTY probe of the real TUI binary (
ui-tui/dist/entry.js) underptyprocess,TERM=xterm-256color:38;5;173(salmon)38;2;205;127;50(exact bronze)Also verified live end-to-end: launched the dashboard with
env -u COLORTERM(reproducing the hosted environment) and inspected/chatin a real browser — salmon banner on main, gold banner with the fix. Targeted tests green, ruff clean.Infographic