# NousResearch/hermes-agent · Fix duplicated Discord mock splitting module identity

## Open now

- 1 issue, 1 PR open on GitHub.
- #117996: \[Bug\]: duplicated _ensure_discord_mock() installs a fresh MagicMock per call, splitting \`discord\` module identity across test modules
- PR #124305: test(discord): preserve shared mock identity

A bug where calling \`_ensure_discord_mock()\` multiple times installs a fresh MagicMock each time, causing the \`discord\` module identity to differ across test modules. The members address preserving a shared mock identity in tests to prevent this split.

## TL;DR

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

- #117996: \[Bug\]: duplicated _ensure_discord_mock() installs a fresh MagicMock per call, splitting \`discord\` module identity across test modules

## Prior & competing PRs

- **#118201: fix(tests): preserve Discord mock identity**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `#124305`, `#117996`
- **#124305: test(discord): preserve shared mock identity**. open
  - maintainer direction: category `silent_close`; implication `active`
  - files: `tests/discord_mock.py`, `tests/e2e/conftest.py`, `tests/gateway/conftest.py`, `tests/gateway/test_discord_allowed_mentions.py`, `tests/gateway/test_discord_attachment_download.py`, `tests/gateway/test_discord_channel_controls.py`, `tests/gateway/test_discord_channel_prompts.py`, `tests/gateway/test_discord_connect.py`, `tests/gateway/test_discord_document_handling.py`, `tests/gateway/test_discord_edit_message_overflow.py`, `tests/gateway/test_discord_event_silence.py`, `tests/gateway/test_discord_free_response.py`, `tests/gateway/test_discord_liveness.py`, `tests/gateway/test_discord_missed_message_backfill.py`, `tests/gateway/test_discord_mock.py`, `tests/gateway/test_discord_pending_text_batch_shutdown.py`, `tests/gateway/test_discord_platform_events.py`, `tests/gateway/test_discord_prompt_timeout_config.py`, `tests/gateway/test_discord_reactions.py`, `tests/gateway/test_discord_reply_mode.py` (+8 more)

## Fix status

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