perf(termux): speed up tui cold start#29404
Closed
adybag14-cyber wants to merge 1 commit into
Closed
Conversation
Contributor
19 tasks
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?
Optimizes Hermes CLI/TUI cold start on Termux/Android without changing the default desktop startup path.
The main hot path is
hermes --tuion low-power mobile CPUs. Before this change, the Python launcher always built the full CLI subparser tree, eagerly loaded the model catalog on Termux, and rebuilt the Ink TUI bundle on every launch. This PR gates the faster behavior to Termux:npm run buildon Termux using source/config mtime freshness checksLocal Termux timing with this branch loaded through the installed Hermes venv:
python -m hermes_cli.main --version: about0.28safter, about0.96sbefore_make_tui_argv(...)with a fresh installed TUI bundle: about0.024safter, about0.875sbeforeRelated Issue
N/A
Type of Change
Changes Made
hermes_cli/main.pyhermes --tui/hermes chat --tuiinvocations.dist/entry.jsis fresh.migrateto_BUILTIN_SUBCOMMANDSto keep built-in command gating in sync with parser registration.tests/hermes_cli/test_tui_npm_install.pytests/hermes_cli/test_tui_resume_flow.pyHow to Test
/data/data/com.termux/files/home/.hermes/hermes-agent/.venv/bin/python -m pytest -o addopts='' tests/hermes_cli/test_tui_npm_install.py tests/hermes_cli/test_tui_resume_flow.py::test_termux_fast_tui_launch_uses_light_parser tests/hermes_cli/test_tui_resume_flow.py::test_termux_fast_tui_launch_skips_help tests/hermes_cli/test_tui_resume_flow.py::test_fast_tui_launch_is_termux_only tests/hermes_cli/test_tui_resume_flow.py::test_main_top_level_tui_accepts_toolsets -q/data/data/com.termux/files/home/.hermes/hermes-agent/.venv/bin/python -m pytest -o addopts='' tests/hermes_cli/test_startup_plugin_gating.py -qChecklist
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/AFor New Skills
N/A
Screenshots / Logs
Focused test output:
Timing output: