# NousResearch/hermes-agent · Fix truncation-warning ContextVar leaking between tests

## Open now

- Nothing open on GitHub.

Multiple issues and PRs address order-dependent test failures caused by a truncation-warning ContextVar leaking across test files, particularly between test_prompt_builder.py and test_system_prompt.py. The work involves isolating or resetting this shared state so tests pass regardless of execution order.

## TL;DR

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

- #93018: Tests: order-dependent failure — test_prompt_builder.py pollutes test_system_prompt.py truncation-warning ContextVar (reproduces on clean main)

## Prior & competing PRs

- **#93395: prompt_builder/system_prompt tests no longer fail when run together (#93018, salvage #93047)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`; implication `superseded`
  - files: `tests/agent/test_prompt_builder.py`, `tests/agent/test_system_prompt.py`
- **#93027: test(system-prompt): make build_system_prompt unit test robust to leaked truncation warnings (fixes #93018)**. closed without merge
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `04dd2bb23`, `#93018`, `#93047`, `#93047`, `#93395`, `#93047`
- **#93038: test(agent): stop truncation-warning ContextVar leaking across test files**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#93027`
- **#93047: test(agent): stop truncation-warning ContextVar leaking between test files**. closed without merge
  - maintainer direction: category `merged_via`; implication `superseded`; refs `04dd2bb23`, `#93395`
- **#93071: test(agent): isolate truncation warnings between tests**. closed without merge
  - maintainer direction: category `duplicate_of`; implication `duplicate`; refs `#93038`, `#93018`

## Fix status

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