fix(packaging): add 4 hermes_state_* modules to pyproject.toml py-modules - #74412
fix(packaging): add 4 hermes_state_* modules to pyproject.toml py-modules#74412webtecnica wants to merge 2 commits into
Conversation
…anical move, ~2.9K LOC out of hermes_state.py)
…ules hermes_state.py was refactored into four top-level modules: - hermes_state_common (shared constants) - hermes_state_portability (SessionPortabilityMixin) - hermes_state_schema (SessionSchemaMixin) - hermes_state_search (SessionSearchMixin) These modules were missing from [tool.setuptools] py-modules, so any wheel-based install (pip, uv, nix, distro packaging) silently shipped without them, disabling the SQLite session store entirely. Fixes NousResearch#74287
Duplicate of #74393 — it covers the same four missing |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for identifying the missing setuptools entries. The packaging hunk is needed: current hermes_state.py:45-72 imports the four split root modules, while current pyproject.toml:349 still omits all four from py-modules.
Problems
- The PR includes the large SessionDB extraction already present on current main through ancestor commit
21c7ae8563; only thepyproject.tomlchange remains to salvage. - No regression test covers wheel contents.
tests/test_packaging_build_guard.py:64-72verifies that a permitted artifact exists, but not that it contains these required root modules.
Suggested changes
- Salvage the focused packaging commit
bcfd7ccafe1a109de2a54fb56427487829918f8fonly. - Add a built-wheel member assertion for the four
hermes_state_*.pymodules.
Automated hermes-sweeper review.
| # Top-level single-file modules (not packages). Without this, uv2nix's | ||
| # sealed venv is missing hermes_constants, run_agent, etc. | ||
| py-modules = ["run_agent", "model_tools", "toolsets", "batch_runner", "trajectory_compressor", "toolset_distributions", "cli", "hermes_bootstrap", "hermes_constants", "hermes_state", "hermes_time", "hermes_logging", "utils", "mcp_serve"] | ||
| py-modules = ["run_agent", "model_tools", "toolsets", "batch_runner", "trajectory_compressor", "toolset_distributions", "cli", "hermes_bootstrap", "hermes_constants", "hermes_state", "hermes_state_common", "hermes_state_portability", "hermes_state_schema", "hermes_state_search", "hermes_time", "hermes_logging", "utils", "mcp_serve"] |
There was a problem hiding this comment.
This metadata repair is correct, but please add a behavioral regression test that inspects a permitted Nix-built wheel for these four files. The existing artifact test only asserts that an artifact was created, so it cannot detect a missing py-module.
|
already fixed in 74362 |
Summary
Fixes #74287 — four
hermes_state_*top-level modules split out ofhermes_state.pywere missing from[tool.setuptools] py-modulesinpyproject.toml, causing every wheel-based install (pip, uv, nix, distro packaging) to silently drop them. The SQLite session store then fails to import withModuleNotFoundError: No module named 'hermes_state_common', and Hermes runs with persistence disabled.Root cause
Commit 21c7ae8 refactored
hermes_state.pyinto four focused modules:hermes_state_common— shared constants extracted to break import cycleshermes_state_portability— SessionPortabilityMixin (WAL handling, DB lifecycle)hermes_state_schema— SessionSchemaMixin (DDL, migrations, FTS5 setup)hermes_state_search— SessionSearchMixin (FTS5 queries, filters)The
pyproject.tomlpy-moduleslist was not updated to include these four new top-level modules. Git-based installs worked because the files exist in the repo tree, but wheel packaging relies exclusively on thepy-moduleslist for single-file modules at the package root.Changes
pyproject.toml— addhermes_state_common,hermes_state_portability,hermes_state_schema,hermes_state_searchto the[tool.setuptools] py-moduleslist, grouped afterhermes_state.Verification
All four modules import correctly after the fix:
from hermes_state_common import _PREVIEW_HEAD_CHARS, SCHEMA_SQL, FTS_SQLfrom hermes_state_portability import SessionPortabilityMixinfrom hermes_state_schema import SessionSchemaMixinfrom hermes_state_search import SessionSearchMixinimport hermes_state(full re-export chain)