AionRuntimeContext surface used by Aion
LangGraph executions. It is the context schema passed to LangGraph and is
populated by Aion Server for each invocation.
AionRuntimeContext is the lower-level request context. Thread and Message
are authoring helpers derived from that context and are injected automatically by
create_event_router when a handler declares them.
Overview
RegisterAionRuntimeContext as the graph context schema:
Runtime[AionRuntimeContext]:
Properties
| Property | Purpose |
|---|---|
inbox | Raw A2AInbox snapshot for hybrid authoring and low-level debugging. |
event | Typed inbound Aion event, or None for direct A2A requests without an Aion event envelope. |
distribution_extension_payload | Parsed Distribution extension payload when the request includes one. |
graph_kwargs | Extra framework-specific values passed through from the graph runtime. |
Distribution Accessors
Use these methods when a request includes a Distribution extension payload:| Method | Returns |
|---|---|
get_distribution() | Distribution model for the current invocation, or None. |
get_behavior() | Behavior model for the invoked agent implementation, or None. |
get_environment() | Environment model for the runtime configuration, or None. |
get_principal_identity() | Principal identity associated with the distribution, or None. |
get_service_identity() | Service identity associated with the distribution, or None. |
get_principal_identity() and get_service_identity() are intentionally
separate helpers. The principal identity is the Aion principal that owns the
distribution when one exists. The service identity represents an external
network identity associated with the distribution when one exists.
Event Handlers
When usingcreate_event_router, handlers may declare higher-level injected
parameters instead of reaching through runtime.context manually:
AionRuntimeContext. They are not stored as top-level fields on the runtime
context model.
Why This Lives in Runtime Context
LangGraph gives us a clean separation between:- graph state, which is ideal for LLM-facing data such as
state.messages - invocation-scoped runtime context, which is ideal for immutable request data and dependency injection
- the inbound messaging target is part of the current request, not long-term graph memory
- history lookups and outbound side effects should not require custom state reducers
- protocol payloads can remain available without leaking into model-facing graph state
LangGraph thread_id vs Aion Thread IDs
LangGraph already uses config["configurable"]["thread_id"] for checkpointing
and persistence. That should remain LangGraph’s own persistence identifier.
Aion messaging thread or context identifiers are derived from the inbound event
payload and exposed through the Thread helper. Those IDs can be related to
LangGraph checkpoint IDs, but they should not be conflated.