Skip to content

feat(hermes): hand off resources-server MCP sessions - #2778

Draft
cwing-nvidia wants to merge 17 commits into
chore/hermes-upstream-release-2672from
feat/hermes-mcp-handoff-2667
Draft

cwing-nvidia wants to merge 17 commits into
chore/hermes-upstream-release-2672from
feat/hermes-mcp-handoff-2667

Conversation

@cwing-nvidia

@cwing-nvidia cwing-nvidia commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Enables Hermes to call stateful Gym resources-server tools over rollout-scoped MCP while isolating session credentials and preserving canonical MCP identity for verification.

Details

  • consume the shared RolloutMCPServer contract from /seed_session and write the seeded MCP configuration inside each rollout's temporary HERMES_HOME
  • keep concurrent rollout credentials isolated and clean up config and process state on success, failure, and cancellation
  • run Hermes MCP discovery before AIAgent snapshots its tools
  • verify that the seeded server connected and every expected tool registered, then scope the agent to that MCP toolset
  • fail closed instead of exposing unrelated local tools when discovery or registration is incomplete
  • keep Hermes's provider-safe mcp__<server>__<tool> wire-name translation local while shared infrastructure handles metadata validation, aliases, response joins, and typed provenance
  • carry response, observations, and provenance explicitly through AgentExecutionResult and AgentEpisode
  • preserve verifier-only behavior when /seed_session returns no MCP metadata and propagate the seeded resources-server cookie through verification
  • support Streamable HTTP and SSE and reject malformed metadata without exposing credentials

Closes #2667.

Testing

Automated

  • pytest responses_api_agents/hermes_agent/tests -q — 72 passed
  • shared MCP, reverification, and Hermes matrix — 271 passed
  • scoped pre-commit run --files ... — passed
  • metadata validation covers URL and header propagation, HTTP and SSE, malformed values, credential redaction, cookie propagation, and no-metadata compatibility
  • isolation coverage exercises three simultaneous token-bearing HERMES_HOME directories plus success and failure cleanup
  • readiness coverage verifies connected registration and fail-closed behavior for failed, incomplete, or missing registration
  • regression coverage prevents the runner directory from shadowing the installed MCP SDK

Real rollout evidence

A fresh Workplace analytics rollout with nvidia/nvidia/nemotron-3.5-lightning:

  • registered all 27 expected Workplace tools
  • invoked mcp__workplace_assistant__analytics_total_visits_count and mcp__workplace_assistant__analytics_create_plot
  • stored canonical provenance for both emitted call_id values
  • scored 1.0 and reverified at 1.0

A five-example follow-up covered analytics, CRM, project-management, and calendar tasks at concurrency five:

  • 5/5 emitted only Workplace MCP calls, with no local-tool fallback
  • 5/5 stored non-empty sidecars covering every emitted MCP call
  • 3/5 scored 1.0; both policy failures still retained complete MCP provenance
  • no rollout modified repository files

Stack

The implementation and rollout validation are complete. This PR remains draft while its stack dependencies are under review.

Carry adapter-observed MCP provenance separately from model-facing aliases so verification remains correct across harnesses and external servers.

Signed-off-by: Chris Wing <[email protected]>
Advertise the authoritative Gym MCP tool list so new Claude trajectories use structured provenance while historical artifacts retain the legacy fallback.

Signed-off-by: Chris Wing <[email protected]>
Keep the structured provenance PR limited to harnesses that can run Gym MCP end to end, and move OpenClaw integration behind issue #2670.

Signed-off-by: Chris Wing <[email protected]>
Document the rollout sidecar, legacy Claude fallback, and reverification behavior so the MCP tutorial matches the new verification contract.

Signed-off-by: Chris Wing <[email protected]>
Remove the post-release MCP provenance entry so the published release notes continue to describe only shipped v0.5.0 behavior.

Signed-off-by: Chris Wing <[email protected]>
Inject each seeded resources-server endpoint into the isolated Hermes runtime so stateful tools are callable without sharing credentials across rollouts.

Signed-off-by: Chris Wing <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

Keep upstream dispatcher translation out of observability while hardening rollout MCP metadata validation and failure cleanup coverage.

Signed-off-by: Chris Wing <[email protected]>
Map rollout-advertised Hermes aliases back to canonical server and tool names so verification does not depend on client-specific flattened names.

Signed-off-by: Chris Wing <[email protected]>
Assert the serialized sidecar contract so the test passes both before and after the shared provenance model lands.

Signed-off-by: Chris Wing <[email protected]>
Document why Hermes needs a pre-execution alias map and a post-execution call-id join for structured verification.

Signed-off-by: Chris Wing <[email protected]>
Derive structured provenance once from the completed response and make Hermes configuration translation explicit, avoiding callback plumbing across response helpers.

Signed-off-by: Chris Wing <[email protected]>
Centralize seed metadata validation, alias joins, and explicit execution results so agent adapters retain only their native config and event translation.

Signed-off-by: Chris Wing <[email protected]>
Keep only Hermes wire-name and config translation local while sharing metadata validation, alias joins, and explicit provenance results.

Signed-off-by: Chris Wing <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Avoid shadowing the upstream MCP package and fail closed unless every seeded tool is registered before constructing the agent.

Signed-off-by: Chris Wing <[email protected]>
@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:agent Agent harnesses and Responses API agent behavior feature New capabilities, enhancements, or enablement work labels Oct 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Agent harnesses and Responses API agent behavior feature New capabilities, enhancements, or enablement work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(hermes_agent): consume resources-server MCP metadata from seed_session

2 participants