# NousResearch/hermes-agent · Fix non-atomic OpenRouter prewarm concurrency guard

## Open now

- 1 issue, 1 PR open on GitHub.
- #24651: concurrency: _openrouter_prewarm_done.is_set()+.set() non-atomic — can spawn duplicate prewarm threads
- PR #109924: fix(agent): make the OpenRouter prewarm claim atomic so concurrent inits spawn one thread

These items identify and address a race condition where the non-atomic check-then-set on a prewarm Event flag could allow duplicate prewarm threads to spawn. The fix replaces the Event with a Lock to make the guard atomic.

## TL;DR

- 5 member(s): 1 open issue(s), 0 closed issue(s), 1 open PR(s), 0 merged PR(s), 3 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.40`: 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

- #24651: concurrency: _openrouter_prewarm_done.is_set()+.set() non-atomic — can spawn duplicate prewarm threads

## Prior & competing PRs

- **#24668: fix(run_agent): replace non-atomic Event prewarm guard with Lock gate**. closed without merge · fix tier `suggested`
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `#24666`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._
- **#24666: fix(agent): make OpenRouter prewarm guard atomic (#24651)**. closed without merge
  - maintainer direction: category `silent_close`; implication `active`
- **#61189: Serialize OpenRouter metadata prewarm claim**. closed without merge
  - maintainer direction: category `uncategorized`; implication `needs_llm`
- **#109924: fix(agent): make the OpenRouter prewarm claim atomic so concurrent inits spawn one thread**. open
  - maintainer direction: category `silent_close`; implication `active`
  - files: `agent/agent_init.py`, `tests/run_agent/test_openrouter_prewarm_claim.py`

## Fix status

- No merged fix on record.
- Subsystem: `agent`
