# NousResearch/hermes-agent · Telegram polling TCP connection reuse and port exhaustion

## Open now

- 1 issue, 2 PRs open on GitHub.
- #107880: \[Bug\]: Telegram polling can exhaust macOS ephemeral ports with TIME_WAIT after ~2 days
- PR #107892: fix(telegram): reuse getUpdates keepalive on Darwin to avoid TIME_WAIT exhaustion
- PR #107897: fix(telegram): reuse a small getUpdates keepalive pool off Windows (#107880)

These members address a bug where Telegram's getUpdates polling creates excessive TCP connections, exhausting ephemeral ports via TIME_WAIT accumulation on macOS and potentially other platforms. Fixes involve reusing keepalive connection pools to mitigate the issue.

## TL;DR

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

- #107880: \[Bug\]: Telegram polling can exhaust macOS ephemeral ports with TIME_WAIT after ~2 days

## Prior & competing PRs

- **#107892: fix(telegram): reuse getUpdates keepalive on Darwin to avoid TIME_WAIT exhaustion**. open
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `46e7cfc9759929e6909f247570738624ec54ef9f`
  - files: `plugins/platforms/telegram/adapter.py`, `plugins/platforms/telegram/telegram_network.py`, `tests/gateway/test_telegram_closewait_limits.py`, `tests/gateway/test_telegram_macos_ephemeral_ports_107880.py`
- **#107897: fix(telegram): reuse a small getUpdates keepalive pool off Windows (#107880)**. open
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#107892`, `#107880`, `#107892`, `#84495`
  - files: `plugins/platforms/telegram/adapter.py`, `plugins/platforms/telegram/telegram_network.py`, `tests/gateway/test_telegram_closewait_limits.py`, `tests/gateway/test_telegram_connect_error_classification.py`

## Fix status

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