Session is the primary runtime object in the current Agent layer.
If you remember only one thing, remember this:
- the agent definition is durable
- the environment is reusable
- the session is what actually runs
What a session owns
A session owns:- one
sessionId - one
agentId - one
environmentId - one append-only event stream
- one isolated runtime memory directory
- one attached resource list
- one stop reason and status
- global company truth
- shared chat truth
- other sessions for the same agent
Status model
The current status model is:idlerunningreschedulingterminated
idlerequires_actionreschedulingterminated
requires_action is how the runtime pauses for custom tool results without inventing a separate approval system in the Agent core.
Event model
Each session has an append-onlyevents.jsonl.
Current event families:
user.messageuser.tool_confirmationuser.custom_tool_resultsession.status_changedsession.status_idleagent.messageagent.tool_useagent.custom_tool_use
processedAt == null
wake(sessionId) can stay small.
Orchestration does not need to carry the whole prompt payload because the session already contains the unprocessed work.
Storage layout
Each session lives here:session.json- canonical durable state
events.jsonl- append-only event journal
runtime/- local continuity for the harness
wake-queue.jsonl- internal revisit scheduling
Session isolation
Multiple sessions can exist for the same agent. That is important because:- one agent may have many distinct threads of work
- context isolation matters
- one bad thread should not contaminate another
- learnings can be shared at the agent level without sharing runtime scratch state
- event history
- runtime memory
- pending custom-tool request
- wake queue
- workspace substrate
- agent definition
- agent-level learnings
Wake semantics
The public orchestration seam is:- load the session
- read pending events
- if nothing is pending and no revisit is due, do nothing
- otherwise run one bounded harness cycle
- provider-specific logic
- upper-layer product semantics
- exact context assembly rules
CLI
Create a session:Design rule
Any new Agent feature should answer this first: Does this belong on the session, or does it belong above the Agent layer? If it is:- transient runtime continuity
- pending execution work
- bounded tool pause/resume
- per-thread execution history
- shared company coordination
- work publication
- governance or observation across many sessions