fix(packaging): add missing hermes_state_* mixins + mini_swe_runner to py-modules (#74653) - #74682
Conversation
…o py-modules (NousResearch#74653) Commit 21c7ae8 split SessionDB into Search/Schema/Portability mixins, adding four new top-level modules (hermes_state_common, hermes_state_portability, hermes_state_schema, hermes_state_search) that are imported by hermes_state.py but never registered in [tool.setuptools] py-modules. mini_swe_runner.py also exists at repo root and is imported by tests but was not listed. This causes fresh wheel/sdist installs (pip, uv, nix) to fail with ModuleNotFoundError for these modules, breaking TUI, gateway, and SQLite session store. Git installs are unaffected since they run from the repo tree. Supersedes NousResearch#74492 (which added the four hermes_state_* modules but omitted mini_swe_runner).
|
🔍 Quality Review: This PR needs regression tests to meet our quality standards. Please add focused tests covering the bug fix before merging. |
Duplicate of #74393 for the four missing |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for identifying the additional root module. The current-main premise is valid: hermes_state.py:45-72 imports the four split modules, hermes_state.py:1720 composes their mixins, and pyproject.toml:349 omits all four plus mini_swe_runner from py-modules.
Problems
- This PR adds metadata only.
tests/test_packaging_build_guard.py:64-72verifies that an allowed Nix build creates an artifact, but does not verify its module contents or manifest completeness. As noted in the discussion, #74393 is the canonical four-module patch; its proposed guard currently exemptsmini_swe_runner, so carrying this addition there without changing the guard leaves the new declaration unprotected.
Suggested changes
- Add focused package-artifact coverage here, or carry this change into #74393 and remove
mini_swe_runnerfrom that PR's unpackaged-module exemption while verifying declared modules are present in the Nix-built wheel.
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", "mini_swe_runner"] |
There was a problem hiding this comment.
Please add focused packaging regression coverage for these declarations. Current tests/test_packaging_build_guard.py:64-72 only proves an allowed build produces an artifact; it does not verify that this manifest includes every required root module or that the wheel contains them. If this is carried into canonical #74393, also remove mini_swe_runner from that PR's proposed unpackaged-module exemption.
|
Closing as already fixed on main: commit 36e41c0 ("fix(nix): include new flat modules at the root", #74362) added the four The remaining Thanks for the report and the quick patch. |
fix(packaging): add missing hermes_state_* mixins + mini_swe_runner to py-modules
Root Cause
Commit
21c7ae856("refactor: split SessionDB into Search/Schema/Portability mixins") added four new top-level modules (hermes_state_common,hermes_state_portability,hermes_state_schema,hermes_state_search) that are imported byhermes_state.pybut never registered in[tool.setuptools] py-modules. Additionally,mini_swe_runner.pyexists at repo root and is imported by tests but was not listed.Impact
ModuleNotFoundErrorfor these moduleshermes --tui→No module named 'hermes_state_common'No module named 'hermes_state_portability'Fix
Add all five missing modules to the
py-moduleslist inpyproject.toml.Supersedes
#74492 (which added the four
hermes_state_*modules but omittedmini_swe_runner)Changes
pyproject.toml: Addedhermes_state_common,hermes_state_portability,hermes_state_schema,hermes_state_search,mini_swe_runnertopy-modules