From 87ac7cac131bb47c1b920e9c8b6d57b73db1f37e Mon Sep 17 00:00:00 2001 From: yoniebans Date: Sat, 6 Jun 2026 20:19:04 +0200 Subject: [PATCH] fix(dashboard): log update changelog against origin/main, not @{upstream} MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The behind-count (banner._check_via_local_git) measures HEAD..origin/main, but _recent_upstream_commits logged HEAD..@{upstream}. On a feature-branch checkout @{upstream} is the branch's own tip (0 commits), so the changelog came back empty while behind>0 — the overlay then showed generic filler instead of what changed. Pin the commit range to origin/main so count and changelog agree. Verified against a checkout 11 behind origin/main: now returns 11 commits. --- hermes_cli/web_server.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/hermes_cli/web_server.py b/hermes_cli/web_server.py index 02b9ad1a1d0..60103630396 100644 --- a/hermes_cli/web_server.py +++ b/hermes_cli/web_server.py @@ -1406,11 +1406,16 @@ async def update_hermes(): def _recent_upstream_commits(n: int = 20) -> List[Dict[str, Any]]: - """Commits the local checkout is behind its upstream by, newest first. + """Commits the local checkout is behind ``origin/main`` by, newest first. - Best-effort: returns [] if not a git checkout, no upstream is configured, - or git is unavailable. Used only to enrich the update-check response — - never raises into the request path. + Logs the SAME range the behind-count uses (``HEAD..origin/main`` — see + ``banner._check_via_local_git``), NOT the branch's ``@{upstream}``. On a + feature-branch checkout ``@{upstream}`` is the branch's own tip (zero + commits), which would leave the changelog empty even though the count is + non-zero. Pinning to ``origin/main`` keeps count and changelog consistent. + + Best-effort: returns [] if not a git checkout, origin/main is unreachable, + or git is unavailable. Never raises into the request path. """ try: out = subprocess.run( @@ -1420,7 +1425,7 @@ def _recent_upstream_commits(n: int = 20) -> List[Dict[str, Any]]: str(PROJECT_ROOT), "log", "--format=%H%x1f%s%x1f%an%x1f%ct", - "HEAD..@{upstream}", + "HEAD..origin/main", f"-n{int(n)}", ], capture_output=True,