# NousResearch/hermes-agent · Relay concurrent-turn scope-handle race and close fix

## Open now

- Nothing open on GitHub.

These items address a race condition in relay/telemetry where concurrent turns cause a 'scope handle is not at the top of the stack' error during task close, and a related issue where failing session pushes are not retried. The work involves bounding task scope drain and making concurrent turn close safer.

## TL;DR

- 3 member(s): 0 open issue(s), 1 closed issue(s), 0 open PR(s), 1 merged PR(s), 1 PR(s) closed without merging.
- A fix was merged to main in PR #116685. Verify it addresses your case.
- **Recommended:** read PR #116685 (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-116685`. 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.

## Closed / duplicate issues

- #115471: Relay scope-handle race on concurrent turns: 'scope handle is not at the top of the stack' in shared-metrics close path

## Prior & competing PRs

- **#116685: fix(relay): a failing session push is not retried and concurrent-turn task close no longer raises 'not at the top of the stack' (#115528, #115471, salvage #115531)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `agent/relay_runtime.py`, `hermes_cli/observability/relay_shared_metrics.py`, `tests/agent/test_relay_session_segments.py`, `tests/hermes_cli/test_relay_shared_metrics_runtime.py`
- **#115498: fix(telemetry): bounded task scope drain and safe concurrent turn close (#115471)**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `148d1f6da54e`, `#116685`, `#115528`, `#115471`, `#115531`

## Fix status

- Merged to main in PR #116685 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-09-20`.
