Skip to main content

Module session

Module session 

Source
Expand description

The agent loop.

One AgentSession holds a conversation with one agent. Each run is a task: the model is called, its tool calls are checked against the shared Policy, asked of the Approver when needed, charged to the task Budget, executed with a timeout and the task’s CancelToken, and recorded in the Trace. Tool results go back to the model wrapped as untrusted data, with the trace step ids it may cite. Events stream to the UI as they happen.

Structs§

AgentConfig
Static settings for a session.
AgentSession
A conversation with one agent.
Outcome
The result of one task.
PagesPrompt
The task’s page budget ran out: may it read extension more pages (the “+5 pages” card)?

Enums§

AgentEvent
Streamed to the UI while a task runs.
ApprovalAnswer
The user’s answer to an approval card.
StopReason
Why a task ended.

Traits§

Approver
Shows approval cards and waits for the user. The session races it against cancellation.