pub struct SessionOutcome {
pub task_id: String,
pub outcome: Option<TaskState>,
pub head: Option<String>,
pub note: Option<String>,
pub refusals: Option<String>,
}Expand description
One terminal fact a self-driven backend observed for itself.
A session served by an adapter reports its own ending, and the client only has to write it down. A backend that owns its agent has no reporter, so it states the fact here: which task ended, how, and what the receiving role should read as its closing line.
Fields§
§task_id: String§outcome: Option<TaskState>How the turn ended, when ending the turn is the fact the client records.
None is the ordinary ending of a session whose obligations travel as
tool calls: the agent stopped asking for work (end_turn) and this
backend has no way to know whether the model reported the task done,
because the completion arrives on the session’s own tools connection
rather than through this process’s pipe. Ending a turn without a
completion is the state the client’s turn-end rule owns
(docs/v2-CONTRACT.md §3c): it nudges once, and the second ending is
what settles the delivery. Some is a standing this backend did observe
for itself — a cancelled, refused, or dead turn — and it settles the
delivery where it lands.
head: Option<String>The agent’s closing text, already stripped of the status markers an agent stamps into its own stream. Becomes the completion head.
note: Option<String>Fault detail for the ledger on a failure. An agent process that died mid-turn names its exit status and the tail of its stderr here.
refusals: Option<String>One-line summary of the permission asks this client refused during the
turn, None when the agent asked for nothing. A refusal is recorded on
the session row as a fault and settles nothing by itself: the turn kept
running without the thing the agent wanted.