# NousResearch/hermes-agent · AIAgent instance lifecycle cleanup and resource closing

## Open now

- Nothing open on GitHub.

The members appear to share a theme: AIAgent instances (including one-shot agents and those in the tui-gateway) may not be consistently closed or shut down, with related fix PRs and an issue describing missing cleanup such as shutdown_memory_provider and close. Two titles are identical, and no outcome is stated here.

## 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 #122925. Verify it addresses your case.
- **Recommended:** read PR #122925 (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-122925`. 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

- #50197: Multiple AIAgent instances lack lifecycle cleanup (shutdown_memory_provider + close)

## Prior & competing PRs

- **#122925: fix(agent): close one-shot AIAgents on every exit path**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `batch_runner.py`, `hermes_cli/cli_commands_mixin.py`, `plugins/platforms/feishu/feishu_comment.py`, `tests/test_agent_close_lifecycle.py`, `tui_gateway/methods_prompt.py`
- **#50383: fix(tui-gateway): close AIAgent instances to release resources (#50197)**. closed without merge
  - maintainer direction: category `uncategorized`; implication `needs_llm`
- **#50403: fix(tui-gateway): close AIAgent instances to release resources (#50197)**. closed without merge
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `2fa2f42d41`, `94f3dbec9b`, `#122925`, `#50197`

## Fix status

- Merged to main in PR #122925 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-09-25`.
- Subsystem: `agent`
