# NousResearch/hermes-agent · Gateway active_agents persistence in gateway_state.json

## Open now

- 1 issue, 3 PRs open on GitHub.
- #122813: gateway_state.json active_agents is not persisted when a cron job or API-server run starts or ends
- PR #103187: fix(gateway): persist active_agents across all work sources and reconcile on heartbeat
- PR #123064: fix(gateway): persist active_agents when cron jobs and API-server runs start and end
- PR #149877: fix(gateway): re-publish live active_agents from the runtime heartbeat

These members concern the gateway's active_agents value in gateway_state.json, including it not being persisted when cron jobs or API-server runs start and end. Two are fixes titled around persisting or re-publishing that value, one from run start/end events and one from the runtime heartbeat.

## TL;DR

- 4 member(s): 1 open issue(s), 0 closed issue(s), 3 open PR(s), 0 merged PR(s), 0 PR(s) closed without merging.
- No fix has been merged to main; one or more PRs were attempted (see below).
- **Recommended:** review the prior/competing PR(s) below. A fix was attempted but not merged; your case may extend or revive that work.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `unresolved`. 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.

## Open related issues

- #122813: gateway_state.json active_agents is not persisted when a cron job or API-server run starts or ends

## Prior & competing PRs

- **#103187: fix(gateway): persist active_agents across all work sources and reconcile on heartbeat**. open
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `c37a22f8b121e48f3463ed62753aca7ef400cc95`, `5f28a0e273`, `#123064`, `#122813`
  - files: `agent/subagents/background.py`, `agent/work_notifier.py`, `cron/scheduler.py`, `gateway/active_work_sync.py`, `gateway/platforms/api_server.py`, `gateway/platforms/api_server_runs.py`, `gateway/run.py`, `gateway/run_bootstrap.py`, `gateway/run_shutdown.py`, `gateway/status.py`, `tests/gateway/test_active_work_sync.py`
- **#123064: fix(gateway): persist active_agents when cron jobs and API-server runs start and end**. open
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `bac34e9e9946c9c6a9ce7ce64efadd47f8fa375b`, `5f28a0e27390c08aef2a1a3261489854979216c8`, `#103187`, `#103906`, `#123064`, `#126599`
  - files: `cron/scheduler.py`, `gateway/platforms/api_server.py`, `gateway/platforms/api_server_runs.py`, `gateway/run.py`, `tests/cron/test_job_lifecycle_persist_callback.py`, `tests/cron/test_lifecycle_notify_all_count_changes.py`, `tests/gateway/test_api_server_active_work_persist.py`, `tests/gateway/test_api_server_active_work_persist_paths.py`, `tests/gateway/test_persist_active_agents_cron.py`
- **#149877: fix(gateway): re-publish live active_agents from the runtime heartbeat**. open
  - maintainer direction: category `silent_close`; implication `active`
  - files: `gateway/run.py`, `gateway/run_housekeeping_heartbeat.py`, `tests/gateway/test_runtime_heartbeat_active_agents.py`

## Fix status

- No merged fix on record.
- Subsystem: `gateway`
- Kind: `bug` (from the open issues' GitHub type labels).
