Repository navigation
feat: standardize NeMo Fabric IDs on adapter Relay root scopes - #381
Open
mnajafian-nv wants to merge 5 commits into
Open
mnajafian-nv wants to merge 5 commits into
mnajafian-nv wants to merge 5 commits into
Conversation
In-process adapters attach NeMo Fabric IDs to their Relay root scope so telemetry consumers can join Relay events back to a Fabric runtime, invocation, and request. Each adapter currently spells the metadata keys inline, and the set of keys differs between adapters. Define the three reserved key names once in the common adapter package and add relay_correlation_metadata(), which builds the mapping from the invocation's RuntimeContext. relay_request_context() now uses the same request key constant; its behavior is unchanged. Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
The OO Agents adapter already tags its per-invocation Relay Agent scope with the NeMo Fabric runtime, invocation, and request IDs, but the Deep Agents and mini-SWE-agent adapters omit the runtime ID. Without it, a telemetry consumer cannot group invocations that ran on the same retained runtime, and the reserved keys differ by adapter. Build the root scope metadata with the shared relay_correlation_metadata() helper so both adapters emit all three keys. relay_request_context() still owns the UUID propagation root. The Deep Agents telemetry path now receives the RuntimeContext instead of separate ID arguments. Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
The NOOA adapter spelled the three reserved NeMo Fabric correlation keys inline. Use relay_correlation_metadata() so every in-process adapter emits the keys from one definition and cannot drift. The emitted keys and values are unchanged, and the adapter still does not seed a Relay propagation root from the request ID. Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
Adapter authors had no single description of which Relay metadata keys carry NeMo Fabric IDs, and consumers could not tell which adapters emit them or how to export them to OpenTelemetry. Describe the three reserved keys and the helper pattern in the common adapter README, state that the CLI gateway adapters and the Hermes Agent plugin path do not attach them yet, and show the promote_metadata_prefixes endpoint setting that exports them as span attributes. Keep the adapter-building skill in parity with the new helper. Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
The LangGraph custom-agent example, which the adapter-building skill points authors to, still spelled nemo_fabric_runtime_id and nemo_fabric_invocation_id by hand. Merge relay_correlation_metadata() into the relay_request_context() metadata instead, so the example and the first-party adapters build the reserved keys from one definition. The emitted keys and values are unchanged. Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
|
Fern docs preview: https://nvidia-preview-pull-request-381.docs.buildwithfern.com/nemo/fabric |
Contributor
Author
|
/nvskills-ci |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Standardize Relay root-scope correlation metadata for the first-party in-process SDK adapters. Deep Agents, mini-SWE-agent, and NOOA now use one helper for
nemo_fabric_request_id,nemo_fabric_invocation_id, andnemo_fabric_runtime_id.Deep Agents and mini-SWE-agent gain the runtime ID; existing keys and values remain unchanged. This uses existing Relay scope metadata and does not change a Relay API, public schema, or dependency. Gateway-based adapters and Hermes Agent are outside this change.
Details
relay_correlation_metadata(context)and shared constants for the three reserved metadata keys.relay_request_context()so the session-root metadata added by fix: group conversation turns under one Relay session #358 is preserved.Validation
92975244.git diff --checkpassed.Where should the reviewer start?
Start with
relay_correlation_metadata()inadapters/python/common/src/nemo_fabric_adapters/common/utils.py, then the Deep Agents and mini-SWE-agent call sites. The key invariant is merging withrelay_request_context()metadata sonemo_fabric_session_rootremains present.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Relates to fix: group conversation turns under one Relay session #358, which adds
nemo_fabric_session_rootto the metadata preserved by this change.I confirm this contribution is my own work, or I have the right to submit it under this project's license.
I searched existing issues and open pull requests, and this does not duplicate existing work.