Skip to content

AgentStateSnapshot

junjo.agent.state.AgentStateSnapshot

Kind: Class

SDK version: 0.64.0

Documentation channel: Next source preview

AgentStateSnapshot(*, input: object, history: Sequence[object], transcript: Sequence[object], model_iteration: int, model_request_count: int, tool_call_requested_count: int, tool_call_admitted_count: int, tool_call_started_count: int, tool_call_completed_count: int, usage: AgentUsage, admitted_tool_call_ids: Sequence[str], pending_tool_call_ids: Sequence[str], completed_tool_call_ids: Sequence[str], final_output_available: bool, final_output: object, terminal_reason: str | None)

View source

Detached state evidence exposed by admitted failures and cancellation.

Snapshots contain only portable immutable JSON, immutable usage facts, and validated counters. They never expose the private mutable AgentStore state object used by the execution kernel.

Create detached immutable evidence for one admitted execution.

Every JSON value is copied and frozen. Counters, usage, final-output availability, and admitted/pending/completed Tool identities are validated as one coherent snapshot.

input: FrozenJsonValue

View source

Public attribute.

history: tuple[FrozenJsonValue, ...]

View source

Public attribute.

transcript: tuple[FrozenJsonValue, ...]

View source

Public attribute.

model_iteration: int

View source

Public attribute.

model_request_count: int

View source

Public attribute.

tool_call_requested_count: int

View source

Public attribute.

tool_call_admitted_count: int

View source

Public attribute.

tool_call_started_count: int

View source

Public attribute.

tool_call_completed_count: int

View source

Public attribute.

usage: AgentUsage

View source

Public attribute.

admitted_tool_call_ids: tuple[str, ...]

View source

Public attribute.

pending_tool_call_ids: tuple[str, ...]

View source

Public attribute.

completed_tool_call_ids: tuple[str, ...]

View source

Public attribute.

final_output_available: bool

View source

Public attribute.

final_output: FrozenJsonValue

View source

Public attribute.

terminal_reason: str | None

View source

Public attribute.

to_json() -> dict[str, JsonValue]

View source

Return a detached contract projection suitable for telemetry/evals.