> 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 full documentation content, see https://docs.nvidia.com/nemo/relay/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/relay/_mcp/server.

# Function push_scope

> Push a new scope onto the active scope stack.

Generated from `cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-ffi`.

<pre />

Push a new scope onto the active scope stack.

This creates a new [`ScopeHandle`](/reference/api/rust-library-reference/nemo-relay/api/scope/struct-scopehandle), emits a scope-start event to global and scope-local subscribers, and makes the new scope the current top of stack.

## Parameters

* `name`: Human-readable scope name recorded on emitted lifecycle events.
* `scope_type`: Semantic category for the new scope.
* `parent`: Optional explicit parent scope. When `None`, the current top of stack is used as the parent.
* `attributes`: Bitflags that modify scope behavior and observability.
* `data`: Optional application payload stored on the returned handle.
* `metadata`: Optional JSON metadata recorded on the emitted start event.
* `input`: Optional JSON payload exported as the Agent Trajectory Observability Format (ATOF) data payload.
* `timestamp`: Optional timestamp recorded as the handle start time and on the emitted start event. When `None`, the current UTC time is used.

## Returns

A [`Result`](/reference/api/rust-library-reference/nemo-relay/error/type-result) containing the newly created [`ScopeHandle`](/reference/api/rust-library-reference/nemo-relay/api/scope/struct-scopehandle).

## Errors

Returns an error when the runtime owner check fails or when internal state cannot be read safely.

## Notes

Scope-local subscribers attached to ancestor scopes observe the emitted start event before the function returns.