AgentStateSnapshot
junjo.agent.state.AgentStateSnapshot
Kind: Class
SDK version: 0.64.0
Documentation channel: Next source preview
Signature
Section titled “Signature”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)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.
Constructor
Section titled “Constructor”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.
Members
Section titled “Members”input: FrozenJsonValuePublic attribute.
history
Section titled “history”history: tuple[FrozenJsonValue, ...]Public attribute.
transcript
Section titled “transcript”transcript: tuple[FrozenJsonValue, ...]Public attribute.
model_iteration
Section titled “model_iteration”model_iteration: intPublic attribute.
model_request_count
Section titled “model_request_count”model_request_count: intPublic attribute.
tool_call_requested_count
Section titled “tool_call_requested_count”tool_call_requested_count: intPublic attribute.
tool_call_admitted_count
Section titled “tool_call_admitted_count”tool_call_admitted_count: intPublic attribute.
tool_call_started_count
Section titled “tool_call_started_count”tool_call_started_count: intPublic attribute.
tool_call_completed_count
Section titled “tool_call_completed_count”tool_call_completed_count: intPublic attribute.
usage: AgentUsagePublic attribute.
admitted_tool_call_ids
Section titled “admitted_tool_call_ids”admitted_tool_call_ids: tuple[str, ...]Public attribute.
pending_tool_call_ids
Section titled “pending_tool_call_ids”pending_tool_call_ids: tuple[str, ...]Public attribute.
completed_tool_call_ids
Section titled “completed_tool_call_ids”completed_tool_call_ids: tuple[str, ...]Public attribute.
final_output_available
Section titled “final_output_available”final_output_available: boolPublic attribute.
final_output
Section titled “final_output”final_output: FrozenJsonValuePublic attribute.
terminal_reason
Section titled “terminal_reason”terminal_reason: str | NonePublic attribute.
to_json
Section titled “to_json”to_json() -> dict[str, JsonValue]Return a detached contract projection suitable for telemetry/evals.