Orchestration Plan 6
Scope: Build the Project Runner and Task Runner agents — the two master agents that check project phases and dispatch SRP agents respectively (Spec §6, §7). Both use the master + clone pattern.
Spec: Orchestration Spec
Prior plan: Plan 5
Task 1 — Create Project Runner Agent
The Project Runner (Spec §6) checks active projects periodically. When one project phase is completed, it initiates the next phase or notifies the user. Uses the master + clone pattern with different models.
-
Create system prompt file:
Forge/Agents/PROJECT_RUNNER.md -
The Project Runner’s workflow (Spec §6.2):
- Call
list_projects(forge-discovery MCP) to get active projects and their phases - For each active project, read the current State file to check for phase completions
- If a phase is completed: initiate the next phase (create next plan/state documents) OR append a todo item to
Forge/Output/Erik_Todo.mdif human approval is needed - Report summary to user (Suprsend notification or todo item)
- Call
-
Configure the agent in LibreChat Agent Builder:
Field Master Clone Model OpenRouter / z-ai/glm-5.1 anthropic / claude-sonnet-4-6 Tools forge-discovery, uvilo-filesystem, forge-spawn forge-discovery, uvilo-filesystem, forge-spawn Instructions PROJECT_RUNNER.md PROJECT_RUNNER.md (same) -
The master agent is not a router — it executes the project check itself. Clones run in parallel with the same task prompt (Spec §6.1). Their outputs are available for comparison but do not feed back into the master’s execution.
-
Record agent IDs for both master and clone
Deliverable: Project Runner agent (master + clone) created and callable.
Task 2 — Create Task Runner Agent
The Task Runner (Spec §7) checks for incomplete items on the agent todo list and dispatches the correct SRP agent to execute each task. Same master + clone pattern as Project Runner.
-
Create system prompt file:
Forge/Agents/TASK_RUNNER.md -
The Task Runner’s workflow (Spec §7.1):
- Check
Forge/Output/Agent_Todo.mdfor incomplete items - For each incomplete task, determine which SRP agent handles it (based on task type or title pattern matching)
- Spawn the SRP agent via the Spawn MCP tool (disconnect mode for simple tasks, monitor mode for complex ones)
- Update todo item state to
[ ] 🟨 (convoId: "{conversationId}") Existing todo description here - On SRP agent completion (checked via status endpoint), update todo item to completed
[x] ✅or blocked[ ] 🚫and add a new item toForge/Output/Erik_Todo.md
- Check
-
Configure the agent in LibreChat Agent Builder:
Field Master Clone Model OpenRouter / z-ai/glm-5.1 anthropic / claude-sonnet-4-6 Tools forge-discovery, uvilo-filesystem, forge-spawn forge-discovery, uvilo-filesystem, forge-spawn Instructions TASK_RUNNER.md TASK_RUNNER.md (same) -
Same tool set and clone pattern as Project Runner. Different instructions focused on task dispatch (Spec §7.2).
-
Record agent IDs for both master and clone
Deliverable: Task Runner agent (master + clone) created and callable.
Task 3 — Create Agent Todo File
The Task Runner reads
Forge/Output/Agent_Todo.mdfor incomplete items (Spec §7.1). This file needs to exist with the correct format.
-
Create
Forge/Output/Agent_Todo.mdwith frontmatter and an empty task list: -
Ensure
Forge/Output/Erik_Todo.mdexists for human-in-the-loop items (used by both Project Runner and Task Runner when they need human approval)
Deliverable: Agent_Todo.md created with proper format.
Task 4 — Test Master Agent Workflows End-to-End
- Project Runner test: manually add a completed phase to a test project’s State file, invoke Project Runner via
POST /orchestrator/run, verify it detects the completion and either initiates the next phase or adds an Erik_Todo item - Task Runner test: add an incomplete item to Agent_Todo.md, invoke Task Runner, verify it dispatches the correct SRP agent and updates the todo item state
- Clone comparison test: invoke both master and clone with the same task, verify both produce results (they don’t need to match — outputs are for comparison)
- Error handling test: give Task Runner an item that matches no SRP agent, verify it reports a blocked item rather than crashing
Deliverable: Both master agents verified working end-to-end.