Skip to content

[Bug]: Linux default gateway can stay stale after hermes update, causing ImportError #78574

Description

@ccheng555

Bug description

hermes update updated the shared checkout but silently skipped restarting the running default-profile systemd user gateway. The next Telegram turn loaded a mixture of old in-memory modules and newly updated source files and failed with an ImportError.

Steps to reproduce

  1. Run the default profile gateway as the installed Linux systemd user service.
  2. Confirm the gateway is active.
  3. Run hermes update while the gateway remains active.
  4. Send the bot a Telegram message after the update.

Actual behavior

The update started at 2026-08-04T00:02:48, pulled 462 commits, and finished successfully. The update log ends with:

✓ Update complete!

Tip: You can now select a provider and model:
  hermes model

There is no gateway drain or restart step. Earlier updates in the same log include:

→ hermes-gateway: draining (up to 195s)...
✓ Restarted hermes-gateway

The gateway process remained the one started before the update. The next Telegram turn failed with:

ImportError: cannot import name 'is_trivial_prompt' from 'agent.memory_provider'

Trace path:

gateway/run.py -> _run_agent -> _run_agent_inner
run_agent.py: from agent.memory_provider import is_trivial_prompt

A manual hermes gateway restart immediately fixed Telegram.

Expected behavior

As documented, hermes update should detect and restart every running gateway that uses the updated checkout. If restart detection or restart itself fails, the update should exit nonzero or print a clear warning and manual recovery command. It should not report a clean update while leaving a stale gateway running against replaced source files.

Environment

  • Hermes Agent: v0.20.0 (2026.8.3) after update
  • Host: WSL2 Linux
  • Gateway: default profile, installed systemd user service
  • Python: 3.11.15
  • SQLite: 3.53.1
  • Gateway persistence: systemd linger enabled

Additional evidence

The same update.log demonstrates that gateway auto-restart worked on earlier updates but was omitted entirely from this run. This is the default profile on Linux, so it is distinct from reports limited to stale non-default profiles or macOS launchd behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High — major feature broken, no workaroundarea/install-updateInstaller, updater, packaging, wheels, doctorcomp/cliCLI entry point, hermes_cli/, setup wizardcomp/gatewayGateway runner, session dispatch, deliveryplatform/telegramTelegram bot adaptersweeper:risk-compatibilitySweeper risk: may break existing users, config, migrations, defaults, or upgradessweeper:risk-message-deliverySweeper risk: may drop, duplicate, misroute, or suppress messagestype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions