Commit Graph

2 Commits

Author SHA1 Message Date
freemo dfa05a6909 fix(cli): wire real LLM actors into plan executor for production execution
The `plan execute` CLI command only performed phase transitions
(Strategize → Execute) without ever invoking the `PlanExecutor` to
drive the strategize or execute actors.  `PlanExecutor.__init__`
unconditionally created `StrategizeStubActor()` and
`ExecuteStubActor()` which parse text locally and return empty
changesets — no real LLM call was made.

Added `_get_plan_executor()` helper that resolves `ProviderRegistry`
from the DI container and constructs `LLMStrategizeActor` /
`LLMExecuteActor` for real LLM invocations via LangChain.  Updated
`execute_plan` CLI command to detect plan phase/state and
automatically run the appropriate actor:

- Strategize/queued  → run strategize actor → transition to Execute
- Strategize/complete → phase transition only (backward compat)
- Execute/queued     → run execute actor → mark complete

New `llm_actors.py` module provides `LLMStrategizeActor` (task
decomposition into numbered steps) and `LLMExecuteActor` (code
generation with FILE: blocks).  Both resolve `provider/model` actor
names (e.g. `openai/gpt-4`) to live LangChain LLM instances.

`PlanExecutor.__init__` now accepts optional `strategize_actor` and
`execute_actor` parameters, falling back to stubs when None.
Existing mock-based BDD tests remain backward-compatible via duck-
typing fallback (MagicMock.phase is not a PlanPhase, so the legacy
`service.execute_plan()` path is taken).

Includes Behave BDD scenarios testing custom actor injection into
PlanExecutor.

ISSUES CLOSED: #960
2026-03-15 19:59:38 -04:00
freemo 7aa36759c6 feat(plan): execute strategize and execute via actors 2026-02-21 10:18:26 -05:00