Documentation
¶
Overview ¶
Package multiagent implements specialist sub-agent task execution. Each task is processed through three sequential passes:
- Architect — designs the approach
- Coder — implements the design
- Reviewer — critiques the implementation
Index ¶
Constants ¶
const ArchitectSystemPrompt = `` /* 767-byte string literal not displayed */
ArchitectSystemPrompt is the system prompt for the architect sub-agent. The architect designs the technical approach without writing implementation code.
const CoderSystemPrompt = `` /* 594-byte string literal not displayed */
CoderSystemPrompt is the system prompt for the coder sub-agent. The coder receives the architect's design and produces the full implementation.
const ReviewerSystemPrompt = `` /* 890-byte string literal not displayed */
ReviewerSystemPrompt is the system prompt for the reviewer sub-agent. The reviewer critiques the implementation and confirms or overrides the signal.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Result ¶
type Result struct {
ArchitectOutput string
CoderOutput string
ReviewerOutput string
// Signal is the final task signal extracted from the reviewer's output,
// falling back to the coder's signal. One of TASK_DONE, TASK_FAILED, TASK_SKIPPED.
Signal pm.TaskStatus
ArtifactDir string // relative path of the per-task artifact directory
}
Result holds the outputs of all three sub-agent passes plus the final signal.
func RunTask ¶
func RunTask( ctx context.Context, prov provider.Provider, model string, timeout time.Duration, task *pm.Task, goal string, instructions string, projectContext string, ) (*Result, error)
RunTask executes a single PM task through the three-pass multi-agent pipeline (architect → coder → reviewer) and returns the combined result.
Each pass uses its own system prompt from roles.go. The coder receives the architect's output as context, and the reviewer receives both prior outputs. Sub-agent responses are stored as artifact files under .cloop/tasks/<id>-<slug>-multiagent/{architect,coder,reviewer}.txt.
Two stability bounds protect the pipeline:
- ctx.Err() is checked between passes so a cancelled parent (Ctrl+C translated to cancel, or the orchestrator's per-task watchdog firing) bails before the next pass instead of running the full architect→coder →reviewer chain — each pass can run for many minutes, so an unbounded pipeline ignores cancellation for tens of minutes after the user asked it to stop.
- Each prov.Complete call is wrapped in panic recovery so a panic inside a provider implementation (e.g. nil-pointer in a third-party SDK, malformed JSON deref) becomes a returned error instead of taking down the orchestrator and losing every other queued task.