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,