What is a Session?
A Session is a live, stateful instance of an Agent Profile. When you submit a run, Orca creates (or reuses) a session on a runner that supports the profile’s runtime. Sessions are:- Stateful — owned by a specific runner
- Profile-scoped — inherit tool access from their profile at creation time
- MCP-enabled — each session gets its own MCP HTTP endpoint
- Persistent across runs — a session can process multiple tasks sequentially
Session Lifecycle
Session ID Format
Session IDs encode which runner owns them: Example:sess-a1b2c3d4-e5f6g7h8
Any conductor can extract a1b2c3d4, look up the runner in remote.Pool, and route to it — without a shared registry.
Session State
Session-Scoped MCP Endpoint
Every active session exposes a Model Context Protocol streamable HTTP endpoint:- Platform tools allowed by the session’s profile (toolkit registry, scoped at creation time)
- Session context injected into tool calls (
sessionId,profileName,runId, delegation depth)
sessionMcpUrl in the run envelope to the sidecar. The sidecar connects its MCP client to this URL to discover and invoke platform tools. External MCP servers from the profile are opened by the sidecar alongside the runner MCP client.
The MCP endpoint is only available while the session is
idle or running. It is torn down on shutdown.Managing Sessions
List Sessions
Get a Specific Session
Session Health (Runner-Direct)
Terminate a Session
Session Reuse
Orca reuses a session when a new run explicitly suppliessessionId and:
- The session was created with the same profile
- The session is not already running
- The runner that owns the session is healthy
sessionId is omitted, POST /api/runs creates a fresh session for that run. You can see session placement and counts with the topology endpoint whenever the conductor has a runner pool, including a single-runner deployment:
Session Persistence
When Postgres is configured, the conductor persists tenant-scoped session rows. Thestatus lives in a flat column; flexible session metadata is stored in metadata JSONB:
For resumable runtimes, the conductor can export the sidecar’s opaque state bundle and later hydrate a runner session with the same Orca session id, runtime-native session id, and bundle content. Hydration is best-effort: if no bundle exists or a sidecar cannot restore it, the runner still recreates the session record so the next run can proceed.
In production, callers should still be prepared for state recovery to degrade. The default behavior is:
- Conductor creates a new session automatically when a run is submitted without
sessionId - Runs should contain enough context in their task prompt to tolerate a missing or stale runtime-local state bundle
Toolkit Scoping
When a session is created, the runner takes a snapshot of the profile’stools list and intersects it with the runner’s registry. This view is immutable for the session’s lifetime:
HTTP 403.
Multi-Session Topology
The Runtime page in the dashboard (andGET /api/topology) shows:
- Which runner each session is assigned to
- Current session status across all runners
- Runner capabilities, health, and membership state (
live,draining, orunreachable) - Runner process footprint and session counts by runtime
- Sidecar slot state and the worker instances observed behind each slot
cold sidecar as configured-but-quiet rather than unhealthy.
This is useful for load-balancing debugging and capacity planning.
Public Chat Sessions
When a profile is published through the Chat Gateway, public callers never see a session id. Eachconv_... row in conversations pins one stable conversation_id to a runtime session_id, so threading conversation_id across requests reuses the same backing session. See Publishing for the conversation-to-session mapping.