Skip to main content

AgentEvent

Type Alias AgentEvent 

Source
pub type AgentEvent = WorldEvent;
Expand description

The name issue-facing docs use for the world’s event enum; the same type as WorldEvent.

Aliased Type§

pub enum AgentEvent {
    Spawned {
        run_id: String,
        agent_id: String,
        blueprint: String,
    },
    Status {
        run_id: String,
        agent_id: String,
        status: String,
        stage: String,
        iteration: usize,
        tool_calls: usize,
        accepts_messages: bool,
    },
    Tokens {
        run_id: String,
        agent_id: String,
        prompt_tokens: usize,
        completion_tokens: usize,
        cached_tokens: usize,
        cache_write_tokens: usize,
    },
    Context {
        run_id: String,
        agent_id: String,
        total_tokens: usize,
        max_tokens: usize,
    },
    Interaction {
        run_id: String,
        agent_id: String,
        request: InteractionRequest,
    },
    Completed {
        run_id: String,
        agent_id: String,
        status: String,
    },
    StageTransition {
        run_id: String,
        agent_id: String,
        from: String,
        to: String,
        iteration: usize,
    },
    ToolCallStarted {
        run_id: String,
        agent_id: String,
        call_id: String,
        tool: String,
    },
    ToolCallFinished {
        run_id: String,
        agent_id: String,
        call_id: String,
        tool: String,
        ok: bool,
        summary: String,
    },
    Log {
        run_id: String,
        agent_id: String,
        line: String,
    },
}

Variants§

§

Spawned

A run first appeared in the world.

Fields

§run_id: String

The run id.

§agent_id: String

The agent id.

§blueprint: String

The blueprint / agent name.

§

Status

A run’s status, stage, iteration, or tool-call count changed.

Fields

§run_id: String

The run id.

§agent_id: String

The agent id.

§status: String

Short status label (active, waiting, complete, …).

§stage: String

The current stage name.

§iteration: usize

The current iteration.

§tool_calls: usize

Cumulative tool calls.

§accepts_messages: bool

Whether the current stage accepts messages.

§

Tokens

A run’s token totals changed.

Fields

§run_id: String

The run id.

§agent_id: String

The agent id.

§prompt_tokens: usize

Cumulative prompt tokens.

§completion_tokens: usize

Cumulative completion tokens.

§cached_tokens: usize

Cumulative cached tokens.

§cache_write_tokens: usize

Cumulative cache-write tokens.

§

Context

A run’s context-window token usage changed.

Fields

§run_id: String

The run id.

§agent_id: String

The agent id.

§total_tokens: usize

Current context tokens.

§max_tokens: usize

Max context tokens.

§

Interaction

A run raised a new interaction awaiting an answer.

Fields

§run_id: String

The run id.

§agent_id: String

The agent id.

§request: InteractionRequest

The interaction request.

§

Completed

A run reached a terminal status.

Fields

§run_id: String

The run id.

§agent_id: String

The agent id.

§status: String

The terminal status label.

§

StageTransition

A run moved from one stage to another. Emitted by the transition systems at the moment the new stage is entered (the initial stage at spawn is covered by WorldEvent::Spawned, not by this).

Fields

§run_id: String

The run id.

§agent_id: String

The agent id.

§from: String

The stage being left.

§to: String

The stage being entered.

§iteration: usize

How many times the destination stage has been entered, this entry included.

§

ToolCallStarted

A tool call was handed to the async tool lane for execution. Inline calls (context tools, refusals, gate blocks) resolve without touching the lane and don’t produce this event.

Fields

§run_id: String

The run id.

§agent_id: String

The agent id.

§call_id: String

The provider-assigned tool call id.

§tool: String

The tool name.

§

ToolCallFinished

A lane-executed tool call returned. Paired with WorldEvent::ToolCallStarted by call_id.

Fields

§run_id: String

The run id.

§agent_id: String

The agent id.

§call_id: String

The provider-assigned tool call id.

§tool: String

The tool name.

§ok: bool

Whether the call took effect (false for [error]/[blocked]/ [unavailable] results).

§summary: String

The result, flattened to one line and truncated.

§

Log

A run produced a per-agent log/output line (readable assistant output or an operational [Tokens: …] / [tool] … / [error] … line).

Fields

§run_id: String

The run id.

§agent_id: String

The agent id.

§line: String

The log line text.