fix: invalidate update cache when local HEAD changes - #18236
Conversation
|
Hit the exact gap this PR fixes today on The approach here looks like the right one — pure-Python One thing to flag for the rebaseSince this PR was opened (May 1), if not embedded_rev:
repo_dir = hermes_home / "hermes-agent"
if not (repo_dir / ".git").exists():
repo_dir = Path(__file__).parent.parent.resolve()reinstates the old order. If a profile carries a stale Two minor polish suggestions
Neither blocks the fix. Once rebased onto current main with the path priority restored, this should be ready to go — it's the cleanest of the 5 open PRs targeting this bug and the only one with a regression test for the actual HEAD-changed case. |
Summary
.git/HEADdirectly so fresh cache entries survive without extra git subprocesseshermes versionupdate banner after manual pulls/branch movesTest Plan
source venv/bin/activate && python -m pytest tests/hermes_cli/test_update_check.py -qrm -f ~/.hermes/.update_check && source venv/bin/activate && python -m hermes_cli.main versionRoot cause
A fresh
.update_checkcache only keyed offHERMES_REVISION(ornullfor local git installs), so a manualgit pullor branch switch could leave a stale cached "1 commit behind" result visible for up to 6 hours.