Skip to content

API Reference parrot.tools.execution_plan.toolkit

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.tools.execution_plan.toolkit

View source

ExecutionPlanToolkit — lets a plain BasicAgent trigger a deterministic tool-call DAG (ExecutionPlan) through a bounded tool call, with zero LLM tokens spent while it executes.

This module implements the toolkit's core (spec §3 Module 2): constructor wiring, the bounded run registry, and the soft-timeout execution path over AgentsFlow. The plan-acquisition front (plan_execute/plan_validate) is added by TASK-2184; the plan file store, planner client and allowlist/catalog layering are added by TASK-2181/2182/2183 respectively.

Alias AbstractToolkit

Re-exported from parrot.tools.toolkit.AbstractToolkit.

Alias AgentRegistry

Re-exported from parrot.registry.registry.AgentRegistry.

Alias ArtifactRef

Re-exported from parrot.bots.flows.plan.ArtifactRef.

Alias CheckpointPersistenceError

Re-exported from parrot.bots.flows.core.checkpoint.CheckpointPersistenceError.

Alias CheckpointStore

Re-exported from parrot.bots.flows.core.checkpoint.CheckpointStore.

Alias ExecutionPlan

Re-exported from parrot.bots.flows.plan.ExecutionPlan.

Class ExecutionPlanToolkit

Runs a validated :class:ExecutionPlan on AgentsFlow with no LLM tokens in the loop and returns a bounded manifest to the agent.

One instance is initialized with live dependencies (the FEAT-207 shared-state toolkit pattern) and shared across every tool call: the run registry, plan store and tool catalog all live on self.

Parameter Type Default Description
tool_manager Any Shared ToolManager — every plan node dispatches through it (never tool.execute() directly).
working_memory 'WorkingMemoryToolkit' The SAME WorkingMemoryToolkit instance the analyst agent uses; plan payloads land here.
planner_llm Union[str, dict, Any, None] None Enables objective mode when set. Same accepted formats as bots' llm/secondary_llm. Consumed by TASK-2183.
plans_dir Union[str, Path, None] None Enables plan_name mode when set. Consumed by TASK-2181.
allowed_tools Optional[Sequence[str]] None Explicit tool allowlist. None means every tool registered on tool_manager is allowed. Consumed by TASK-2182.
soft_timeout float 60.0 Seconds to await a run before returning a RunningSummary. Never cancels the run.
permission_context Optional['PermissionContext'] None Optional default forwarded to ToolManager.execute_tool for every plan node.
on_node_event Optional[Callable[..., Any]] None Optional flow-lifecycle listener, forwarded to every run's AgentsFlow in addition to this toolkit's own progress-tracking listener.
max_completed_runs int 50 Bound on completed/failed run-registry entries.
plan_step_mapping Optional[Mapping[str, str]] None Explicit {plan_node_id: domain_step_id} mapping (FEAT-538). None — the default — leaves every plan call task-level with plan provenance, which is the honest answer when nobody has said which step a node is.
recovery Optional[PlanRecoveryConfig] None
checkpoint_store Union['CheckpointStore', str, None] None
durable_store Union['CheckpointStore', str, None] None
task_memory_runtime Optional['TaskMemoryRuntime'] None
delegates Optional[Sequence[Any]] None Ordered ToolCallDelegate chain; [0] is primary. Owned and closed by :meth:cleanup.
delegate_trace_sink Optional[Any] None Opt-in DelegateTraceSink never persisted in checkpoints.
allow_delegate_side_effects bool False Host policy; plan text alone can never grant delegate side effects.
scope Optional[TaskScope] None
**kwargs Any {} Forwarded to :class:AbstractToolkit.

Attributes:

Attribute Type Description
name str
description str
planner_llm Raw planner_llm constructor value, consumed by TASK-2183's PlanPlanner.
plans_dir Optional[Path] Resolved Path for plan_name mode, consumed by TASK-2181's PlanFileStore.
allowed_tools Optional[list] Explicit allowlist, or None for "all manager tools" — consumed by TASK-2182's catalog/allowlist layering.
soft_timeout Seconds plan_execute waits before returning a :class:RunningSummary instead of the full manifest.
permission_context Optional constructor-level default forwarded to every plan node's ToolManager.execute_tool call.
max_completed_runs Bound on completed/failed run-registry entries; oldest evicted first. In-flight runs are never evicted.
plan_step_mapping Dict[str, str] Explicit {plan_node_id: domain_step_id} mapping forwarded to every plan node (FEAT-538). Supplying an entry is the ONLY way a plan call is attributed to a task step: a plan node id is not a step id, and a plan run never creates a task or a step by itself.
recovery PlanRecoveryConfig

Method ExecutionPlanToolkit.cleanup

Close owned plan-memory resources without closing borrowed stores.

cleanup() -> None

Method ExecutionPlanToolkit.plan_status

Return progress while a plan run executes, or its final manifest.

plan_status(run_id: str) -> ToolResult

Parameter Type Default Description
run_id str

Returns: ToolResult

Method ExecutionPlanToolkit.plan_artifacts

Return the ArtifactRef list a run has produced so far.

plan_artifacts(run_id: str) -> ToolResult

Parameter Type Default Description
run_id str

Returns: ToolResult

Method ExecutionPlanToolkit.plan_resume

Resume an interrupted checkpointed run without replaying completions.

plan_resume(run_id: str) -> ToolResult

Parameter Type Default Description
run_id str

Returns: ToolResult

Method ExecutionPlanToolkit.plan_repair

Spend one permitted repair attempt on a failed/partial run's error ids.

Computes the eligible (error/undispatched) node ids under the root lease, refuses (consuming nothing) when the run is not repairable, has nothing eligible, has exhausted max_repair_rounds, or no planner_llm is configured. Otherwise persists the incremented attempt count and the freshly allocated child id BEFORE making any planner call — an authoring failure, a lost lease, or a crash from that point on still leaves the attempt spent. Makes one replan call plus at most one repair_delta correction, merges and validates the result, seeds a child flow with every protected (ok/skipped/partial) node already marked completed, persists the accepted child as the run's new active continuation, and runs it. Never restarts the whole run and never makes an autonomous planner call on top of an interrupted repair child (spec §2 Module 6).

plan_repair(run_id: str) -> ToolResult

Parameter Type Default Description
run_id str

Returns: ToolResult

Method ExecutionPlanToolkit.plan_execute

Acquire, validate and run an ExecutionPlan.

Provide exactly one of objective (planner-authored) or plan_name (versioned file). Returns the full manifest, or a run_id summary if still running after soft_timeout.

plan_execute(objective: Optional[str] = None, plan_name: Optional[str] = None, params: Optional[Dict[str, Any]] = None) -> ToolResult

Parameter Type Default Description
objective Optional[str] None
plan_name Optional[str] None
params Optional[Dict[str, Any]] None

Returns: ToolResult

Method ExecutionPlanToolkit.plan_validate

Dry-run: acquire and validate an ExecutionPlan without running it.

Returns the acquired plan JSON verbatim plus the full validation report (ok + per-issue node_id/code/message/severity). Never calls a tool.

plan_validate(objective: Optional[str] = None, plan_name: Optional[str] = None, params: Optional[Dict[str, Any]] = None) -> ToolResult

Parameter Type Default Description
objective Optional[str] None
plan_name Optional[str] None
params Optional[Dict[str, Any]] None

Returns: ToolResult

Alias FlowCheckpointer

Re-exported from parrot.bots.flows.core.checkpoint.FlowCheckpointer.

Alias FlowContext

Re-exported from parrot.bots.flows.core.context.FlowContext.

Alias FlowDefinition

Re-exported from parrot.bots.flows.flow.definition.FlowDefinition.

Alias FlowLockedError

Re-exported from parrot.bots.flows.core.checkpoint.FlowLockedError.

Alias FlowStateSerializer

Re-exported from parrot.bots.flows.core.checkpoint.FlowStateSerializer.

Alias PLAN_RUN_SHARED_KEY

Re-exported from parrot.tools.execution_plan.models.PLAN_RUN_SHARED_KEY.

Alias PermissionContext

Re-exported from parrot.auth.permission.PermissionContext.

Alias PlanArtifactsArgs

Re-exported from parrot.tools.execution_plan.models.PlanArtifactsArgs.

Alias PlanAuthoringError

Re-exported from parrot.tools.execution_plan.planner.PlanAuthoringError.

Alias PlanContinuation

Re-exported from parrot.tools.execution_plan.checkpoint.PlanContinuation.

Alias PlanDelta

Re-exported from parrot.tools.execution_plan.models.PlanDelta.

Alias PlanExecuteArgs

Re-exported from parrot.tools.execution_plan.models.PlanExecuteArgs.

Alias PlanFileStore

Re-exported from parrot.tools.execution_plan.store.PlanFileStore.

Alias PlanFlow

Re-exported from parrot.tools.execution_plan.checkpoint.PlanFlow.

Alias PlanLoadError

Re-exported from parrot.tools.execution_plan.store.PlanLoadError.

Alias PlanMemoryBinding

Re-exported from parrot.tools.execution_plan.memory.PlanMemoryBinding.

Alias PlanPlanner

Re-exported from parrot.tools.execution_plan.planner.PlanPlanner.

Alias PlanRecoveryConfig

Re-exported from parrot.tools.execution_plan.models.PlanRecoveryConfig.

Alias PlanRecoveryEnvelope

Re-exported from parrot.tools.execution_plan.models.PlanRecoveryEnvelope.

Alias PlanRepairArgs

Re-exported from parrot.tools.execution_plan.models.PlanRepairArgs.

Alias PlanResumeArgs

Re-exported from parrot.tools.execution_plan.models.PlanResumeArgs.

Alias PlanRun

Re-exported from parrot.tools.execution_plan.models.PlanRun.

Alias PlanRunError

Re-exported from parrot.tools.execution_plan.models.PlanRunError.

Alias PlanRunManifest

Re-exported from parrot.tools.execution_plan.models.PlanRunManifest.

Alias PlanRunMetadata

Re-exported from parrot.tools.execution_plan.models.PlanRunMetadata.

Alias PlanRunResolver

Re-exported from parrot.tools.execution_plan.runs.PlanRunResolver.

Alias PlanRunSummary

Re-exported from parrot.tools.execution_plan.models.PlanRunSummary.

Alias PlanStatusArgs

Re-exported from parrot.tools.execution_plan.models.PlanStatusArgs.

Alias PlanValidateArgs

Re-exported from parrot.tools.execution_plan.models.PlanValidateArgs.

Alias RestoreError

Re-exported from parrot.tools.execution_plan.memory.RestoreError.

Alias RunRecord

Re-exported from parrot.tools.execution_plan.models.RunRecord.

Alias TaskMemoryRuntime

Re-exported from parrot.tools.working_memory.task_memory.config.TaskMemoryRuntime.

Alias TaskScope

Re-exported from parrot.tools.working_memory.task_memory.models.TaskScope.

Alias ToolResult

Re-exported from parrot.tools.abstract.ToolResult.

Alias ValidationReport

Re-exported from parrot.bots.flows.plan.validator.ValidationReport.

Alias WorkingMemoryToolkit

Re-exported from parrot.tools.working_memory.tool.WorkingMemoryToolkit.

Alias build_catalog

Re-exported from parrot.tools.execution_plan.catalog.build_catalog.

Alias build_manifest

Re-exported from parrot.bots.flows.plan.build_manifest.

Alias build_plan_flow

Re-exported from parrot.tools.execution_plan.checkpoint.build_plan_flow.

Alias eligible_repair_nodes

Re-exported from parrot.tools.execution_plan.repair.eligible_repair_nodes.

Alias get_checkpoint_store

Re-exported from parrot.bots.flows.core.checkpoint.get_checkpoint_store.

Alias merge_delta

Re-exported from parrot.tools.execution_plan.repair.merge_delta.

Alias plan_fingerprint

Re-exported from parrot.tools.execution_plan.runs.plan_fingerprint.

Alias plan_run_projector

Re-exported from parrot.tools.execution_plan.checkpoint.plan_run_projector.

Alias process_identity

Re-exported from parrot.tools.execution_plan.runs.process_identity.

Alias protected_node_ids

Re-exported from parrot.tools.execution_plan.repair.protected_node_ids.

Alias register_plan_checkpoint_types

Re-exported from parrot.tools.execution_plan.runs.register_plan_checkpoint_types.

Alias select_latest

Re-exported from parrot.tools.execution_plan.runs.select_latest.

Alias tool_schema

Re-exported from parrot.tools.decorators.tool_schema.

Alias validate_delta

Re-exported from parrot.tools.execution_plan.repair.validate_delta.

Alias validate_with_allowlist

Re-exported from parrot.tools.execution_plan.catalog.validate_with_allowlist.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally