NousResearch/hermes-agent

Version sync between pyproject.toml and __init__.py

Cluster 35070 · hermes cli. Data as of

Nothing open on GitHub. Fix merged in #35142. Check it covers your case.

The short answer

0open issues
0open PRs
5items grouped
Known?
Yes. 5 related items grouped here, 1 issue already closed.
Fix event
A fix was merged to main in PR #35142. Check it covers your case. No release data is tracked.
Tracker
The maintainers' tracker marks this resolved, deciding PR #35142. That is separate from the fix event.
Still open
Nothing open on GitHub.

These issues and PRs address a problem where the CLI version in __init__.py can fall out of sync with pyproject.toml, particularly during upgrade conflicts. The work involves adding version consistency checks to the hermes doctor command and reading the version from pyproject.toml as the source of truth.

Open issues0

No open issues.

Open PRs0

No open pull requests.

Fixes on record

Merged to main. A stamp counts the issues a fix is linked to.

  • #35142 fix: detect version drift between pyproject.toml and __init__.py in hermes doctor

    merged to main

    files: hermes_cli/doctor.py

    Show the diff
    • hermes_cli/doctor.py
      @@ -204,6 +204,60 @@ def _fail_and_issue(text: str, detail: str, fix: str, issues: list[str]) -> None
           issues.append(fix)
       
       
      +def _read_pyproject_version() -> str | None:
      +    """Read the ``version = "..."`` from ``pyproject.toml`` at the project root.
      +
      +    Returns None when running from an installed wheel (no pyproject.toml ships
      +    with the package) or when the file can't be parsed. Reads only the
      +    ``[project]`` version, ignoring any version strings that appear in other
      +    tables.
      +    """
      +    pyproject = PROJECT_ROOT / "pyproject.toml"
      +    try:
      +        text = pyproject.read_text(encoding="utf-8")
      +    except OSError:
      +        return None
      +    in_project = False
      +    for raw in text.splitlines():
      +        line = raw.strip()
      +        if line.startswith("[") and line.endswith("]"):
      +            in_project = line == "[project]"
      +            continue
      +        if in_project and line.startswith("version") and "=" in line:
      +            value = line.split("=", 1)[1]
      +            value = value.split("#", 1)[0].strip().strip("\"'")
      +            return value or None
      +    return None
      +
      +
      +def _check_version_consistency(issues: list[str]) -> None:
      +    """Verify pyproject.toml version matches hermes_cli.__version__.
      +
      +    A git conflict resolution (reset/merge) can revert one file without the
      +    other, leaving ``hermes --version`` reporting a stale version while
      +    ``pyproject.toml`` is current. Detect that drift so users can re-sync.
      +    Silent no-op for installed wheels where pyproject.toml isn't present.
      +    """
      +    try:
      +        from hermes_cli import __version__ as init_version
      +    except Exception:
      +        return
      +    pyproject_version = _read_pyproject_version()
      +    if pyproject_version is None:
      +        # Installed wheel or unreadable pyproject — nothing to cross-check.
      +        return
      +    if pyproject_version == init_version:
      +        check_ok("Version files consistent", f"({init_version})")
      +    else:
      +        _fail_and_issue(
      +            "Version mismatch between source files",
      +            f"(pyproject.toml {pyproject_version} != hermes_cli/__init__.py {init_version})",
      +            "Re-sync version files (e.g. run 'hermes update', or set "
      +            "hermes_cli/__init__.py __version__ to match pyproject.toml)",
      +            issues,
      +        )
      +
      +
       def _check_s6_supervision(issues: list[str]) -> None:
           """Inside a container under our s6 /init, surface what s6 sees.
       
      @@ -509,6 +563,10 @@ def run_doctor(args):
               check_ok("Virtual environment active")
           else:
               check_warn("Not in virtual environment", "(recommended)")
      +
      +    # Detect drift between pyproject.toml and hermes_cli/__init__.py versions
      +    # (a git conflict resolution can silently revert one but not the other).
      +    _check_version_consistency(issues)
           
           _section("Required Packages")
           required_packages = [

3 PRs closed without merging

From the close comments: done elsewhere 1 · stale or abandoned 1 · superseded by another PR 1

  • #35160 fix(cli): read version from pyproject.toml to prevent stale version (#35070) · done elsewhere → bb79bcd, #35142
  • #35169 fix(doctor): add version consistency check between pyproject.toml and __init__.py · superseded by another PR → #35172
  • #35172 fix(cli): add version consistency check to hermes doctor · stale or abandoned
Closed issues · 1
  • Closed#35070Version mismatch: hermes_cli/__init__.py gets reverted during upgrade conflict resolution
How this cluster was grouped
  • Link evidence (structural links throughout): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
  • Pairwise link density 0.40: the share of item 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.

Pick up a Lab task

Check whether a fix covers the open issues here, with your own agent. Bring back evidence for maintainers.

Open the Lab

At a glance

Subsystem
hermes cli
Merged PRs
#35142
Closed issues
1
Attempts
3 PRs closed without merging
Fix link checked
30 May 2026

For your agent

The same facts, typed.