Repository navigation
Description
After updating a git-source install of Hermes Agent via git pull --ff-only
(the documented update path for source installs per the project docs), the
version banner continues to report a stale "N commits behind" count for up to
6 hours — the duration of the update-check cache TTL.
The issue does *not affect pip installs or installs updated via
hermes update, only git-source installs that the user updates manually with
git pull.
Environment
- Hermes Agent version:
v0.16.0(upstreamfd4c8b40) - Install method:
gitsource (editable install viapip install -e .) - Update command used:
git pull --ff-onlyin/.hermes/hermes-agent/,
followed bypip install -e . - Python: 3.11.15
- Profile: default (single profile, not multi-profile)
Steps to reproduce
- Install Hermes from git source:
git clone … && pip install -e . - Wait until the version banner reports a non-zero "commits behind" count
(e.g. after a few days of upstream activity, or simulate withgit reset --hard HEAD81against a fresh origin). - Run
hermes --versionto confirm the cache populates with the stale count
in/.hermes/.update_check:{"ts": 1780798639.18, "behind": 81, "rev": null, "ver": "0.16.0"} - Update the install manually:
cd /.hermes/hermes-agent git pull --ff-only # moves HEAD to origin/main pip install -e .
- Verify the update succeeded:
git rev-list --left-right --count HEAD...origin/main # 0 0 - Run
hermes --versionagain.
Actual behavior
The banner still reports Update available: 81 commits behind — run 'hermes update', even though the local repo is at the same commit as origin/main.
The same string is returned on every subsequent hermes --version call for
up to 6 hours.
Expected behavior
The banner reflects the current state: 0 commits behind immediately after
git pull succeeds.
Root cause
The update-check cache is stored at ~/.hermes/.update_check and
invalidated in hermes_cli/banner.py (lines 252-263, approximate) by a
three-part predicate:
if (now - cached.get("ts", 0) < _UPDATE_CHECK_CACHE_SECONDS
and cached.get("rev") == embedded_rev
and cached.get("ver") == VERSION):
return cached.get("behind")For git-source installs:
embedded_revisNone(noHERMES_REVISIONenv var)VERSIONis read fromhermes_cli/__init__.py
If the new VERSION matches the cached VERSION — which it does in the
common case of an update that does not bump __version__ (e.g. a
release that ships a backport, security fix, or non-versioned patch batch)
— the cache is considered valid and the stale behind count is returned
for the full 6-hour TTL.
The pre-existing helper _invalidate_update_cache() in main.py:8695
already exists for this purpose, but is only invoked by hermes update,
not by the manual git pull workflow that source installs are documented
to use.
Proposed fix
Two reasonable directions, in order of preference:
Option A — Track the "behind" count, not just the version.*
[6/6/2026 10:44 PM] @rubens_jarvis_bot: origin/main` has moved since the cache was
written, invalidate.
**Option B — Invalidate cache when the version string matches but a fresh
check would return 0.**
In the banner-check path, after computing the fresh `behind` count, if
`behind == 0` and the cache has any non-zero value, delete the cache and
write a fresh entry. This is a one-liner and handles the user's most
common case ("I just updated, why is it still telling me to update?").
**Option C — Document and provide a hook.**
Document that source-install users should run a one-liner after
`git pull`:
```bash
rm ~/.hermes/.update_check
…and optionally ship it as a post-merge git hook in the source repo.
My preference is A + a small UX touch: the cache should self-heal
when it can detect staleness, but the cost of an extra git fetch on
every hermes --version call (already happening in the current code) is
low, so Option A is safe.
Workaround (verified working)
rm ~/.hermes/.update_checkAfter deletion, the next hermes --version call performs a fresh
git fetch origin + git rev-list --count HEAD..origin/main and reports
the correct value.
Additional notes
- This is purely a UX/display issue; the underlying update mechanism
works correctly. - I have not tested on multi-profile installs but the bug should affect
all profiles that share the same~/.hermes/.update_checkfile
(or per-profile equivalents). - Diagnostic data:
- Cache file:
~/.hermes/.update_check(JSON, plain text) - Banner code:
hermes_cli/banner.py - Invalidation helper:
main.py::_invalidate_update_cache()
- Cache file:
Tested version
- Hermes:
v0.16.0(commitfd4c8b404bd0a8bc9938a4f4c259830cbf8a4433) - Date observed: 2026-06-06
Activity
Ruben0531 commentedon Jun 7, 2026
Additional finding: the invalidation helper _invalidate_update_cache() targets ~/.hermes/.update_cache but the banner reads/writes ~/.hermes/.update_check — different filenames. This looks like an incomplete refactor. The helper would never invalidate the cache the banner actually uses, which may explain why hermes update also exhibits this behavior."
wdywot commentedon Jul 26, 2026
Observed on a multi-profile source install as well.
hermes --profile ops update --backup --yes.HEAD == origin/main == 339d968689a3b91c5f537d7198ff28abde32ab3b(verified withgit rev-parse).hermes versionandhermes update --checkstill reported “Update available: 1 commit behind”.--profile ops; no local tracked source modifications were present.So the stale cache is also observable after the built-in updater, not only after a manual pull.
GottZ commentedon Jul 28, 2026
Summary
38 PRs address or reference this issue complex. Most target the stale source-install cache by adding a local-HEAD fingerprint; the remaining PRs cover built-in/ZIP invalidation, failed-check and commit-list caching, long-lived in-memory state, detached release tags, version metadata, or unrelated aggregate changes.
Related pull requests
unverified— (+14/-1) — superseded reference: Invalidates.update_checkon the built-in updater’s already-current and post-pull paths, but does not make manual source pulls self-invalidating; it remains relevant because its commit was cherry-picked into fix(cli): invalidate update-check cache after hermes update #1637.unverified— (+14/-1) — merged reference implementation: Implements built-in updater invalidation from fix(cli): invalidate update-check cache after hermes update #1627 and fixes [Bug]:hermes --versionshows "26 commits behind" when already on latest #1620’s wrapper paths, but manualgit pullstill bypasses it.unverified— (+69/-4) — duplicate: Fingerprints bothHEADandorigin/mainand tests ref changes, directly addressing the cause, but duplicates the focused HEAD-keyed chain and targets an older implementation.unverified— (+64/-10) — duplicate: StoresHEAD, invalidates a fresh cache after a pull, and adds the core regression test; it is an early implementation of the same local-HEAD fix now covered more compatibly by fix(cli): bust update-check cache when local HEAD moves #41043.unverified— (+134/-12) — duplicate requiring salvage: TracksHEADandorigin/main, but its old monolithic refresh path would bypass current shallow-clone andrev/verbehavior. Despite the keep_open review on fix: invalidate stale update-check cache when refs change #9951, fix(cli): bust update-check cache when local HEAD moves #41043 is preferable because its diff layers HEAD validation onto the current cache contract instead of replacing the current local-git path.unverified— (+16/-2) — duplicate without regression coverage: Adds a HEAD cache key but targets the old function shape. Despite the keep_open review on fix: invalidate update-check cache on HEAD change #11210, its diff lacks the requested changed-HEAD test and current install-mode integration already present in fix(cli): bust update-check cache when local HEAD moves #41043.unverified— (+178/-37) — superseded and over-scoped: Adds active-checkout path and HEAD identity, but mixes in unrelated provider-fallback changes; it remains relevant as evidence for repo-path selection and was closed after fix(profiles,banner): exclude infrastructure from --clone-all + fix stale update-check repo resolution (salvage of #5025, #5026, #21728) #22475 resolved that separate resolver problem.unverified— (+5/-1) — separate ZIP-path fix: Adds the missing invalidation call after successful ZIP updates, which does not solve manual git pulls. The contributor CHANGES_REQUESTED review asks for the PR template and conflict fixes; the separate keep_open COMMENTED review—not that blocking review—requests a focused successful-ZIP regression test, so merge only after both sets of requirements are addressed.unverified— (+51/-17) — duplicate with unsafe refresh shortcut: Revalidates positive cached counts via directrev-list, but bypasses the current shallow-clone path and dropsrev/veron correction. Despite its keep_open review, the diff’s cache-schema and shallow-history regressions make fix(cli): bust update-check cache when local HEAD moves #41043 the safer consolidation target.unverified— (+132/-16) — duplicate with useful worktree handling: Reads local HEAD without a subprocess and supports.gitindirection, but reinstates stale checkout selection and predates the current cache schema; it remains relevant as implementation evidence despite being closed.unverified— (+8077/-324) — reject aggregate: The cache issue is not isolated in this 27-commit, multi-subsystem fork integration. Despite the keep_open review, that same contributor review says it cannot be safely merged as-is due to hard-coded fork publication, missing config registration, conflicts, and an obsolete base.unverified— (+8174/-342) — reject aggregate duplicate: Its focused hunk adds a HEAD key, but the 61-file branch omits currentver/PyPI behavior and includes extensive unrelated work. Despite the keep_open review, the diff supports salvaging only the cache idea, which fix(cli): bust update-check cache when local HEAD moves #41043 already provides in a narrow patch.unverified— (+91/-12) — high-salvage duplicate: Addsrepo_headand focused cache-hit/cache-miss tests, directly matching the cause. Despite the keep_open review, the branch conflicts with currentrev/verand resolver code, while fix(cli): bust update-check cache when local HEAD moves #41043 is already rebased onto that contract.unverified— (+258/-18) — superseded but novel reference: Duplicates on-disk HEAD binding, yet uniquely refreshes the frozen module-level result when a long-lived TUI process observes HEAD movement; it remains relevant after closure as a separate Bug: TUI banner shows stale "N commits behind" after successfulhermes update#20728 follow-up, not as the Banner shows stale "commits behind" count after manual git pull in source installs #40944 fix.unverified— (+108/-13) — closed duplicate: Fingerprints both local and upstream refs and tests both movements, but overlaps the established HEAD-keyed chain; it remains useful evidence for a possible upstream-ref follow-up.unverified— (+80/-11) — closed duplicate: Stores local revision and tests manual-pull invalidation, but the author closed it after recognizing overlap with fix: invalidate update cache when local HEAD changes #18236/fix: invalidate stale update-check cache #21447; its Termux result is supporting evidence, not a distinct fix.unverified— (+105/-23) — duplicate requiring current-schema repair: Keys source caches by HEAD, but removes the currentvercontract and weakens non-git cache reuse. Despite the keep_open review, those diff-level gaps make fix(cli): bust update-check cache when local HEAD moves #41043 the better primary patch.unverified— (+23/-4) — separate partial fix: Avoids persisting failed checks and synchronizes explicit--check, but its write omits currentverand can cache arbitrary-branch counts as main status. Despite the keep_open review, retain only the failed-result rule and revise branch/schema handling rather than treating it as the primary fix for [Bug]: Update check cache hides commit list until ~/.hermes/.update_check is manually deleted #23681.unverified— (+54/-1) — canonical [Bug]: Update check cache hides commit list until ~/.hermes/.update_check is manually deleted #23681 commit-list fix requiring revision: Adds cached pending commits and renders them in--check/the banner, directly addressing the missing-list symptom. The visible keep_open review should be followed: keep fix(update): show pending commit list in --check output and banner #23700 as the selected [Bug]: Update check cache hides commit list until ~/.hermes/.update_check is manually deleted #23681 implementation, but align its log range withcompare_branch, preserve shallow behavior, and add tests before salvage.unverified— (+106/-16) — closed duplicate: Keys the cache on checkout path,HEAD, andorigin/main, but predates the currentverschema; it remains relevant for its upstream-ref-change regression.unverified— (+93/-29) — duplicate with pre-fetch fingerprint flaw: TracksHEADplusorigin/main, but writes a fingerprint computed before fetch, causing an avoidable next-run miss. Despite the keep_open review, fix(cli): bust update-check cache when local HEAD moves #41043 is the cleaner local-HEAD fix; upstream movement should be a separate post-fetch change.unverified— (+98/-17) — closed duplicate: Adds HEAD-keyed invalidation and tests the changed-HEAD transition, but intentionally closed in favor of the older fix: invalidate update check cache when HEAD moves (e.g. git pull) #9670 chain.unverified— (+129/-40) — high-salvage duplicate: Preservesrevandverwhile addingrepo_headand a changed-HEAD test, but the branch was conflict-bearing. Despite its keep_open review, fix(cli): bust update-check cache when local HEAD moves #41043 now carries the same focused mechanism on a later base and is the selected consolidation target.unverified— (+5/-5) — implemented metadata reference: Corrected the old 0.15.1/0.15.2 drift across package, CLI, and ACP metadata, but current main now has newer release metadata; applying it would downgrade the project.unverified— (+4/-4) — rejected manual version bump: Changes the same old metadata drift, but a contributor documented that release tooling owns these fields. It remains relevant as a recorded design decision and should not be reopened or merged manually.unverified— (+34/-16) — duplicate without tests: Adds local short HEAD to the existingrev/verguard but has no changed-HEAD regression and conflicts with the Docker-era function. Despite the keep_open review, fix(cli): bust update-check cache when local HEAD moves #41043 supplies the missing regression on the current structure.unverified— (+3/-3) — closed metadata duplicate: Bumps only package and CLI metadata, omitting ACP metadata and duplicating fix(version): bump main branch to 0.15.2 to match latest release tag v2026.5.29.2 #38103; current main supersedes both with newer release-tool output.unverified— (+148/-2) — narrower separate tag-path candidate: Suppresses main-branch counts for exact detached tags, but treats old and latest tags alike as current. Despite the keep_open review, fix(version): handle detached release tags in update check #39875’s diff distinguishes the latest upstream release from older tags and gates the upstream probe by official origin, so fix(version): suppress false 'commits behind' warning on detached HEAD (tag checkout) #39776 can be closed as the weaker duplicate after that path is validated.unverified— (+266/-2) — preferred detached-release follow-up: Detects exact detached numeric release tags, gates remote tag comparison to the official origin, reports the latest tag as current and older tags as update-available without a bogus main count. Its keep_open review is addressed by the refreshed diff’s SSH, shallow/full-clone, fork-origin, and CI-detached coverage; keep it separate from Banner shows stale "commits behind" count after manual git pull in source installs #40944.unverified— (+68/-12) — duplicate missing the key transition test: Adds a local HEAD cache field while retainingrev/ver, but its submitted tests cover matching HEAD and expiry rather than old-to-new HEAD. Despite the keep_open review, fix(cli): bust update-check cache when local HEAD moves #41043 includes that exact regression and is therefore the stronger primary patch.fixes— (+138/-11) — closed verified alternative: Directly fixes Banner shows stale "commits behind" count after manual git pull in source installs #40944 by adding HEAD to the current cache predicate and tests changed HEAD, cache hits, and legacy payloads. It remains highly relevant despite closure, but reopening it would duplicate the selected, rebased fix(cli): bust update-check cache when local HEAD moves #41043.partial— (+204/-38) — partial and obsolete-base duplicate: Attempts HEAD-aware refresh but replaces the current cache and local-git structure and includes broad formatting churn. Despite its keep_open review, the diff does not apply to current main and would lose current shallow/SSH behavior, so close it in favor of fix(cli): bust update-check cache when local HEAD moves #41043.partial— (+121/-18) — partial duplicate: Correctly adds a source HEAD key and changed-HEAD test, but its mocks omit current origin and shallow probes and the branch conflicts. Despite its keep_open review, fix(cli): bust update-check cache when local HEAD moves #41043 preserves and exercises the later implementation more directly.best fix— (+112/-23) — best fix: Adds localHEADto the existingts/rev/vercache identity, keeps the current resolver and local-git refresh path, self-heals legacy cache files, and tests the exact fresh-old-HEAD to live-new-HEAD transition. This agrees with the keep_open review and the Verify best-fix verdict; its latest rebase reports 15/15 targeted tests passing.unverified— (+120/-6) — separate, incomplete UX change: Adds branch/tag context and a checkout-state cache key, but suppresses feature-branch status broadly and misses the shallow--checkpath. Despite the keep_open review, it should not be merged into Banner shows stale "commits behind" count after manual git pull in source installs #40944; detached-tag UX is better isolated in fix(version): handle detached release tags in update check #39875.fixes— (+476/-23) — closed broader follow-up: Tracks both local and upstream HEAD, surfaces the shallow sentinel, and changes the non-git TTL and version output. Despite its keep_open review, these are multiple behavioral changes beyond Banner shows stale "commits behind" count after manual git pull in source installs #40944; retain the upstream-head and shallow-output tests for separate focused PRs rather than replacing fix(cli): bust update-check cache when local HEAD moves #41043.unverified— (+122/-0) — closed [Bug]: Update check cache hides commit list until ~/.hermes/.update_check is manually deleted #23681 follow-up reference: Uses the resolved comparison branch for pending commits, but ran an unbounded log, had a missingMagicMockimport, and cited the wrong issue. Despite its keep_open review, it was correctly closed after its refinements were ported; fix(update): show pending commit list in --check output and banner #23700 remains the selected canonical [Bug]: Update check cache hides commit list until ~/.hermes/.update_check is manually deleted #23681 change to revise.unverified— (+101/-0) — improved duplicate implementation, not the selected [Bug]: Update check cache hides commit list until ~/.hermes/.update_check is manually deleted #23681 canonical PR: Boundsgit log, uses the resolved comparison branch, and fixes feat(update): show pending commit list in --check output #63750’s test bug. It can provide patch material to fix(update): show pending commit list in --check output and banner #23700, but should not replace the recorded best-fix selection of fix(update): show pending commit list in --check output and banner #23700 for [Bug]: Update check cache hides commit list until ~/.hermes/.update_check is manually deleted #23681.Duplicates
Core local-HEAD cache duplicates: #5359, #9670, #9951, #11210, #11451, #18236, #18888, #20653, #20792 (on-disk portion), #21447, #21675, #22118, #25435, #26006, #26180, #27844, #38337, #40157, #40985, #40999, #41012, #41043, and #54874 (local-HEAD portion). Built-in updater duplicates: #1627/#1637. Version-metadata duplicates: #35524/#38103/#38619. Detached-tag competitors: #39776/#39875, with overlapping broader #43824. Pending-commit-list implementations: #23700/#63750/#68490. #11329, #23699, and the in-memory portion of #20792 are adjacent but materially distinct.
Suggested consolidation
Merge #41043 as the focused #40944 fix: it is the Verify-selected best fix, preserves the current cache/install-mode contract, and tests the precise manual-fast-forward transition. Close the remaining local-HEAD-only PRs as duplicates, leaving already closed or merged references closed; do not merge the aggregate #18873/#18888 branches. Keep #11329 separate and do not merge it over the contributor CHANGES_REQUESTED review until its template/conflicts are fixed; independently satisfy the keep_open review’s ZIP-success regression-test request. For #23681, retain #23700 as the recorded canonical best fix and revise it per its keep_open review, using bounded-range ideas from #68490 only as patch material rather than replacing #23700. Handle failed-result persistence from #23699, long-lived in-memory refresh from #20792, detached release tags via #39875, and upstream-HEAD/shallow-output ideas from #54874 as separate scoped follow-ups.
Complex graph
flowchart TD classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937 classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151 classDef best stroke-width:3px,stroke:#b45309 classDef target stroke-width:3px,stroke:#4338ca I1620(["issue #1620 (closed)"]) I11007(["issue #11007 (closed)"]) I11327(["issue #11327 (open)"]) I27841(["issue #27841 (closed)"]) I40944(["issue #40944 (open)"]) P9951["PR #9951 (open)"] P11225["PR #11225 (closed)"] subgraph Dup1627 ["PRs duplicating each other"] P1627["PR #1627 (closed)"] P1637["PR #1637 (merged)"] end subgraph Dup5359 ["PRs duplicating each other"] P5359["PR #5359 (closed)"] P9670["PR #9670 (open)"] P11210["PR #11210 (open)"] P54874["PR #54874 (closed)"] end subgraph Dup40985 ["PRs duplicating each other"] P40985["PR #40985 (closed)"] P40999["PR #40999 (open)"] P41012["PR #41012 (open)"] P41043["PR #41043 (open)"] end More["+26 more PRs not shown"] MoreI(["+5 more issues not shown"]) P1627 -.->|unverified| I40944 P1637 -.->|unverified| I40944 P5359 -.->|unverified| I40944 P9670 -.->|unverified| I40944 P9951 -.->|unverified| I40944 P11210 -.->|unverified| I40944 P11225 -.->|unverified| I40944 P40985 -->|fixes| I40944 P40999 -.->|partial| I40944 P41012 -.->|partial| I40944 P41043 -->|best fix| I40944 P54874 -->|fixes| I40944 P1627 -->|fixes| I1620 P1637 -->|best fix| I1620 P5359 -->|fixes| I11007 P9670 -->|fixes| I11007 P9951 -->|fixes| I11007 P11210 -->|fixes| I11007 P11225 -->|fixes| I11007 P41043 -->|best fix| I11007 P54874 -->|fixes| I11007 P41043 -->|best fix| I11327 P41043 -->|best fix| I27841 class I1620 closed class I11007 closed class I11327 open class I27841 closed class I40944 open class I40944 target class P1627 closed class P1637 merged class P5359 closed class P9670 open class P9951 open class P11210 open class P11225 closed class P40985 closed class P40999 open class P41012 open class P41043 open class P54874 closed class P1637 best class P41043 best class P41043 best class P41043 best class P41043 best class More closed class MoreI closed click I1620 "https://github.com/NousResearch/hermes-agent/issues/1620" click I11007 "https://github.com/NousResearch/hermes-agent/issues/11007" click I11327 "https://github.com/NousResearch/hermes-agent/issues/11327" click I27841 "https://github.com/NousResearch/hermes-agent/issues/27841" click I40944 "https://github.com/NousResearch/hermes-agent/issues/40944" click P1627 "https://github.com/NousResearch/hermes-agent/pull/1627" click P1637 "https://github.com/NousResearch/hermes-agent/pull/1637" click P5359 "https://github.com/NousResearch/hermes-agent/pull/5359" click P9670 "https://github.com/NousResearch/hermes-agent/pull/9670" click P9951 "https://github.com/NousResearch/hermes-agent/pull/9951" click P11210 "https://github.com/NousResearch/hermes-agent/pull/11210" click P11225 "https://github.com/NousResearch/hermes-agent/pull/11225" click P40985 "https://github.com/NousResearch/hermes-agent/pull/40985" click P40999 "https://github.com/NousResearch/hermes-agent/pull/40999" click P41012 "https://github.com/NousResearch/hermes-agent/pull/41012" click P41043 "https://github.com/NousResearch/hermes-agent/pull/41043" click P54874 "https://github.com/NousResearch/hermes-agent/pull/54874"Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed or no verify verdict yet (state tag in the node label).
Cross-PR triage: Reviewed 38 pull requests and 10 issues in this complex. Each diff was read against this issue; Assessment working set: 1107 kB of PR diffs, 87 kB of issue/PR text, 63 kB of discussion (95 comments), 85 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.
fix(cli): bust update-check cache when local HEAD moves
teknium1 commentedon Oct 7, 2026
Checked against current
mainas part of the updater backlog sweep: this one is fixed.Fixed by: cfebdfd — Own passive source update checks in Python (on
mainsince 2026-09-12).Where:
hermes_cli/source_check.py::check_for_updates / _cached_statusWhy this resolves it: The stale count came from a TTL cache in ~/.hermes/.update_check that ignored local HEAD. cfebdfd replaced it with home/source-checks/<install_id>.json whose cache identity includes {'head': co.head, origin, branch,...}, and _cached_status only returns the cache when identity == current. A manual git pull changes HEAD, so the cache misses and the count is recomputed.
If you still hit this on a build that includes that commit, please reopen with the output of
hermes debug shareand we'll pick it straight back up. Thanks for the report.