Skip to content

fix(gateway): use service restart path in Docker/Podman containers - #25219

Closed
bird wants to merge 1 commit into
NousResearch:mainfrom
bird:fix/docker-restart-command
Closed

fix(gateway): use service restart path in Docker/Podman containers#25219
bird wants to merge 1 commit into
NousResearch:mainfrom
bird:fix/docker-restart-command

Conversation

@bird

@bird bird commented May 13, 2026

Copy link
Copy Markdown
Contributor

Fixes #25218

The /restart slash command used a detached subprocess approach to restart the gateway. In Docker/Podman, when the gateway process exits, tini (PID 1) also exits, causing Docker to stop the container and kill the detached helper before it can restart the gateway. This made /restart effectively a /shutdown in containerized deployments.

Changes

Detect Docker (/.dockerenv) and Podman (/run/.containerenv) containers in _handle_restart_command and use the service restart path (exit code 75) instead. This lets the container's restart policy (e.g. unless-stopped or on-failure) handle the actual restart — the same approach already used for systemd.

Notes

  • Requires the container to have a restart policy that restarts on non-zero exit codes
  • Detection is lightweight: just os.path.exists() on well-known container sentinel files

The /restart command used a detached subprocess approach to restart
the gateway. In Docker, when the gateway process exits, tini (PID 1)
also exits, causing Docker to stop the container and kill the detached
helper before it can restart the gateway. This made /restart effectively
a /shutdown in containerized deployments.

Detect Docker (/.dockerenv) and Podman (/run/.containerenv) containers
and use the service restart path (exit code 75) instead, letting the
container restart policy handle the actual restart.

Note: requires restart policy that restarts on non-zero exit (e.g.
unless-stopped or on-failure).
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery area/docker Docker image, Compose, packaging labels May 13, 2026
teknium1 added a commit that referenced this pull request May 17, 2026
…tors

Final LHF run group. Adds release-note attribution mappings for:
- @bird (PR #25219)
- @davidcampbelldc (PR #26834)

(zccyman, wesleysimplicio already mapped from prior groups.)
teknium1 added a commit that referenced this pull request May 17, 2026
…tors

Final LHF run group. Adds release-note attribution mappings for:
- @bird (PR #25219)
- @davidcampbelldc (PR #26834)

(zccyman, wesleysimplicio already mapped from prior groups.)
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #27550 — your commit was cherry-picked onto current main as part of the final batch of the May LHF salvage run. Authorship preserved (fix(gateway): use service restart path in Docker/Podman containers). Thanks for the contribution.

@teknium1 teknium1 closed this May 17, 2026
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…tors

Final LHF run group. Adds release-note attribution mappings for:
- @bird (PR NousResearch#25219)
- @davidcampbelldc (PR NousResearch#26834)

(zccyman, wesleysimplicio already mapped from prior groups.)
Seven74AI pushed a commit to Seven74AI/hermes-agent that referenced this pull request Jun 13, 2026
…tors

Final LHF run group. Adds release-note attribution mappings for:
- @bird (PR NousResearch#25219)
- @davidcampbelldc (PR NousResearch#26834)

(zccyman, wesleysimplicio already mapped from prior groups.)
alt-glitch pushed a commit that referenced this pull request Jun 14, 2026
…tors

Final LHF run group. Adds release-note attribution mappings for:
- @bird (PR #25219)
- @davidcampbelldc (PR #26834)

(zccyman, wesleysimplicio already mapped from prior groups.)
T02200059 pushed a commit to T02200059/hermes-agent that referenced this pull request Jun 18, 2026
…tors

Final LHF run group. Adds release-note attribution mappings for:
- @bird (PR NousResearch#25219)
- @davidcampbelldc (PR NousResearch#26834)

(zccyman, wesleysimplicio already mapped from prior groups.)
liuchanchen pushed a commit to liuchanchen/hermes-agent that referenced this pull request Jun 23, 2026
…tors

Final LHF run group. Adds release-note attribution mappings for:
- @bird (PR NousResearch#25219)
- @davidcampbelldc (PR NousResearch#26834)

(zccyman, wesleysimplicio already mapped from prior groups.)
donbowman pushed a commit to donbowman/hermes-agent that referenced this pull request Jul 13, 2026
…tors

Final LHF run group. Adds release-note attribution mappings for:
- @bird (PR NousResearch#25219)
- @davidcampbelldc (PR NousResearch#26834)

(zccyman, wesleysimplicio already mapped from prior groups.)
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
…tors

Final LHF run group. Adds release-note attribution mappings for:
- @bird (PR NousResearch#25219)
- @davidcampbelldc (PR NousResearch#26834)

(zccyman, wesleysimplicio already mapped from prior groups.)
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/gateway Gateway runner, session dispatch, delivery 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.

/restart shuts down gateway instead of restarting in Docker containers

3 participants