# NousResearch/hermes-agent · Fix delegate task session ID env isolation

## Open now

- 1 issue, 2 PRs open on GitHub.
- #37356: delegate_task subagent overwrites os.environ\["HERMES_SESSION_ID"\] in parent process
- PR #38983: fix(delegate): scope HERMES_SESSION_ID to subagent env instead of mutating parent (#37356)
- PR #65824: fix(delegation): preserve redacted output on timeout

These issues and fixes address the delegate/subagent task mechanism incorrectly mutating the parent process environment, specifically HERMES_SESSION_ID leaking from child sessions into the parent env, with an additional fix for preserving redacted output on timeout.

## TL;DR

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

## Open related issues

- #37356: delegate_task subagent overwrites os.environ\["HERMES_SESSION_ID"\] in parent process

## Prior & competing PRs

- **#37368: fix(delegation): keep child sessions out of parent env**. closed without merge · fix tier `suggested`
  - maintainer direction: category `uncategorized`; implication `needs_llm`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._
- **#38983: fix(delegate): scope HERMES_SESSION_ID to subagent env instead of mutating parent (#37356)**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`
  - files: `agent/agent_init.py`, `agent/conversation_compression.py`, `gateway/session_context.py`, `tests/cli/test_cli_init.py`, `tests/tools/test_delegate.py`, `tests/tools/test_delegate_subagent_timeout_diagnostic.py`, `tools/delegate_tool.py`
- **#65824: fix(delegation): preserve redacted output on timeout**. open
  - maintainer direction: category `partial_fix`; implication `needs_llm`
  - files: `tests/tools/test_async_delegation.py`, `tests/tools/test_delegate.py`, `tests/tools/test_delegate_subagent_timeout_diagnostic.py`, `tools/async_delegation.py`, `tools/delegate_tool.py`, `tools/process_registry.py`

## Fix status

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