# NousResearch/hermes-agent · Plugin hook session_id propagation and tool correlation

## Open now

- 1 issue, 2 PRs open on GitHub.
- #51931: \[Bug\]: Nested tool hooks(on_pre_tool_call and on_post_tool_call) can't get session_id
- PR #52000: fix(execute_code): forward session_id to nested tool calls via RPC
- PR #82243: feat(tools): compose deferred tools in execute_code

These issues and PRs concern missing or incorrect session_id and tool_call_id fields in pre_tool_call plugin hooks across multiple call sites, including nested tool execution. Related feature work covers request-scoped hooks, tool call correlation IDs, and hook-based blocking of tool execution.

## TL;DR

- 11 member(s): 1 open issue(s), 5 closed issue(s), 2 open PR(s), 0 merged PR(s), 3 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_PARTIAL`): some members are connected by structural evidence (shared changed files, or a closing/superseded reference); the rest are joined by an automated relevance judgement over their text.
- Members outside that structural core may belong to a different underlying problem.
- Pairwise link density `0.14`: 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

- #51931: \[Bug\]: Nested tool hooks(on_pre_tool_call and on_post_tool_call) can't get session_id

## Closed / duplicate issues

- #28961: tool_executor pre_tool_call hook calls omit session_id and tool_call_id (v0.14.0)
- #34618: \`session_id\` not propagated to \`get_pre_tool_call_block_message\` from its 3 callsites — \`pre_tool_call\` plugin hooks that scope by session silently no-op
- #39728: fix: pre_tool_call hook missing session_id in three call sites
- #44582: pre_tool_call plugin hook not invoked during agent tool execution
- #48311: pre_tool_call hooks receive an empty session_id (task_id passed instead) — breaks session-scoped hook policy

## Prior & competing PRs

- **#28982: fix: pass session_id and tool_call_id in pre_tool_call hook**. closed without merge · fix tier `suggested`
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `0d9b7132ffe8c70b593a87445b181742dc878827`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._
- **#34622: fix(plugins): propagate session_id to pre_tool_call hook from all 3 callsites**. closed without merge · fix tier `suggested`
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `d682f320b`, `36308f0667`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._
- **#52000: fix(execute_code): forward session_id to nested tool calls via RPC**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `6da0ae1cf`, `58e35f829`, `#82243`, `#51931`, `#51931`
  - files: `tests/tools/test_code_execution.py`, `tests/tools/test_code_kernel.py`, `tools/code_execution_rpc.py`, `tools/code_execution_tool.py`, `tools/code_kernel.py`, `tools/code_kernel_remote.py`
- **#52001: fix(execute_code): preserve session id for nested tools**. closed without merge
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `#52000`
- **#82243: feat(tools): compose deferred tools in execute_code**. open
  - maintainer direction: category `wontfix_bydesign`; implication `wontfix`; refs `5adc1527622aec861319ba9617cde7701b06595c`, `#51931`, `#52000`
  - files: `agent/agent_runtime_helpers.py`, `agent/tool_executor.py`, `contributors/emails/[redacted:email]`, `gateway/run.py`, `model_tools.py`, `tests/gateway/test_agent_cache.py`, `tests/run_agent/test_run_agent.py`, `tests/test_model_tools.py`, `tests/tools/test_code_execution_deferred_tools.py`, `tests/tools/test_code_kernel_remote.py`, `tests/tools/test_tool_search.py`, `tools/code_execution_rpc.py`, `tools/code_execution_tool.py`, `tools/code_kernel.py`, `tools/code_kernel_remote.py`

## Fix status

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