Skip to content

[Bug]: .update-incomplete marker causes infinite auto-recovery loop — hermes.exe self-locked on Windows #45542

Closed as not planned

Description

@Icather

Bug Description

When hermes update is interrupted on Windows (terminal closed, process killed), it leaves a .update-incomplete marker file. On EVERY subsequent hermes dashboard launch, the auto-recovery logic re-runs uv pip install -e .[all], which tries to replace hermes.exe — the exact binary that is currently running. This creates a deadlock:

  1. .update-incomplete exists → trigger auto-recovery
  2. Auto-recovery needs to delete hermes.exe
  3. hermes.exe is locked by the running hermes dashboard process → 拒绝访问 (os error 5)
  4. Recovery fails, but .update-incomplete is NOT removed
  5. Every restart repeats the cycle

Steps to Reproduce

  1. On Windows, run hermes update from terminal
  2. Close the terminal mid-update (Ctrl+C unresponsive, user closes window)
  3. Run hermes dashboard
  4. Every launch: ⚠ A previous 'hermes update' was interrupted — finishing dependency installation now...
  5. Then: error: failed to remove file ... hermes.exe: 拒绝访问 (os error 5)
  6. Restart → same error, forever

Expected Behavior

After an interrupted update, hermes dashboard should either:

  • Detect the self-lock and skip replacing the running binary, OR
  • Remove the .update-incomplete marker on failure so it doesn't retry endlessly

Actual Behavior

Every launch triggers the auto-recovery, fails with the same hermes.exe lock error, and leaves the marker intact for the next launch to repeat.

Affected Component

CLI (interactive chat), Setup / Installation

Messaging Platform (if gateway-related)

N/A (CLI only)

Debug Report

Report       https://paste.rs/fDEeg
agent.log    https://dpaste.com/H3QD8PXE7
gateway.log  https://paste.rs/K2TlM

Operating System

Windows 10 (19045), Git Bash / MSYS2, Chinese GBK locale

Python Version

3.11.15

Hermes Version

0.16.0

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

_cmd_update_impl() in hermes_cli/main.py writes .update-incomplete before the install step. When the install fails (e.g. hermes.exe locked by running process), the marker is not cleared.

The dashboard auto-recovery path does not check whether the binary being replaced is the currently executing process before running uv pip install -e .[all].

Proposed Fix (optional)

  1. In auto-recovery: if install fails, REMOVE .update-incomplete marker
  2. In auto-recovery: detect if hermes.exe is the running process, skip or schedule replacement for next launch

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Activity

  1. added
    type/bugSomething isn't working
    P2Medium — degraded but workaround exists
    comp/cliCLI entry point, hermes_cli/, setup wizard
    area/configConfig system, migrations, profiles
    on Jun 13, 2026
  2. konsisumer commented on Jul 7, 2026

    @konsisumer

    These issues look like facets of one underlying problem: #45542, #45860, #46791.

    They were grouped by a semantic pass as different symptoms of one underlying problem in area/config. A single coordinated fix may resolve them together — flagging for visibility; no action has been taken on the individual issues.

    Automated root-cause grouping. Reply to correct if these are unrelated.

  3. teknium1 commented on Jul 14, 2026

    @teknium1
    Collaborator

    Thanks for the clear Windows reproduction and root-cause analysis. This is already fixed on current main by the contributor-authored recovery guard; this is an automated hermes-sweeper review.

    • b6f592dbdc4cf679c797343c526d4e776ac8cd7e added Windows shim-ancestry detection in _recover_from_interrupted_install().
    • hermes_cli/main.py:7073-7118 skips the self-locked reinstall, clears .update-incomplete, releases the recovery lock, and returns.
    • tests/hermes_cli/test_update_interrupted_recovery.py:142-178 verifies the guard skips installation and clears the marker for the exact hermes.exe self-lock case ([Bug]: .update-incomplete marker causes infinite auto-recovery loop — hermes.exe self-locked on Windows #45542).
    • The fix is contained in release tag v2026.7.1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existsarea/configConfig system, migrations, profilescomp/cliCLI entry point, hermes_cli/, setup wizardsweeper:implemented-on-mainSweeper: behavior already present on current maintype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions