Normandy.Agents.Turn.State (normandy v2.2.0)

View Source

Serializable data for one in-flight turn (the design's %TurnState{}). tokens_compacted is the estimated tokens of this turn's messages removed by in-turn compaction (feeds the task budget's remaining). trace_carrier is the W3C text-map carrier of the OpenTelemetry context the turn was started under ([] without OTel); the core never reads it, the durable shell persists it so a resumed turn keeps its trace.

Summary

Types

status()

@type status() ::
  :provisioning
  | :assistant_streaming
  | :tool_dispatch
  | :finalizing
  | :awaiting_approval
  | :steering
  | :stopped
  | :failed

t()

@type t() :: %Normandy.Agents.Turn.State{
  awaiting_final: boolean(),
  error: term() | nil,
  final_pauses: non_neg_integer(),
  final_response: term() | nil,
  held_results: [term()],
  iterations_left: non_neg_integer(),
  last_response: term() | nil,
  max_iterations: pos_integer(),
  output_schema: term(),
  parked_calls: [term()],
  pending_calls: [term()],
  response_model: term(),
  status: status(),
  stop_reason: :completed | :max_iterations | nil,
  tokens_compacted: non_neg_integer(),
  trace_carrier: [{String.t(), String.t()}]
}