-
Notifications
You must be signed in to change notification settings - Fork 0
Implement Plan-and-Execute execution loop (DESIGN_SPEC §6.5 Loop 2) #134
Copy link
Copy link
Closed
Labels
prio:mediumShould do, but not blockingShould do, but not blockingscope:medium1-3 days of work1-3 days of workspec:agent-systemDESIGN_SPEC Section 3 - Agent SystemDESIGN_SPEC Section 3 - Agent Systemspec:task-workflowDESIGN_SPEC Section 6 - Task & Workflow EngineDESIGN_SPEC Section 6 - Task & Workflow Enginespec:toolsDESIGN_SPEC Section 11 - Tool & Capability SystemDESIGN_SPEC Section 11 - Tool & Capability Systemtype:featureNew feature implementationNew feature implementationtype:testTest coverage, test infrastructureTest coverage, test infrastructure
Description
Context
The ExecutionLoop protocol (defined in M3, #124) enables pluggable loop architectures. The MVP ships with ReAct (Loop 1). This issue implements the second loop: Plan-and-Execute — a two-phase approach where the agent first creates a full plan, then executes each step sequentially.
Acceptance Criteria
Plan-and-Execute Loop Implementation
- Implements the
ExecutionLoopprotocol - Phase 1 (Plan): agent creates a structured plan with numbered steps
- Phase 2 (Execute): agent executes each step sequentially, checking results against expectations
- Re-planning: if a step fails or produces unexpected results, agent can revise remaining steps
-
max_replansconfigurable (default: 3) to prevent infinite revision loops - Plan visible in agent output for observability
Auto-Selection by Complexity (Future)
- Complexity scoring function (input length, tool count, estimated turns)
- Automatic loop selection: simple tasks → ReAct, complex tasks → Plan-and-Execute
- Override via agent config or per-task setting
Testing
- Unit tests with scripted FakeProvider (deterministic plan + execution)
- Integration test: complex multi-step task completed via plan-and-execute
- Comparison test: same task via ReAct vs Plan-and-Execute (verify both complete)
Dependencies
- Define ExecutionLoop protocol and implement ReAct loop (DESIGN_SPEC §6.5) #124 — ExecutionLoop protocol + ReAct (must exist first)
- Implement agent engine core with ExecutionLoop protocol integration (DESIGN_SPEC §3.1, §6.1, §6.5) #11 — Agent engine core
Design Spec Reference
- §6.5 — Agent Execution Loop (Loop 2: Plan-and-Execute)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
prio:mediumShould do, but not blockingShould do, but not blockingscope:medium1-3 days of work1-3 days of workspec:agent-systemDESIGN_SPEC Section 3 - Agent SystemDESIGN_SPEC Section 3 - Agent Systemspec:task-workflowDESIGN_SPEC Section 6 - Task & Workflow EngineDESIGN_SPEC Section 6 - Task & Workflow Enginespec:toolsDESIGN_SPEC Section 11 - Tool & Capability SystemDESIGN_SPEC Section 11 - Tool & Capability Systemtype:featureNew feature implementationNew feature implementationtype:testTest coverage, test infrastructureTest coverage, test infrastructure