> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/relay/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/relay/_mcp/server.

# Function nemo_relay_scope_stack_set_thread

> Bind an isolated scope stack to the current OS thread.

Generated from `cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker`.

<pre />

Bind an isolated scope stack to the current OS thread.

After this call, all NeMo Relay scope operations on the current thread (e.g. `nemo_relay_push_scope`, `nemo_relay_get_handle`) will use the given scope stack. This is typically used from Go goroutines that have called `runtime.LockOSThread()`.

The `FfiScopeStack` is **not** consumed - the caller retains ownership and must still free it when done.

## Parameters

* `stack`: Scope stack to bind to the current OS thread.

## Returns

* Returns [`NemoRelayStatus::Ok`](/reference/api/rust-library-reference/nemo-relay-ffi/error/enum-nemorelaystatus) when the thread-local scope stack was updated successfully.
* Returns [`NemoRelayStatus::NullPointer`](/reference/api/rust-library-reference/nemo-relay-ffi/error/enum-nemorelaystatus) when `stack` is null.

## Safety

`stack` must be a valid, non-null `FfiScopeStack` pointer.