# NousResearch/hermes-agent · TOCTOU race conditions in lazy-init globals

## Open now

- 2 issues, 1 PR open on GitHub.
- #24623: \[Bug\]: _global_allow_private_urls() sets _allow_private_resolved=True before computing the cache value — concurrent callers see stale False
- #24673: concurrency: _load_google_modules() TOCTOU — _google_modules_loaded set before imports complete
- PR #24636: fix(url_safety): close TOCTOU race in _global_allow_private_urls (#24623)

Multiple issues and fixes targeting time-of-check-to-time-of-use race conditions in lazy initialization routines, particularly around \`_global_allow_private_urls\` and \`_load_google_modules()\`. The concern is that flags are set before their associated values or imports are fully ready, exposing concurrent callers to stale state.

## TL;DR

- 8 member(s): 2 open issue(s), 0 closed issue(s), 1 open PR(s), 0 merged PR(s), 5 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_PARTIAL`): some members are connected by structural evidence (shared changed files, or a closing/superseded reference); the rest are joined by an automated relevance judgement over their text.
- Members outside that structural core may belong to a different underlying problem.
- Pairwise link density `0.23`: 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

- #24623: \[Bug\]: _global_allow_private_urls() sets _allow_private_resolved=True before computing the cache value — concurrent callers see stale False
- #24673: concurrency: _load_google_modules() TOCTOU — _google_modules_loaded set before imports complete

## Prior & competing PRs

- **#24645: fix(url_safety): eliminate TOCTOU race in _global_allow_private_urls**. closed without merge · fix tier `suggested`
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `#24641`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._
- **#24772: fix(core): close TOCTOU race windows in lazy module resolvers**. closed without merge · fix tier `suggested`
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `#24671`, `#24669`, `#24692`, `#24687`, `#24694`, `#24679`, `#24673`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._
- **#24636: fix(url_safety): close TOCTOU race in _global_allow_private_urls (#24623)**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `f85d58da4a2e`
  - files: `tests/tools/test_url_safety.py`, `tools/url_safety.py`
- **#24641: fix(url_safety): fix TOCTOU race in _global_allow_private_urls lazy-init**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#24636`, `#24623`
- **#24679: fix(google_chat): double-checked locking for _load_google_modules() TOCTOU**. closed without merge
  - maintainer direction: category `silent_close`; implication `active`
- **#128340: fix(google-chat): serialize lazy dependency initialization**. closed without merge
  - maintainer direction: category `uncategorized`; implication `needs_llm`

## Fix status

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