Nemo relay instrument context isolation
Skill NVIDIA/skills/skills/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 its SKILL.md
npx -y skills add NVIDIA/skills --skill nemo-relay-instrument-context-isolationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
What its file declares
Copied from the file, not written here
The file declares its own license as Apache-2.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
2.6 KB, 520 tokens by cl100k_base, as published. Nobody here has run it
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, andUnknown. - Scope start and end events can carry semantic
inputandoutputpayloads 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()andcontextvars, or explicitly propagate when work leaves the current execution context - Rust core: use runtime helpers such as
create_scope_stack(),current_scope_stack(), andset_thread_scope_stack(...)when an integration needs explicit stack ownership - Go: use
NewScopeStack()andScopeStack.Run(...)for goroutine-safe usage - Node.js: create and set a scope stack explicitly for the current execution
path with
createScopeStack()andsetThreadScopeStack(...)
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-callsnemo-relay-plugin-observabilitynemo-relay-debug-runtime-integration
What ships with it: 4 files
17.2 KB alongside SKILL.md
evals/
- evals.json5.0 KB
- BENCHMARK.md3.8 KB
- skill-card.md3.9 KB
- skill.oms.sig4.5 KB