Skip to content

fix: declare four missing hermes_state_* modules in py-modules - #74393

Closed
cat-thats-fat wants to merge 3 commits into
NousResearch:mainfrom
cat-thats-fat:74287-py-modules
Closed

fix: declare four missing hermes_state_* modules in py-modules#74393
cat-thats-fat wants to merge 3 commits into
NousResearch:mainfrom
cat-thats-fat:74287-py-modules

Conversation

@cat-thats-fat

Copy link
Copy Markdown
Contributor

Summary

Fixes #74287hermes_state.py imports four sibling modules that were never declared in [tool.setuptools].py-modules, so the session store is silently dead on every wheel-based install.

Root Cause

hermes_state.py:45,70-72 imports from hermes_state_common, hermes_state_portability, hermes_state_schema, and hermes_state_search, but pyproject.toml line 348 only listed hermes_state. These four modules were absent from the built wheel, causing ModuleNotFoundError on import.

The shipped error message suggests hermes update to rebuild the venv — which can't help because the modules are missing from the distribution itself, not from the venv.

Changes

pyproject.toml

  • Added the four missing modules to py-modules
  • Reformatted from a single long line to sorted multi-line for readability

tests/test_packaging_build_guard.py

  • Added test_py_modules_cover_installable_root_modules — asserts every installable root .py module is declared in py-modules, and the list stays sorted
  • Added test_wheel_contains_every_declared_py_module — verifies the built wheel actually ships every declared module
  • Added ALLOW_UNPACKAGED_ROOT_MODULES allowlist for intentional exclusions (mini_swe_runner, setup)
  • Refactored existing build tests to share artifacts via a module-scoped fixture

Verification

  • All 5 hermes_state* modules import successfully
  • All 18 declared py-modules map to existing .py files
  • List is sorted alphabetically
  • No runtime behavior changes — packaging metadata only

hermes_state.py imports hermes_state_common, hermes_state_portability,
hermes_state_schema, and hermes_state_search, but none were listed in
[tool.setuptools].py-modules. Every wheel-based install silently loses
session persistence — no --continue, no --resume, no session search.

Added the four modules and reformatted the list from a single line to
sorted multi-line for readability. Added a CI guard test that asserts
every installable root .py module is declared in py-modules, so this
class of drift can't recur.
@cat-thats-fat
cat-thats-fat requested a review from a team July 29, 2026 21:16
@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint area/sessions Session lifecycle, resume, persistence, history area/install-update Installer, updater, packaging, wheels, doctor sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Jul 29, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused packaging fix. Current main still has the reported defect: hermes_state.py:45-72 imports the four split root modules and composes their mixins at hermes_state.py:1720, while pyproject.toml:346-352 declares only hermes_state in setuptools py-modules. The proposed metadata entries directly cover that import chain, and the added wheel inspection guard exercises the supported Nix artifact path documented by setup.py:17-20.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-broad Sweeper blast radius: broad — a core path most sessions hit labels Jul 30, 2026
@isak-ialogics

Copy link
Copy Markdown
Contributor

Current upstream/main now contains the exact four hermes_state_* py-modules entries via merged #74362 (36e41c09e). After this branch's latest main merges, the PR diff confirms the pyproject.toml hunk only reorders/alphabetizes entries; the remaining substantive delta is the packaging guard tests. Suggested next action: rebase and drop the now-implemented metadata hunk, then scope the PR explicitly to the regression guard if that guard is still desired.

@ethernet8023

Copy link
Copy Markdown
Collaborator

fixed in #74362

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/install-update Installer, updater, packaging, wheels, doctor area/sessions Session lifecycle, resume, persistence, history comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P1 High — major feature broken, no workaround sweeper:blast-broad Sweeper blast radius: broad — a core path most sessions hit sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pyproject.toml py-modules omits four hermes_state_* modules — session store silently disabled in every wheel-based install (found on NixOS)

5 participants