Nemo relay instrument context isolation

From NVIDIA/skills · View interactive version

Nemo relay instrument context isolation is an AI agent skill from the GitHub repository NVIDIA/skills. Use this skill when concurrent requests, async tasks, threads, workers, goroutines, or agents need independent NeMo Relay scope stacks and correct ancestry propagation.

How to use this skill

Skill file

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

beneath it.

visibility for scope-local middleware and subscribers.

Retriever, Embedder, Reranker, Guardrail, Evaluator, Custom, and

Unknown.

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

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

state transitions that are not full spans.

Per-Language Defaults

contextvars, or explicitly propagate when work leaves the current execution

context

current_scope_stack(), and set_thread_scope_stack(...) when an integration

needs explicit stack ownership

usage

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

Common Failures

worker boundaries

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.