Skip to content

fix(android): use Node.js API for esbuild + pip timeout/skips for Termux#19841

Closed
jimmyjonezz wants to merge 1 commit into
NousResearch:mainfrom
jimmyjonezz:fix/esbuild-android
Closed

fix(android): use Node.js API for esbuild + pip timeout/skips for Termux#19841
jimmyjonezz wants to merge 1 commit into
NousResearch:mainfrom
jimmyjonezz:fix/esbuild-android

Conversation

@jimmyjonezz

@jimmyjonezz jimmyjonezz commented May 4, 2026

Copy link
Copy Markdown

Summary

Fixes two issues when running Hermes Agent on Termux/Android (Python 3.13, arm64):

1. esbuild CLI broken on Android

The @esbuild/android-arm64 native binary fails with ELF "bad shdr" error when invoked via shell (execFileSync). The Node.js API works correctly.

Changes:

  • hermes-ink build script now uses node -e "const esbuild=require(...)..." instead of CLI
  • Added prepare hook + fix-build.js to auto-patch the build script after npm install (survives hermes update)

2. pip install hangs on unavailable extras

faster-whisper / ctranslate2 have no wheels for Python 3.13 arm64 Android. During hermes update, the voice extra causes pip to hang indefinitely.

Changes in _install_python_dependencies_with_optional_fallback:

  • Skips voice extra on Termux (detected by /com.termux/ in __file__ path)
  • Added 300s timeout to base install, 120s per extra
  • Catches TimeoutExpired and continues gracefully

Testing

  • npm run build in hermes-ink succeeds on Android
  • npm run prepare auto-patches build script
  • Full TUI build (npm run build in ui-tui) succeeds
  • hermes update completes without hanging on voice extra

Closes: Termux/Android compatibility

- hermes-ink: build script uses Node.js API instead of CLI (native
  binary broken on Termux/Android arm64)
- hermes-ink: prepare hook auto-patches build after npm install
- hermes_cli: _install_python_deps skips voice extra on Termux
- hermes_cli: add timeout (300s) to pip install calls
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels May 4, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #16171 (also skips incompatible extras on Android/Termux) and #16072. This PR additionally fixes the esbuild CLI binary issue by switching to the Node.js API.

1 similar comment
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #16171 (also skips incompatible extras on Android/Termux) and #16072. This PR additionally fixes the esbuild CLI binary issue by switching to the Node.js API.

@teknium1

Copy link
Copy Markdown
Contributor

Closing as superseded by #21489.

Triage notes (high confidence):
Termux install path on main now uses _run_install_with_heartbeat + group='termux-all' (hermes_cli/main.py:7966) introduced by merged #21489 'fix(termux): heartbeat on install + termux-all extras profile' (2026-05-07) and #22901; this PR's simple subprocess timeouts are obsolete.

Thanks for the contribution — the underlying problem this PR addresses has been resolved by the linked PR on current main. If you believe this was closed in error, please comment and we'll reopen.

(Bulk-closed during a CLI PR triage sweep.)

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

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/tui Terminal UI (ui-tui/ + tui_gateway/) 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.

3 participants