Skip to content

Add Windows WSL WebUI autostart helpers#1665

Closed
Michaelyklam wants to merge 1 commit intonesquena:masterfrom
Michaelyklam:fix/issue-513-wsl-autostart
Closed

Add Windows WSL WebUI autostart helpers#1665
Michaelyklam wants to merge 1 commit intonesquena:masterfrom
Michaelyklam:fix/issue-513-wsl-autostart

Conversation

@Michaelyklam
Copy link
Copy Markdown
Contributor

@Michaelyklam Michaelyklam commented May 4, 2026

Thinking Path

  • Windows users running Hermes WebUI under WSL need a low-friction way to make the app available after login.
  • The safest MVP is documentation plus repeatable scripts rather than a hidden auto-installer.
  • The WSL launcher should be safe to call repeatedly because both shell startup hooks and Task Scheduler can run more than once.
  • The Windows helper should install/update one current-user scheduled task without hardcoded private paths or elevated privileges.
  • Regression coverage pins the docs/script safety invariants and syntax checks so future changes do not reintroduce duplicate-process or path assumptions.

What Changed

  • Added docs/wsl-autostart.md covering two supported paths:
    • WSL shell/session startup via ~/.profile or ~/.bashrc
    • true Windows logon startup via Task Scheduler invoking wsl.exe
  • Added scripts/wsl/hermes_webui_autostart.sh, a WSL-safe launcher that:
    • derives the repo path from the script location unless HERMES_WEBUI_REPO is set
    • uses a lock file, health check, and pid file to avoid duplicate WebUI processes
    • starts start.sh --foreground with persistent logs
    • exposes HERMES_WEBUI_HOST / HERMES_WEBUI_PORT to the child process
    • keeps the separate Hermes process dependency check opt-in via HERMES_WEBUI_REQUIRE_AGENT_PROCESS=1
  • Added scripts/windows/setup_webui_autostart.ps1, an idempotent Task Scheduler helper that:
    • validates the WSL script path by default
    • supports optional distro selection
    • updates the existing task with -Force instead of creating duplicates
    • uses ShouldProcess / -WhatIf, least privilege, and MultipleInstances IgnoreNew
    • avoids bash -lc shell quoting by passing the WSL script path as an argv item
  • Linked the new guide from the README bootstrap section.
  • Added tests/test_issue513_wsl_autostart.py for docs coverage, bash syntax, and PowerShell safety/idempotency invariants.

Closes #513

Why It Matters

  • Windows/WSL users get an official path for both simple session startup and real Windows login startup.
  • The helper scripts avoid the risky parts of ad-hoc snippets from the issue: hardcoded /root paths, duplicate processes, and unbounded scheduled-task creation.
  • The launcher remains compatible with the existing start.sh --foreground process-supervisor guidance without introducing a new service manager dependency.

Verification

  • env -u HERMES_CONFIG_PATH /home/michael/.hermes/hermes-agent/venv/bin/python -m pytest tests/test_issue513_wsl_autostart.py -q — 5 passed
  • uv run --python /usr/bin/python3.12 --with pytest --with pytest-timeout python -m pytest tests/test_issue513_wsl_autostart.py -q --timeout=60 — 5 passed
  • bash -n scripts/wsl/hermes_webui_autostart.sh — passed
  • git diff --check — passed
  • Full local suite: env -u HERMES_CONFIG_PATH /home/michael/.hermes/hermes-agent/venv/bin/python -m pytest tests/ -q — 4289 passed, 4 skipped, 3 xpassed, 1 warning, 8 subtests passed; 2 unrelated tests/test_sprint3.py skills-list tests failed during the full-suite run due to transient empty skills state. Rerunning the two failed tests directly passed: 2 passed in 1.65s.
  • GitHub Actions run https://github.com/nesquena/hermes-webui/actions/runs/25350339386 — green on Python 3.11, 3.12, and 3.13.

No browser media included because this is docs/scripts-only and does not change the WebUI interface.

Risks / Follow-ups

  • PowerShell parser validation is conditional in Linux environments because pwsh is not always installed; source-string tests still pin the important Scheduled Task invariants.
  • This is a script/documentation MVP. A future ctl.sh or service installer can wrap these scripts if the project standardizes a broader service-management interface.
  • Users with unusual WSL networking or custom ports may need to set HERMES_WEBUI_PORT / HERMES_WEBUI_HEALTH_URL in their startup hook.

Model Used

  • OpenAI Codex gpt-5.5
  • Tool use: GitHub CLI/API, git worktree, pytest, bash syntax checks, Hermes file/terminal tools

@nesquena-hermes
Copy link
Copy Markdown
Collaborator

Closed by the v0.51.1 release in PR #1681 (merged at e23ba59). Massive thanks @Michaelyklam — this is now 19 merged PRs across the v0.50.292–v0.51.1 release window, an extraordinary contribution rate. Each PR was per-claim-vs-diff verified against your description and every security-relevant code path checked under independent review (Opus advisor, 6/6 questions clean). Your closes #N references are all accurate, your Thinking Path / What Changed / Why It Matters body template is consistently helpful, and your test coverage is solid behavioral scope (not source-string scaffolding) on every PR.

Live on production: https://github.com/nesquena/hermes-webui/releases/tag/v0.51.1

🚀

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.

[Feature Request] Add Windows (WSL) Auto-Start Support for WebUI

2 participants