perf(tui): fix hardcoded esbuild output filename causing 6s blocking loop#20322
Closed
yigenhuobah wants to merge 1 commit into
Closed
perf(tui): fix hardcoded esbuild output filename causing 6s blocking loop#20322yigenhuobah wants to merge 1 commit into
yigenhuobah wants to merge 1 commit into
Conversation
This was referenced May 7, 2026
Contributor
|
Closing as stale — the code path this addresses no longer exists on Triage notes (high confidence): If this PR's intent is still relevant against the current code, please rebase or open a fresh PR. (Bulk-closed during a CLI PR triage sweep.) |
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.
What does this PR do?
This PR fixes a silent performance bug introduced in PR #15351.
In
hermes_cli/main.py, thestale checkfor the TUI frontend was hardcoded to look forink-bundle.js. However, the actual output file fromesbuildisentry-exports.js.Because
ink-bundle.jsis never created, the stale check always returnsTrue. This causes a synchronousnpm run build(which takes about ~6 seconds) to execute on Uvicorn's main thread every time a user opens the Chat tab and initiates a WebSocket connection. This completely blocks the event loop and leads to severe UI unresponsiveness and WebSocket timeouts.By correcting the filename to
entry-exports.js, the stale check functions correctly, bringing the WebSocket handshake time down from ~6000ms to ~50ms.Related Issue
N/A (Found during local debugging of TUI websocket timeout issues. Relates to the build changes introduced in PR #15351).
Fixes #
Type of Change
Changes Made
bundlevariable path inhermes_cli/main.pyfromink-bundle.jstoentry-exports.jsto correctly match the esbuild output.How to Test
hermes dashboard --tui.ws://127.0.0.1:9119/api/pty) should now establish instantly (~50ms) instead of hanging the event loop for ~6 seconds to run an unnecessary rebuild.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
Before:
WebSocket connection hangs for ~5.9s while Uvicorn main thread is blocked by
npm run build.After:
WebSocket handshake completes in ~53ms. UI input is instantly responsive.