Parent: #14182
Depends on: #14590 (PR 5)
Goal
The final move PR. Moves the agent core, extracts providers from agent/transports/ + adapter files, and relocates the 6 leaf modules that everything imports. After this PR, no Python source lives outside hermes_agent/ (except tui_gateway/, environments/, and tests/).
What moves (~59 files)
Providers (extracted from agent/)
agent/transports/*.py → hermes_agent/providers/*.py (7 files)
agent/*_adapter.py → hermes_agent/providers/*.py (6 files)
- Provider infrastructure (credentials, pricing, rate limiting, etc.) →
hermes_agent/providers/ (12 files)
Agent core
agent/*.py → hermes_agent/agent/*.py (flat files stay flat)
agent/context_engine.py → hermes_agent/agent/context/engine.py
agent/context_compressor.py → hermes_agent/agent/context/compressor.py
agent/context_references.py → hermes_agent/agent/context/references.py
agent/memory_manager.py → hermes_agent/agent/memory/manager.py
agent/memory_provider.py → hermes_agent/agent/memory/provider.py
agent/image_gen_*.py → hermes_agent/agent/image_gen/*.py
Leaf modules
run_agent.py → hermes_agent/agent/loop.py
hermes_constants.py → hermes_agent/constants.py
hermes_state.py → hermes_agent/state.py
hermes_logging.py → hermes_agent/logging.py
hermes_time.py → hermes_agent/time.py
utils.py → hermes_agent/utils.py
__init__.py re-exports (included in this PR)
Re-exports for: hermes_agent/ (top-level), agent/, agent/context/, agent/memory/, agent/image_gen/, providers/
Also UPDATES earlier empty __init__.py files from PRs 1-3: acp/, cron/, gateway/
Known gotchas
- Widest fan-out. ~265 prod refs for agent, ~330 for leaf modules — rewrites touch every previously-moved package.
- Transport discovery:
_discover_transports() must scan hermes_agent/providers/*_transport.py.
- Logger COMPONENT_PREFIXES: Update all prefixes in
hermes_agent/logging.py.
- 4 test files with dynamic plugin code: String-based old-style imports in
write_text() calls (see manifest for exact locations).
- sys.path hacks: Strip from all remaining production files (~20+) and test files (~20).
- tests/conftest.py: Replace sys.path hack with ImportError guard.
logging.py and time.py shadow stdlib names: Safe with absolute imports but worth noting.
pyproject.toml — final form
[project.scripts]
hermes = "hermes_agent.cli.main:main"
hermes-agent = "hermes_agent.agent.loop:main"
hermes-acp = "hermes_agent.acp.entry:main"
hermes-skills-sync = "hermes_agent.tools.skills.sync:main"
[tool.setuptools.packages.find]
include = ["hermes_agent", "hermes_agent.*", "tui_gateway", "tui_gateway.*"]
Delete after moves
run_agent.py, cli.py, hermes_constants.py, hermes_state.py,
hermes_logging.py, hermes_time.py, utils.py, agent/, tools/
Verification
rg "^from (agent|run_agent|hermes_constants|hermes_state|hermes_logging|hermes_time|utils)[\. ]" --type py
rg "^import (agent|run_agent|hermes_constants|hermes_state|hermes_logging|hermes_time|utils)\b" --type py
pytest
hermes --help && hermes-agent --help && hermes-acp --help
Parent: #14182
Depends on: #14590 (PR 5)
Goal
The final move PR. Moves the agent core, extracts providers from
agent/transports/+ adapter files, and relocates the 6 leaf modules that everything imports. After this PR, no Python source lives outsidehermes_agent/(excepttui_gateway/,environments/, andtests/).What moves (~59 files)
Providers (extracted from agent/)
agent/transports/*.py→hermes_agent/providers/*.py(7 files)agent/*_adapter.py→hermes_agent/providers/*.py(6 files)hermes_agent/providers/(12 files)Agent core
agent/*.py→hermes_agent/agent/*.py(flat files stay flat)agent/context_engine.py→hermes_agent/agent/context/engine.pyagent/context_compressor.py→hermes_agent/agent/context/compressor.pyagent/context_references.py→hermes_agent/agent/context/references.pyagent/memory_manager.py→hermes_agent/agent/memory/manager.pyagent/memory_provider.py→hermes_agent/agent/memory/provider.pyagent/image_gen_*.py→hermes_agent/agent/image_gen/*.pyLeaf modules
run_agent.py→hermes_agent/agent/loop.pyhermes_constants.py→hermes_agent/constants.pyhermes_state.py→hermes_agent/state.pyhermes_logging.py→hermes_agent/logging.pyhermes_time.py→hermes_agent/time.pyutils.py→hermes_agent/utils.py__init__.pyre-exports (included in this PR)Re-exports for:
hermes_agent/(top-level),agent/,agent/context/,agent/memory/,agent/image_gen/,providers/Also UPDATES earlier empty
__init__.pyfiles from PRs 1-3:acp/,cron/,gateway/Known gotchas
_discover_transports()must scanhermes_agent/providers/*_transport.py.hermes_agent/logging.py.write_text()calls (see manifest for exact locations).logging.pyandtime.pyshadow stdlib names: Safe with absolute imports but worth noting.pyproject.toml — final form
Delete after moves
Verification