Skip to content

feat: add tested Termux install path and EOF-aware gh auth#6201

Closed
adybag14-cyber wants to merge 22 commits into
NousResearch:mainfrom
adybag14-cyber:feat/termux-install-path
Closed

feat: add tested Termux install path and EOF-aware gh auth#6201
adybag14-cyber wants to merge 22 commits into
NousResearch:mainfrom
adybag14-cyber:feat/termux-install-path

Conversation

@adybag14-cyber

Copy link
Copy Markdown
Contributor

Summary

  • add a tested Android/Termux install path with a dedicated .[termux] extra and docs
  • teach the installer and doctor command about Termux-specific package/runtime behavior
  • fix background gh auth login --with-token flows by adding stdin close/EOF support and PTY fallback logic

Validation

  • bash -n scripts/install.sh
  • python3 -m pytest tests/hermes_cli/test_doctor.py tests/tools/test_terminal_tool_pty_fallback.py tests/tools/test_process_registry.py -q
  • fresh Termux install test: python3.11 -m venv .tmp-termux-verify-venv && source .tmp-termux-verify-venv/bin/activate && export ANDROID_API_LEVEL=$(getprop ro.build.version.sdk) && python -m pip install -e '.[termux]' -c constraints-termux.txt

Notes

  • The tested Termux path intentionally skips browser/WhatsApp bootstrap for now.
  • .[all] remains unsupported on Android because voice depends on faster-whisper -> ctranslate2, which has no Android wheels.

@adybag14-cyber adybag14-cyber force-pushed the feat/termux-install-path branch from 2725b0b to 3ef7edc Compare April 8, 2026 20:16
@adybag14-cyber adybag14-cyber force-pushed the feat/termux-install-path branch from 3ef7edc to 6b3614f Compare April 9, 2026 06:32
@adybag14-cyber

Copy link
Copy Markdown
Contributor Author

Quick progress update from live Termux/Android
testing:

  • Added the tested Termux install path with
    .[termux], constraints-termux.txt, and
    dedicated docs. - Fixed gh auth login --with-token flows by
    handling piped stdin/EOF correctly and
    avoiding the PTY hang case.
  • Fixed Termux temp-path issues so local
    session artifacts and persisted tool outputs
    respect TMPDIR instead of assuming writable /tmp.
  • Improved Termux QoL: - hermes status no longer crashes on
    missing systemctl - hermes doctor now treats Docker/browser
    warnings as expected/optional on Termux - installer now links hermes into
    $PREFIX/bin and uses clearer Termux background-start messaging
  • Validation so far:
    • targeted pytest slices are green (146 passed) - live smoke checks on actual Termux for
      status, doctor, terminal/background flows, execute_code, and gh auth behavior
      Branch has been rebased/pushed and the PR is
      currently mergeable.

- keep API/access-token, OAuth device-code, and session-token flows distinct
- add explicit third interactive path for session tokens
- persist and resolve pool-backed chatgpt-web session tokens
- cover interactive selection and runtime resolution with tests
- add a dedicated 'hermes auth browser chatgpt-web' command
- launch a Termux-owned Chromium session under Termux:X11 with DevTools enabled
- capture __Secure-next-auth.session-token and store the resulting Hermes credential
- cover parser and bootstrap flow with targeted tests
- expose the Termux browser bootstrap as option 4 in interactive chatgpt-web auth
- route option 4 directly to the browser bootstrap command
- cover the interactive menu path with tests
@adybag14-cyber

Copy link
Copy Markdown
Contributor Author

Progress update: I checked the Hermes logs and reproduced the ChatGPT Web failure after auth/model selection. There were two issues: ChatGPT web transport returned no assistant text and a chatgpt-web streaming callback bug
(_stop_spinner() takes 0 positional arguments but 1 was given). Root cause was that ChatGPT Web is now sending nested v.message / patch SSE events instead of only top-level message events, and our streaming path in run_agent.py was wiring the
first-delta spinner callback incorrectly. I fixed the parser in hermes_cli/chatgpt_web.py, fixed the callback wiring in run_agent.py, added regression tests, and verified both targeted tests and live local end-to-end ChatGPT Web runs. Latest fix is pushed to this PR branch in 09d15370.

@teknium1

teknium1 commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Termux/Android support merged via PR #6834. Your 13 Termux commits were cherry-picked onto current main with your authorship preserved in git log.

The ChatGPT Web provider portion was excluded from this salvage — it needs a separate discussion (reverse-engineered private API, ToS considerations, maintenance burden). If you'd like to pursue that as a standalone PR, happy to review it separately.

Thanks for the thorough Termux work — the install script, TermuxAudioRecorder, narrow-terminal TUI adaptations, and docs are all solid contributions.

@teknium1 teknium1 closed this Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants