Skip to content

Forward-merge release/0.3 into main#185

Merged
GPUtester merged 1 commit into
mainfrom
release/0.3
May 29, 2026
Merged

Forward-merge release/0.3 into main#185
GPUtester merged 1 commit into
mainfrom
release/0.3

Conversation

@rapids-bot

@rapids-bot rapids-bot Bot commented May 29, 2026

Copy link
Copy Markdown

Forward-merge triggered by push to release/0.3 that creates a PR to keep main up-to-date. If this PR is unable to be immediately merged due to conflicts, it will remain open for the team to manually merge. See forward-merger docs for more info.

#### Overview

Fixes a Hermes CLI hook-forward issue where sparse `pre_tool_call` payloads could create a separate task-id session and export a one-step ATIF trajectory containing only `gateway_shutdown`.

- [x] I confirm this contribution is my own work, or I have the right to submit it under this project's license.
- [x] I searched existing issues and open pull requests, and this does not duplicate existing work.

#### Details

Public Hermes releases can emit `pre_tool_call` hooks with a task id but without enough stable session/tool-call identity to pair the hook with the eventual `post_tool_call`. NeMo Relay previously treated the task id as a session id, opened a synthetic Hermes session, and later closed it during gateway shutdown.

This PR drops uncorrelatable Hermes `pre_tool_call` hooks unless they include both a real session identifier and a stable tool-call id. The `post_tool_call` hook still records the tool result and attaches it to the main trajectory.

Added regression coverage for the sparse `pre_tool_call` case and updated adapter coverage for correlatable Hermes tool payloads.

#### Where should the reviewer start?

Start with `crates/cli/src/adapters/hermes.rs`, especially the `pretoolcall` guard and `hermes_pre_tool_call_is_correlatable` helper. The key regression test is `hermes_uncorrelatable_pre_tool_call_does_not_create_shutdown_trajectory` in `crates/cli/tests/coverage/session_tests.rs`.

#### Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

- Relates to #176




## Summary by CodeRabbit

* **Improvements**
  * Hermes adapter now filters pre-tool-call events that lack valid session and tool call identifiers, reducing noise in the event stream.

* **Tests**
  * Added test coverage validating proper filtering of uncorrelatable Hermes payloads and session trajectory behavior.



[![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/NVIDIA/NeMo-Relay/pull/182?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

Authors:
  - Bryan Bednarski (https://github.com/bbednarski9)

Approvers:
  - Will Killian (https://github.com/willkill07)

URL: #182
@rapids-bot rapids-bot Bot requested a review from a team as a code owner May 29, 2026 19:15
@GPUtester GPUtester merged commit 2557dd2 into main May 29, 2026
@rapids-bot

rapids-bot Bot commented May 29, 2026

Copy link
Copy Markdown
Author

SUCCESS - forward-merge complete.

@github-actions github-actions Bot added size:M PR is medium lang:rust PR changes/introduces Rust code labels May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang:rust PR changes/introduces Rust code size:M PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants