InvocationContext Class

Definition

Per-request context for an invocation, carrying platform-resolved identifiers, forwarded client headers, and query parameters.

public sealed class InvocationContext
type InvocationContext = class
Public NotInheritable Class InvocationContext
Inheritance
InvocationContext

Constructors

Name Description
InvocationContext(String, String, IReadOnlyDictionary<String,String>, IReadOnlyDictionary<String,StringValues>, IsolationContext)

Initializes a new instance of InvocationContext.

Properties

Name Description
ClientHeaders

Read-only dictionary of x-client-* headers forwarded from the request. Keys include the full header name (e.g., x-client-foo).

InvocationId

The invocation ID. Sourced from the x-agent-invocation-id request header if present, otherwise a generated UUID.

Isolation

Gets the platform-injected isolation keys for this request. Handlers use these opaque partition keys to scope user-private and conversation-shared state. Returns Empty when the platform headers are absent (e.g., local development).

QueryParameters

Read-only dictionary of all query parameters forwarded from the caller's request. Per the invocation protocol spec, all query parameters are forwarded unchanged — containers may define additional custom parameters as part of their own contract.

SessionId

The session ID. Resolved from agent_session_id query parameter, FOUNDRY_AGENT_SESSION_ID env var, or a generated UUID (in that order).

Applies to