Skip to content

check_for_updates() cache not invalidated after pip upgrade, showing stale "1 commit behind" #34491

Closed

Description

@Jasper-1222

Description

After upgrading hermes-agent from 0.14.0 to 0.15.1 via uv pip install --upgrade, hermes --version still shows "1
commit behind" for up to 6 hours.

Root Cause

check_for_updates() in hermes_cli/banner.py caches the result in ~/.hermes/.update_check. The cache invalidation
logic has two conditions:

if (
    now - cached.get("ts", 0) < _UPDATE_CHECK_CACHE_SECONDS
    and cached.get("rev") == embedded_rev
):
    return cached.get("behind")

For pip-installed Hermes (non-Nix), embedded_rev is always None. After an upgrade, both the old and new cache's
rev are None → cache is considered valid → stale "1 commit behind" persists until the 6-hour TTL expires.

Steps to Reproduce

  1. Install hermes-agent==0.14.0, run hermes --version (writes cache with behind: 1)
  2. uv pip install --upgrade hermes-agent to 0.15.1
  3. Run hermes --version → still shows "1 commit behind"
  4. rm ~/.hermes/.update_check, run again → correctly shows "Up to date"

Expected Behavior

Cache should be invalidated when the installed version changes. The simplest fix: add "version": VERSION to the cache
payload and compare it on read.

  try:
      if cache_file.exists():
          cached = json.loads(cache_file.read_text())
          if (
              now - cached.get("ts", 0) < _UPDATE_CHECK_CACHE_SECONDS
              and cached.get("rev") == embedded_rev
+             and cached.get("version") == VERSION
          ):
              return cached.get("behind")
  ...
  cache_file.write_text(json.dumps({
      "ts": now, "behind": behind, "rev": embedded_rev,
+     "version": VERSION
  }))

Environment

  • Hermes Agent v0.15.1 (pip install, no local git checkout)
  • Python 3.11.15, Ubuntu

Reported by @Jasper-1222


Activity

  1. added
    type/bugSomething isn't working
    P3Low — cosmetic, nice to have
    comp/cliCLI entry point, hermes_cli/, setup wizard
    on May 29, 2026
  2. alt-glitch commented on May 29, 2026

    @alt-glitch

    Duplicate of #11327 — same .update_check cache invalidation gap, different update path (pip upgrade vs git pull/zip). Also related to #21675, #21526, #11007.

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

    P3Low — cosmetic, nice to havecomp/cliCLI entry point, hermes_cli/, setup wizardtype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions