feat: Termux/Android support — install path, TUI adaptations, voice backend, /image command#6834
Merged
Conversation
Replace 6 identical copies of the Termux detection function across cli.py, browser_tool.py, voice_mode.py, status.py, doctor.py, and gateway.py with a single shared implementation in hermes_constants.py. Each call site imports with its original local name to preserve all existing callers (internal references and test monkeypatches).
…_vprint The test was mocking _vprint entirely, bypassing the suppress guard. Switch to capturing _print_fn output so the real _vprint runs and the guard suppresses retry noise as intended.
|
Link to the termux docs is broken. |
Contributor
I'll take a look soon |
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
Salvages the Termux/Android support from PR #6201 (by @adybag14-cyber), dropping the unrelated ChatGPT Web provider that was bundled in the same PR.
What this PR does
Adds first-class Android/Termux support for Hermes Agent:
Install & packaging:
scripts/install.sh— detects Termux, usespkgfor system deps, stdlib venv + pip.[termux]extra in pyproject.toml — curated bundle (cron, cli, pty, mcp, honcho, acp)constraints-termux.txtfor stable Android wheel resolutionsetup-hermes.shTermux pathRuntime adaptations:
get_temp_dir()on environment backends — Termux has no/tmp, uses$TMPDIR$TMPDIRsupports_systemd_services()guard — Termux has no systemdCLI/TUI:
/image <path>slash command for local image attachment~/, quoted paths, relative paths,TERMINAL_CWDVoice mode:
TermuxAudioRecorderbackend usingtermux-microphone-record/ Termux:APIcreate_audio_recorder()factory — auto-selects best backenddetect_audio_environment()Termux-aware fallbacksDiagnostics:
hermes doctorTermux-aware checks (pkg install hints, Docker info, browser setup steps)hermes statusTermux gateway detectionDocumentation:
website/docs/getting-started/termux.mdguide (manual + installer paths)Follow-up fixes (ours)
_is_termux()— was copy-pasted in 6 files, now single source inhermes_constants.is_termux()suppress_status_output— was mocking_vprint(bypassing guard), now captures stdoutWhat was excluded from #6201
websocketscore dependencyrun_agent.pychatgpt-web api_mode / XML tool call extractioncredential_pool.pysession_token additionerror_classifier/_rate_limit_stateremovals (stale-branch regressions)Test results
Closes the Termux portion of #6201. Credit to @adybag14-cyber for the original implementation.