-
Notifications
You must be signed in to change notification settings - Fork 2
feat(orchestration): Phase 2 — LLM Planner (goal decomposition) #1237
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or requestorchestrationTask orchestration / DAG schedulingTask orchestration / DAG scheduling
Description
Parent: #1235
Blocked by: #1236
Summary
Implement LLM-based task decomposition — converts a user goal into a validated TaskGraph.
Branch: feat/m33/orchestration-planner
Deliverables
New files
crates/zeph-core/src/orchestration/planner.rs—Plannertrait +LlmPlannerimpl
Details
- Prompt template with JSON schema and agent catalog injection
- String-based
task_idin LLM output, parsed to internalTaskId(u32)indices - JSON response parsing with retry-on-malformed (single retry)
- Validation of planner output via
dag::validate max_tasksenforcement (reject if LLM exceeds limit)planner_modelconfig: use configured model or fall back to agent's primary modelplanner_max_tokensconfig for response budget
Planner prompt design
Structured prompt includes:
- Available agent catalog (name + description + tools)
- JSON schema for output format
- Instructions: prefer fewer/larger tasks, use string task_ids, declare dependencies
Tests (~15)
- Parse valid JSON with string task_ids into TaskGraph
- Reject JSON with cycles
- Reject JSON with invalid agent hints (warn but proceed with None)
- Reject JSON exceeding max_tasks
- Handle malformed JSON (non-JSON LLM response)
- Handle integer-based IDs (detect and reject with clear error)
- Empty goal handling
- Agent catalog formatting (correct prompt injection)
- Single-task goal produces single-node graph
Dependencies
Blocked by: Phase 1 (#1236)
Can run in parallel with: Phase 3 (#1238)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestorchestrationTask orchestration / DAG schedulingTask orchestration / DAG scheduling