Skip to content

fix(curator): seed defaults on update, create logs/curator dir, defer fire import#17927

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-6146c0bd
Apr 30, 2026
Merged

fix(curator): seed defaults on update, create logs/curator dir, defer fire import#17927
teknium1 merged 1 commit into
mainfrom
hermes/hermes-6146c0bd

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

Summary

Makes the curator work correctly on existing installs and on broken/partial installs by (a) seeding curator + auxiliary.curator defaults into config.yaml on hermes update, (b) pre-creating ~/.hermes/logs/curator/ on every CLI launch, and (c) moving import fire into run_agent.py's __main__ block so importing AIAgent from a daemon thread never hits ModuleNotFoundError: fire.

User reports hitting "No module named 'fire'" when the curator spawned its forked review agent from a daemon thread. fire is only used by fire.Fire(main) in the __main__ block — it was never needed for library use. Existing configs from before PR #16049 / the April 2026 auxiliary.curator unification also have neither section on disk, so users can't see or edit curator settings in their config.yaml.

Changes

  • run_agent.py: import fire deferred into if __name__ == "__main__":
  • hermes_cli/config.py:
    • ensure_hermes_home() now creates logs/curator/ alongside cron/sessions/logs/memories; managed-mode variant mkdir's it defensively after the activation-script checks.
    • Bumped _config_version 22 → 23 with a migration that writes curator + auxiliary.curator defaults to config.yaml (only keys the user hasn't already overridden).
  • agent/curator.py: _reports_root() mkdir's the dir at call time as belt-and-suspenders for odd entry paths (gateway-only, library use).

Validation

E2E tested in isolated HERMES_HOME with yaml fixtures:

Scenario Before After
Fresh install, no curator keys in config.yaml Both sections absent on disk Both seeded with full defaults
Partial override (enabled: false, custom interval_hours) n/a User overrides preserved, missing keys filled
logs/curator/ directory Created lazily on first curator run Created on every CLI launch
import run_agent with fire unavailable ModuleNotFoundError: fire Imports cleanly
python run_agent.py --help Works via fire.Fire(main) Still works — fire loaded inside __main__
Re-run migration after version bump n/a No-op, idempotent

Targeted tests pass. 3 pre-existing xdist cross-pollution failures (test_api_key_providers, test_setup_openclaw_migration) also fail on clean origin/main — unrelated to this PR.

… fire import

Three fixes bundled for curator reliability on existing installs and
broken/partial installs:

1. run_agent.py: defer `import fire` into the __main__ block. `fire` is
   only used by `fire.Fire(main)` when running run_agent.py directly as
   a CLI — it is NOT needed for library usage. Importing it at module
   top made `from run_agent import AIAgent` from a daemon thread (e.g.
   the curator's forked review agent) crash with ModuleNotFoundError
   on broken/partial installs where `fire` isn't present.

2. hermes_cli/config.py: add version 22 → 23 migration that writes the
   `curator` + `auxiliary.curator` sections to config.yaml with their
   defaults, only filling keys the user hasn't overridden. Existing
   configs from before PR #16049 / the April 2026 `auxiliary.curator`
   unification had neither section on disk, so users couldn't see or
   edit the settings in their config.yaml (runtime deep-merge papered
   over it at read time, but the file never reflected reality).

3. hermes_cli/config.py: `ensure_hermes_home()` now pre-creates
   `~/.hermes/logs/curator/` alongside cron/sessions/logs/memories on
   every CLI launch. Managed-mode (NixOS) variant mkdir's it
   defensively after the activation-script existence checks, since the
   activation script may not know about this subpath.

4. agent/curator.py: `_reports_root()` mkdir's the dir at call time as
   belt-and-suspenders for entry paths that bypass both
   ensure_hermes_home() and the v23 migration (gateway-only installs,
   bare library use).

E2E validated in isolated HERMES_HOME: fresh install gets full defaults
seeded; partial-override config keeps user's `enabled: false` and
custom `interval_hours` while filling the missing keys; re-running the
migration is a no-op.
@teknium1 teknium1 merged commit e8e5985 into main Apr 30, 2026
12 checks passed
@teknium1 teknium1 deleted the hermes/hermes-6146c0bd branch April 30, 2026 11:52
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent loop, run_agent.py, prompt builder comp/cli CLI entry point, hermes_cli/, setup wizard area/config Config system, migrations, profiles labels Apr 30, 2026
donald131 pushed a commit to donald131/hermes-agent that referenced this pull request May 2, 2026
… fire import (NousResearch#17927)

Three fixes bundled for curator reliability on existing installs and
broken/partial installs:

1. run_agent.py: defer `import fire` into the __main__ block. `fire` is
   only used by `fire.Fire(main)` when running run_agent.py directly as
   a CLI — it is NOT needed for library usage. Importing it at module
   top made `from run_agent import AIAgent` from a daemon thread (e.g.
   the curator's forked review agent) crash with ModuleNotFoundError
   on broken/partial installs where `fire` isn't present.

2. hermes_cli/config.py: add version 22 → 23 migration that writes the
   `curator` + `auxiliary.curator` sections to config.yaml with their
   defaults, only filling keys the user hasn't overridden. Existing
   configs from before PR NousResearch#16049 / the April 2026 `auxiliary.curator`
   unification had neither section on disk, so users couldn't see or
   edit the settings in their config.yaml (runtime deep-merge papered
   over it at read time, but the file never reflected reality).

3. hermes_cli/config.py: `ensure_hermes_home()` now pre-creates
   `~/.hermes/logs/curator/` alongside cron/sessions/logs/memories on
   every CLI launch. Managed-mode (NixOS) variant mkdir's it
   defensively after the activation-script existence checks, since the
   activation script may not know about this subpath.

4. agent/curator.py: `_reports_root()` mkdir's the dir at call time as
   belt-and-suspenders for entry paths that bypass both
   ensure_hermes_home() and the v23 migration (gateway-only installs,
   bare library use).

E2E validated in isolated HERMES_HOME: fresh install gets full defaults
seeded; partial-override config keeps user's `enabled: false` and
custom `interval_hours` while filling the missing keys; re-running the
migration is a no-op.
nickdlkk pushed a commit to nickdlkk/hermes-agent that referenced this pull request May 11, 2026
… fire import (NousResearch#17927)

Three fixes bundled for curator reliability on existing installs and
broken/partial installs:

1. run_agent.py: defer `import fire` into the __main__ block. `fire` is
   only used by `fire.Fire(main)` when running run_agent.py directly as
   a CLI — it is NOT needed for library usage. Importing it at module
   top made `from run_agent import AIAgent` from a daemon thread (e.g.
   the curator's forked review agent) crash with ModuleNotFoundError
   on broken/partial installs where `fire` isn't present.

2. hermes_cli/config.py: add version 22 → 23 migration that writes the
   `curator` + `auxiliary.curator` sections to config.yaml with their
   defaults, only filling keys the user hasn't overridden. Existing
   configs from before PR NousResearch#16049 / the April 2026 `auxiliary.curator`
   unification had neither section on disk, so users couldn't see or
   edit the settings in their config.yaml (runtime deep-merge papered
   over it at read time, but the file never reflected reality).

3. hermes_cli/config.py: `ensure_hermes_home()` now pre-creates
   `~/.hermes/logs/curator/` alongside cron/sessions/logs/memories on
   every CLI launch. Managed-mode (NixOS) variant mkdir's it
   defensively after the activation-script existence checks, since the
   activation script may not know about this subpath.

4. agent/curator.py: `_reports_root()` mkdir's the dir at call time as
   belt-and-suspenders for entry paths that bypass both
   ensure_hermes_home() and the v23 migration (gateway-only installs,
   bare library use).

E2E validated in isolated HERMES_HOME: fresh install gets full defaults
seeded; partial-override config keeps user's `enabled: false` and
custom `interval_hours` while filling the missing keys; re-running the
migration is a no-op.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/agent Core agent loop, run_agent.py, prompt builder comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants