Skip to content
Agent Orchestration
Skill

/nemo-relay-instrument-context-isolation

Use this skill when concurrent requests, async tasks, threads, workers, goroutines, or agents need independent NeMo Relay scope stacks and correct ancestry propagation.

From plugin
nemo-relay
25911 skills1 MCP

Claude Code

$ npx -y skills add NVIDIA/NeMo-Relay --skill nemo-relay-instrument-context-isolation --agent claude-code

SKILL.md

nemo-relay-instrument-context-isolation.SKILL.md
name: nemo-relay-instrument-context-isolation
description: Use this skill when concurrent requests, async tasks, threads, workers, goroutines, or agents need independent NeMo Relay scope stacks and correct ancestry propagation.
license: Apache-2.0
metadata:
  author: NVIDIA Corporation and Affiliates

Use Context Isolation

Use this skill when an application runs concurrent requests, worker pools, async tasks, goroutines, or multiple agents in the same process. Treat scope-stack ownership as part of the request boundary.

Core Rule

Each independent request, agent, or workflow needs its own scope stack. Do not share one mutable stack across unrelated concurrent work unless you want shared ancestry and shared scope-local middleware.

Embedded Scope Model

  • A root scope is always present, and pushed scopes form a parent-child tree

beneath it.

  • Scope hierarchy determines event parentage, lifetime boundaries, and

visibility for scope-local middleware and subscribers.

  • Standard scope types include `Agent`, `Function`, `Tool`, `Llm`,

`Retriever`, `Embedder`, `Reranker`, `Guardrail`, `Evaluator`, `Custom`, and `Unknown`.

  • Scope start and end events can carry semantic `input` and `output` payloads

when the scope represents a request, task, or meaningful result boundary.

  • Scope-local registrations disappear when the owning scope closes; use them

for behavior that should not outlive a request or agent run.

  • Mark events are useful for retries, checkpoints, interrupts, and important

state transitions that are not full spans.

Per-Language Defaults

  • **Python**: rely on task-local behavior via `get_scope_stack()` and

`contextvars`, or explicitly propagate when work leaves the current execution context

  • **Rust core**: use runtime helpers such as `create_scope_stack()`,

`current_scope_stack()`, and `set_thread_scope_stack(...)` when an integration needs explicit stack ownership

  • **Go**: use `NewScopeStack()` and `ScopeStack.Run(...)` for goroutine-safe

usage

  • **Node.js**: create and set a scope stack explicitly for the current execution

path with `createScopeStack()` and `setThreadScopeStack(...)`

Common Failures

  • Events from different requests appear under one root UUID
  • Scope-local middleware leaks across requests
  • Worker-thread work runs without the expected active scope
  • Integrations activate NeMo Relay without an explicitly initialized stack
  • Relying on a thread-local stack after crossing async tasks, goroutines, or JS

worker boundaries

Related Skills

  • `nemo-relay-instrument-calls`
  • `nemo-relay-plugin-observability`
  • `nemo-relay-debug-runtime-integration`
Read more
@nvidia
Ships withnemo-relay

NVIDIA NeMo Relay is a library that wraps your agents' model and tool calls so you can observe, control, and tune them, without rewriting the agent stack you already have. See every agent run.

25911 skills1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
259
Star history of NVIDIA/NeMo-Relay on GitHub, a chart by star-history.com

Other skills on nemo-relay.

nemo-relay-get-started

nemo-relay-get-started

Use this skill when first-time NeMo Relay users want help selecting and following an appropriate quick-start guide or verifying…

@nvidia@nvidiaInstall Skill
nemo-relay-install

nemo-relay-install

Use this skill when choosing or running NeMo Relay installation for an agent runtime, application language, framework…

@nvidia@nvidiaInstall Skill

More skills from other plugins.

1password

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

openclaw9d395k
@steipete@steipeteInstall Skill
jira-tickets

jira-tickets

Read and update Jira tickets through Orca's saved Jira connections. Use when a task comes from Jira or the user asks for Jira…

orca7d128k
@stablyai@stablyaiInstall Skill
agentmail

agentmail

Use your assigned AgentMail inbox to read email tasks, explicitly send or reply, and check delivery. Provided automatically by…

paperclip8d114k
@paperclipai@paperclipaiInstall Skill
adr-create

adr-create

Create a new Architecture Decision Record with sequential numbering and AgentDB registration

@ruvnet@ruvnetInstall Skill

Questions about nemo-relay-instrument-context-isolation.

Which coding agents can use nemo-relay-instrument-context-isolation?
nemo-relay-instrument-context-isolation installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.