# NousResearch/hermes-agent · Race condition between close() and run_turn() in session

## Open now

- Nothing open on GitHub.

These issues and fixes address a concurrency race condition where calling close() while run_turn() is executing causes an AttributeError crash instead of a clean interrupt. The work focuses on preventing close() from conflicting with run_turn()'s client reads and poll loop.

## TL;DR

- 4 member(s): 0 open issue(s), 1 closed issue(s), 0 open PR(s), 1 merged PR(s), 2 PR(s) closed without merging.
- A fix was merged to main in PR #115758. Verify it addresses your case.
- **Recommended:** read PR #115758 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `resolved` · deciding PR(s): `pr-115758`. 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.

## Closed / duplicate issues

- #87422: \[BUG\]:codex_app_server_session: close() racing run_turn() raises AttributeError instead of a clean interrupt

## Prior & competing PRs

- **#115758: fix(codex-app-server): closing or losing the app-server mid-turn ends the turn cleanly instead of hanging or crashing (#87433, #87422, #83127, salvage #87434 #83129 #87424)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `agent/transports/codex_app_server.py`, `agent/transports/codex_app_server_session.py`, `tests/agent/transports/test_codex_app_server.py`, `tests/agent/transports/test_codex_app_server_runtime.py`, `tests/agent/transports/test_codex_app_server_session.py`
- **#87424: fix(codex-app-server): stop close() racing run_turn()'s poll loop**. closed without merge
  - maintainer direction: category `merged_via`; implication `superseded`; refs `1db043b3dc90`, `#115758`, `#87433`, `#87422`, `#83127`, `#87434`, `#83129`, `#87424`
- **#91769: fix: race between close() and run_turn's self._client reads crashes turns**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#87424`

## Fix status

- Merged to main in PR #115758 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-09-19`.
- Subsystem: `agent`
