nemo-relay-instrument-context-isolation

Solid

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

AI & Automation 122 stars 57 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 86/100

Stars 20%
70
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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 `cre...

Details

Author
NVIDIA
Repository
NVIDIA/NeMo-Relay
Created
4 months ago
Last Updated
today
Language
Rust
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category