Delegate several tasks to Luna workers
delegate_tasksDelegate multiple bounded coding tasks to isolated worker threads, in parallel or sequence, with enforced file scopes and independent verification.
Instructions
Delegate SEVERAL bounded tasks to gpt-5.6-luna workers, in parallel or in sequence.
This is where delegation can actually pay for itself. A single small task is faster done yourself; several substantial, independent tasks are not.
Pick the mode deliberately:
parallel Two or more tasks that do NOT depend on each other. Each worker gets its own git worktree branched from HEAD, so they cannot see or clobber each other. Afterwards their changes are integrated only if no two workers touched the same file. Requires: a git repository with at least one commit, and no uncommitted changes inside the declared task scopes.
sequential Tasks that build on each other, or that must touch the same files. They share the workspace and run one at a time, so a later task sees the earlier one's work. No git requirement.
Give every parallel task a DISJOINT allowedFiles scope — e.g. src/auth/**
and src/payments/**, never src/auth/** and src/**. Overlapping scopes are
rejected up front, because the outcome would depend on which worker finished
last. Choose sequential mode instead when the work genuinely shares files.
Each task carries its own effort. Rate each task separately: a batch may mix
medium, high and xhigh workers, and usually should.
Do NOT use this to fan out work that is really one task, and do not split a change so finely that coordinating the pieces costs more than writing them.
Partial failure is normal and is reported, not hidden: successful tasks are kept and you decide per task whether to retry, re-scope, or accept. Nothing is merged automatically when workers collide.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | parallel = tasks are independent; each runs in its own git worktree and results are integrated afterwards. sequential = tasks may depend on each other; they share the workspace and run one at a time, so a later task sees the earlier one's changes. | |
| tasks | Yes | Task contracts. For parallel mode give each a disjoint allowedFiles scope; overlapping scopes are rejected unless you opt in. | |
| integrate | No | Parallel mode only. Copy each worker's changes back into the workspace when no two workers touched the same file. Set false to review the worktrees yourself before anything moves. | |
| workingDirectory | No | Absolute path. Defaults to the orchestrator's working directory. | |
| allowOverlappingScopes | No | Run in parallel even when two tasks could touch the same files. Off by default because the result then depends on which worker finishes last. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | ||
| tasks | Yes | ||
| failed | Yes | ||
| passed | Yes | ||
| batchId | Yes | ||
| warnings | Yes | ||
| taskCount | Yes | ||
| integrated | Yes | Whether worker changes are now present in the workspace. | |
| maxParallel | Yes | ||
| scopeConflicts | Yes | Declared scopes that could match the same files. | |
| durationSeconds | Yes | ||
| reviewChecklist | Yes | ||
| integrationSummary | Yes | ||
| integrationConflicts | Yes | Files more than one worker actually changed. Non-empty means nothing was integrated and you must merge them yourself. |