Skip to content

feat(orchestration): Phase 4 — CLI commands + agent loop integration #1239

@bug-ops

Description

@bug-ops

Parent: #1235
Blocked by: #1237, #1238

Summary

Wire orchestration into the agent loop with CLI commands and metrics.

Branch: feat/m33/orchestration-cli

Deliverables

New files

  • crates/zeph-core/src/orchestration/command.rsPlanCommand enum + parse()

Modified files

  • crates/zeph-core/src/agent/mod.rs — handle /plan commands in command dispatch
  • crates/zeph-core/src/metrics.rsOrchestrationMetrics in MetricsSnapshot

CLI commands

Command Description
/plan <goal> Decompose goal → confirm → execute → aggregate
/plan status Show current DAG progress (task table)
/plan list List recent graphs from persistence
/plan cancel Cancel running graph

Integration flow

  1. User enters /plan <goal>
  2. Agent calls LlmPlanner::plan() to decompose
  3. If confirm_before_execute, show task count + agent assignments, wait for confirmation
  4. Start DagScheduler tick loop
  5. On completion, call Aggregator::aggregate() (Phase 5 placeholder — concatenate for now)
  6. Display final result

Metrics

  • plans_total, plans_completed, plans_failed
  • tasks_total, tasks_completed, tasks_failed, tasks_skipped

Tests (~15)

  • Command parsing: /plan <goal>, /plan status, /plan list, /plan cancel
  • Unknown subcommand error
  • Empty goal handling
  • Integration: /plan dispatches to planner → scheduler → completion (mock provider)
  • Cancellation during execution
  • Confirmation prompt shown when confirm_before_execute = true
  • Metrics update correctly on plan completion/failure

Dependencies

Blocked by: Phase 2 (#1237), Phase 3 (#1238)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestorchestrationTask orchestration / DAG scheduling

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions