# NousResearch/hermes-agent · Fork upstream sync in hermes update command

## Open now

- Nothing open on GitHub.

These issues and PRs address a bug where \`hermes update\` incorrectly reports 'Already up to date' on forks when the upstream remote is ahead of origin. Multiple fix attempts focus on consulting upstream before returning early.

## TL;DR

- 4 member(s): 0 open issue(s), 1 closed issue(s), 0 open PR(s), 1 merged PR(s), 2 PR(s) closed without merging.
- A fix was merged to main in PR #33452. Verify it addresses your case.
- **Recommended:** read PR #33452 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `resolved` · deciding PR(s): `pr-33452`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_SPANNING`): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
- Pairwise link density `0.50`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Closed / duplicate issues

- #26172: \`hermes update\` on forks reports "Already up to date!" when origin/main matches HEAD but upstream/main is ahead

## Prior & competing PRs

- **#33452: fix(update): check upstream even when origin/main has no new commits (salvages #4873)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `hermes_cli/main.py`, `tests/hermes_cli/test_cmd_update.py`
  - fix hunks:
  - `hermes_cli/main.py`

    ```diff
    @@ -8928,6 +8928,11 @@ def _cmd_update_impl(args, gateway_mode: bool):
     
             if commit_count == 0:
                 _invalidate_update_cache()
    +
    +            # Even if origin is up to date, the fork may be behind upstream
    +            if is_fork and branch == "main":
    +                _sync_with_upstream_if_needed(git_cmd, PROJECT_ROOT)
    +
                 # Restore stash and switch back to original branch if we moved
                 if auto_stash_ref is not None:
                     _restore_stashed_changes(
    ```
  - `tests/hermes_cli/test_cmd_update.py`

    ```diff
    @@ -106,6 +106,33 @@ def test_update_already_up_to_date(
             pull_cmds = [c for c in commands if "pull" in c]
             assert len(pull_cmds) == 0
     
    +    @patch("shutil.which", return_value=None)
    +    @patch("subprocess.run")
    +    def test_update_on_fork_checks_upstream_when_origin_up_to_date(
    +        self, mock_run, _mock_which, mock_args, capsys
    +    ):
    +        """Regression for issue #26172: forks whose local HEAD already matches
    +        origin/main must still consult upstream/main before printing
    +        "Already up to date!" — otherwise a fork that's caught up to its own
    +        origin but behind NousResearch/hermes-agent silently misses updates.
    +        """
    +        from hermes_cli import main as hm
    +
    +        mock_run.side_effect = _make_run_side_effect(
    +            branch="main", verify_ok=True, commit_count="0"
    +        )
    +
    +        with patch.object(
    +            hm,
    +            "_get_origin_url",
    +            return_value="https://github.com/example/hermes-agent.git",
    +        ), patch.object(hm, "_sync_with_upstream_if_needed") as sync_mock:
    +            cmd_update(mock_args)
    +
    +        sync_mock.assert_called_once_with(["git"], PROJECT_ROOT)
    +        captured = capsys.readouterr()
    +        assert "Already up to date!" in captured.out
    +
         @patch("shutil.which")
         @patch("subprocess.run")
         def test_update_refreshes_repo_and_tui_node_dependencies(
    ```
- **#26249: fix(update): consult upstream before early return**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `6f2a2f157`, `53bdef577`, `#33452`, `#4873`, `#26172`
- **#29524: fix(update): sync fork from upstream before fetch/pull**. closed without merge
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `#33452`, `#4873`, `#26172`

## Fix status

- Merged to main in PR #33452 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-05-27`.
- Subsystem: `hermes_cli`
