PlanState#

Module: agent_framework.planning.plan_state

class agent_framework.planning.plan_state.PlanState(plan=(), step_results=<factory>, completed_steps=<factory>, plan_revision=0, total_steps_executed=0, pending_callback_step_id=None, awaiting_caller_callback=False)[source]#

Bases: object

Mutable per-run state for a planning invocation.

Created lazily by PlanningTurnDriver on its first run_turn call. In-memory only in v1; persistence is a future feature.

Fields:
plan: Current plan — a tuple of PlanStep objects. Replaced (not

mutated) each time the model emits submit_plan or amend_plan.

step_results: Map of step_id result payload for all completed

steps. Used by the {{ref}} resolver.

completed_steps: Ordered log of all CompletedStep records. plan_revision: Number of times submit_plan or amend_plan has

been emitted in this run. Incremented by the driver before executing each new plan.

total_steps_executed: Cumulative count of step executions. Checked

against PlanningConfig.max_steps.

pending_callback_step_id: When a step emits a model-bound callback,

this is set to that step’s ID so the reflect phase can route the resolution back.

awaiting_caller_callback: Set to True when the plan is paused

waiting for a user-bound callback response from the caller.

Parameters:
  • plan (tuple[PlanStep, ...])

  • step_results (dict[str, Any])

  • completed_steps (list[CompletedStep])

  • plan_revision (int)

  • total_steps_executed (int)

  • pending_callback_step_id (str | None)

  • awaiting_caller_callback (bool)

plan: tuple[PlanStep, ...]#
step_results: dict[str, Any]#
completed_steps: list[CompletedStep]#
plan_revision: int#
total_steps_executed: int#
pending_callback_step_id: str | None#
awaiting_caller_callback: bool#