Ask the planning model for the DAG as JSON.
(goal: string, signal?: AbortSignal)
| 128 | |
| 129 | /** Ask the planning model for the DAG as JSON. */ |
| 130 | private async planViaModel(goal: string, signal?: AbortSignal): Promise<RawPlan> { |
| 131 | const runner = getSubAgentRunner(); |
| 132 | if (!runner) throw new Error('No sub-agent runner registered; orchestration requires the agent runtime.'); |
| 133 | |
| 134 | const prompt = `${PLANNER_SYSTEM}\n\n# Goal\n${goal}\n\nReturn the JSON plan now.`; |
| 135 | const res = await runner(prompt, { |
| 136 | maxIterations: 1, |
| 137 | signal, |
| 138 | sessionId: `orchestrator-plan-${Date.now()}`, |
| 139 | role: this.opts.plannerRole ?? 'planning', |
| 140 | }); |
| 141 | if (!res.ok) throw new Error(`Planner failed: ${res.error ?? 'unknown'}`); |
| 142 | return parsePlanJson(res.finalText); |
| 143 | } |
| 144 | |
| 145 | /** EXECUTE: run the DAG to completion. */ |
| 146 | async execute(graph: TaskGraph, signal?: AbortSignal): Promise<ExecutionReport> { |
no test coverage detected