# NousResearch/hermes-agent · Plugin loader: fix failing sibling module sys.modules leaks

## Open now

- Nothing open on GitHub.

These issues and PRs address a bug where a \`failed\` sibling module execution leaves a half-initialized entry in \`sys.modules\`, causing subsequent imports to raise \`ImportError\` instead of \`ModuleNotFoundError\`. Related work also covers broader plugin loader hardening such as version gating, isolation, and directory validation.

## TL;DR

- 4 member(s): 0 open issue(s), 1 closed issue(s), 0 open PR(s), 1 merged PR(s), 2 PR(s) closed without merging.
- A fix was merged to main in PR #118841. Verify it addresses your case.
- **Recommended:** read PR #118841 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `resolved` · deciding PR(s): `pr-118841`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_SPANNING`): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
- Pairwise link density `0.50`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Closed / duplicate issues

- #112096: plugins/plugin_loader.py: failed sibling exec leaks a half-initialized module into sys.modules → later import raises ImportError, not ModuleNotFoundError

## Prior & competing PRs

- **#118841: Plugin loader: version gate reads running code, SystemExit isolated, uv quarantine from any cwd, impostor dirs refused, range pins (#72052 #104404 #101962 #112096 #108371 #71650 #86992 #98407)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `contributors/emails/byjaps@users.noreply.github.com`, `hermes_cli/cli_init_mixin.py`, `hermes_cli/plugins.py`, `hermes_cli/plugins_discovery.py`, `hermes_cli/plugins_loader.py`, `hermes_cli/plugins_manifest.py`, `plugins/disk-cleanup/plugin.yaml`, `plugins/google_meet/plugin.yaml`, `plugins/memory/byterover/plugin.yaml`, `plugins/memory/hindsight/plugin.yaml`, `plugins/memory/holographic/plugin.yaml`, `plugins/memory/honcho/plugin.yaml`, `plugins/memory/openviking/plugin.yaml`, `plugins/observability/langfuse/plugin.yaml`, `plugins/plugin_loader.py`, `plugins/security-guidance/plugin.yaml`, `pyproject.toml`, `tests/hermes_cli/test_cli_init.py`, `tests/hermes_cli/test_plugin_manifest_v2.py`, `tests/hermes_cli/test_plugin_scan_dunder_dirs.py` (+8 more)
- **#112097: fix(plugins): clean failed sibling modules**. closed without merge
  - maintainer direction: category `merged_via`; implication `superseded`; refs `74f726c17675642c2eff3033632e812f5f0e6614`, `#112096`
- **#112444: fix(plugins): evict failed sibling exec from sys.modules so later imports raise ModuleNotFoundError**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#112097`

## Fix status

- Merged to main in PR #118841 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-09-22`.
