Skip to content

fix(dashboard): guard update endpoint in Docker with structured guidance#35339

Closed
teknium1 wants to merge 2 commits into
mainfrom
hermes/hermes-d44c5398
Closed

fix(dashboard): guard update endpoint in Docker with structured guidance#35339
teknium1 wants to merge 2 commits into
mainfrom
hermes/hermes-d44c5398

Conversation

@teknium1

@teknium1 teknium1 commented May 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Clicking "Update" in the dashboard inside a Docker container now returns structured guidance instead of surfacing the CLI guard's SystemExit as a generic error. The endpoint detects Docker installs before spawning hermes update.

Salvage of #34831 by @donovan-yohan, cherry-picked onto current main with authorship preserved.

Changes

  • hermes_cli/web_server.py: POST /api/hermes/update calls detect_install_method(); on Docker it records a synthetic completed action (_ACTION_RESULTS) with the existing format_docker_update_message() guidance and returns {ok: false, error: "docker_update_unsupported", message, update_command} (HTTP 200) without spawning. Non-Docker installs spawn as before. /api/actions/hermes-update/status reads the synthetic result.
  • web/src/lib/api.ts: ActionResponse.pid is now number | null, plus optional error/message/update_command.
  • tests/hermes_cli/test_web_server.py: Docker-guidance-without-spawn + non-Docker-spawns regression coverage.

Validation

  • scripts/run_tests.sh tests/hermes_cli/test_web_server.py — 152 passed (incl. the 3 PtyWebSocket tests the original PR flagged as failing in its ad-hoc venv — env-only, pass here)
  • E2E through the real FastAPI endpoint with a TestClient: Docker install → 200, ok:false, docker_update_unsupported, no spawn, guidance carries docker pull nousresearch/hermes-agent:latest, action log records it, status exit_code:1; git install → spawns hermes update.

Closes #34347

Infographic

dashboard-update-docker-guard

@teknium1 teknium1 requested a review from benbarclay May 30, 2026 12:27
@teknium1

Copy link
Copy Markdown
Contributor Author

@benbarclay tagging you for the container/s6 surface — this seeds root gateway_state.json to running when PID 1's argv is the legacy gateway run and no state file exists, so tini→s6 upgrades auto-start the gateway again. Respects --no-supervise and HERMES_GATEWAY_NO_SUPERVISE; explicit stopped state is preserved.

@github-actions

github-actions Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-d44c5398 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 9507 on HEAD, 9507 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 4931 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@teknium1 teknium1 force-pushed the hermes/hermes-d44c5398 branch from 8e7758e to 1ab6057 Compare May 30, 2026 12:28
@teknium1 teknium1 changed the title fix(docker): seed s6 gateway state for legacy gateway run containers fix(dashboard): guard update endpoint in Docker with structured guidance May 30, 2026
@teknium1

Copy link
Copy Markdown
Contributor Author

@benbarclay courtesy ping for the Docker-detection behavior — the dashboard update endpoint now branches on detect_install_method() == docker to return structured guidance instead of spawning hermes update (which exits non-zero in a container and rendered as a raw error). No container/s6 boot changes here, just the install-method gate.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists area/docker Docker image, Compose, packaging comp/cli CLI entry point, hermes_cli/, setup wizard labels May 30, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Salvage of #34831. Closes #34347.

@benbarclay

Copy link
Copy Markdown
Collaborator

Superseded by #36263 (merged in c1a531d), a rebased salvage of the original #34831 (@donovan-yohan) with the merge conflict resolved. The dashboard Docker-update guard is now on main.

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

Labels

area/docker Docker image, Compose, packaging comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WebUI "Update" button surfaces raw SystemExit when run in Docker context

4 participants