Skip to content

fix(update): add heartbeat during dependency install#21433

Closed
adybag14-cyber wants to merge 7 commits into
NousResearch:mainfrom
adybag14-cyber:fix/update-progress-heartbeat
Closed

fix(update): add heartbeat during dependency install#21433
adybag14-cyber wants to merge 7 commits into
NousResearch:mainfrom
adybag14-cyber:fix/update-progress-heartbeat

Conversation

@adybag14-cyber

@adybag14-cyber adybag14-cyber commented May 7, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes a remaining Hermes update UX hang case where dependency installation can still appear stalled on Termux/Android and other slow hardware, even after #20679 removed pip --quiet.

This PR adds a periodic heartbeat during dependency installation so users can see that updates are still progressing when uv/pip (or underlying build backends) are temporarily silent while compiling Rust/C extensions.

This is the right approach because:

  • It is low-risk and does not alter dependency resolution behavior.
  • It preserves normal pip/uv output.
  • It adds explicit liveness feedback only during long silent stretches.

Related Issue

Fixes #


Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

hermes_cli/main.py

  • Added _run_install_with_heartbeat(...) to wrap dependency install subprocess calls.

  • Emits a periodic status line every 30s:

    … still installing dependencies (Xs elapsed) — compiling Rust/C extensions can take several minutes
    
  • Updated _install_python_dependencies_with_optional_fallback(...) to use the heartbeat wrapper for:

    • install -e .[all]
    • fallback install -e .
    • per-extra fallback installs (install -e .[extra])
  • Updated docstring to clarify why heartbeat is needed even with non-quiet pip output.

tests/hermes_cli/test_update_autostash.py

  • Updated expected pip command assertions to match current non-quiet install invocations.
  • Updated mocked git pull expectation to --ff-only path used by current updater logic.
  • Added regression test:
    • test_install_heartbeat_prints_when_dependency_install_is_silent

How to Test

  1. Run:

    scripts/run_tests.sh tests/hermes_cli/test_update_autostash.py -q
  2. Run:

    scripts/run_tests.sh tests/hermes_cli/test_update_yes_flag.py tests/hermes_cli/test_cmd_update.py -q
  3. Manual verification:

    • On a slower machine or Termux environment, run hermes update where dependency builds take time.
    • Verify heartbeat lines appear every ~30s during silent phases.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Termux (Android, aarch64)

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

For New Skills

  • This skill is broadly useful to most users (if bundled) — see Contributing Guide
  • SKILL.md follows the standard format (frontmatter, trigger conditions, steps, pitfalls)
  • No external dependencies that aren't already available (prefer stdlib, curl, existing Hermes tools)
  • I've tested the skill end-to-end:
    hermes --toolsets skills -q "Use the X skill to do Y"

Screenshots / Logs

Example heartbeat output during a long silent install phase:

→ Updating Python dependencies...

… still installing dependencies (30s elapsed) — compiling Rust/C extensions can take several minutes

… still installing dependencies (60s elapsed) — compiling Rust/C extensions can take several minutes

@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 labels May 7, 2026
@teknium1

teknium1 commented May 7, 2026

Copy link
Copy Markdown
Contributor

Thanks for this — the Termux install UX work was valuable. We salvaged four of the seven commits onto current main via PR #21489, with your authorship preserved per-commit:

  • 54c0b10d1 fix(update): add heartbeat during dependency install
  • da18fd084 fix: strengthen termux install network prerequisites
  • dc5ef1ac8 fix: add termux-all install profile and safe fallbacks
  • 732a6c45f feat: add termux doctor fallback guidance for blocked extras

The other three commits weren't merged here because they change behavior for every user, not just Termux. If you'd like to resubmit any of them as separate scoped PRs, that'd be welcome:

  1. fix(termux): preserve CLI scrollback and harden lightpanda open fallback — removes \\x1b[3J from resize recovery for ALL platforms. The touch-gesture-triggers-resize issue is real on Android but the fix needs to be Termux-gated (e.g. PREFIX=/data/data/com.termux env check or sys.platform detection) so desktop terminals that genuinely need the scrollback reset on resize keep getting it. The browser_tool.py lightpanda→Chrome fallback URL change is also not Termux-specific.

  2. fix(tui): stabilize list/url wrapping in assistant markdown — changes assistant markdown list rendering (Text→Box with flexGrow) for every TUI user globally, and also affects the embedded TUI in the web dashboard. Needs dashboard smoke-testing alongside the messages.test.ts coverage before we can merge.

  3. fix(termux): prefer active .venv and reduce doctor noise — the .venv preference is defensible (our scripts/run_tests.sh already does this) but it changes venv detection behavior for every desktop user on hermes update. Worth its own PR with a title that describes the cross-platform change, not a Termux subject line.

Future tip: please split unrelated fixes into separate PRs. The PR title here described only the heartbeat change, but the diff included 7 commits across TUI/browser/CLI/doctor/install — makes review and bisect harder. Appreciate the work, thanks!

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 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