Delegate a bounded task to a Luna worker
delegate_taskDelegate a single bounded implementation task to an isolated worker thread, defining objective, acceptance criteria, and allowed files, then independently verify the result.
Instructions
Delegate ONE bounded implementation task to an isolated gpt-5.6-luna worker thread.
Use this when a task is well-specified enough to hand off: you can state the objective, what "done" looks like, and which files may change. Keep architecture, sequencing, and final judgement for yourself.
Choosing effort — rate THIS TASK's intrinsic difficulty, never the parent
project's importance:
medium Mechanical and fully specified. Rename, move, boilerplate, obvious
test cases, applying a pattern that already exists in the codebase.
high DEFAULT. Real implementation work needing judgement within one area:
a new endpoint, a bug fix with a known repro, a focused refactor.
xhigh Subtle or cross-cutting. Concurrency, tricky state, non-obvious
performance work, changes rippling across several modules, or a bug
whose cause is not yet identified.
max Genuinely hard problems only. Reserve for tasks where a strong
engineer would expect to be stuck for a while: intricate algorithms,
deep debugging with no clear lead, or a task that already came back
FAILED at xhigh. An important task that is straightforward is still
"high" — importance is not difficulty.
Prefer escalating over starting high: run at high, and if it comes back FAILED
because the task was genuinely hard, re-delegate at xhigh with
previousAttempts filled in. If it failed because your brief was vague, fix the
brief instead — the same objective at higher effort usually fails again, slower.
BEFORE delegating at all, decide whether it is worth it. Delegation has a fixed overhead — writing the contract, spawning a thread, re-verifying the result — and on small work that overhead exceeds the work itself. Measured on this project's own micro-benchmark, delegating a one-file task was ~2.3x slower and ~3.5x the tokens of just doing it, with no quality difference.
Do it yourself when:
the change is small, mechanical, or confined to one file
you already know the exact edit
explaining the task would take longer than making the change
there is no second independent piece of work to overlap it with
Delegate a single task when the work is substantial and bounded, and you want an enforced file scope plus independently re-run verification.
For two or more independent pieces of work, use delegate_tasks instead — that
is where delegation can actually save wall-clock time.
The worker cannot delegate further and cannot see this conversation.
The result is evidence, not a conclusion. The orchestrator independently re-runs
your verificationCommands after the worker exits and checks which files were
actually touched, then returns verdict, discrepancies, and
reviewChecklist. A worker PASS with a FAILED verdict means the worker was
wrong. Always review the diff before accepting.
verificationCommands run without a shell: one allowlisted executable per
command, no pipes, redirects, && or ;. Use npm test or pytest -q,
not npm run build && npm test (pass those as two commands).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| effort | No | Reasoning effort for the worker. medium = mechanical, high = default for real implementation work, xhigh = subtle or cross-cutting, max = genuinely hard problems only. Rate the DELEGATED TASK's own difficulty, never the parent project's importance. | high |
| context | No | Background the worker cannot infer from the repo: prior decisions, constraints, gotchas, relevant files. | |
| objective | Yes | Single bounded implementation task, written so a worker with no access to your conversation can execute it. State the what and the why. | |
| allowedFiles | No | Glob patterns the worker may create or modify (e.g. 'src/auth/**'). Empty means unrestricted, which is discouraged. Enforced after the run. | |
| effortReason | Yes | One sentence justifying the effort in terms of this task's difficulty. Required so effort selection stays deliberate. | |
| taskCategory | No | Shape of the work. 'investigation' and 'bugfix' more often justify xhigh; 'chore' and 'tests' rarely do. | |
| forbiddenFiles | No | Glob patterns the worker must not touch (e.g. 'package.json'). Takes precedence over allowedFiles. Forbid the test files when tests are the verification. | |
| timeoutSeconds | No | Wall-clock budget for the worker turn. Defaults to 1800. | |
| previousAttempts | No | Escalation history for this same objective. Supply it when re-delegating after a FAILED or BLOCKED result: the worker sees what already failed, and the orchestrator reports the attempt number back to you. | |
| workingDirectory | No | Absolute path the worker operates in. Defaults to the orchestrator's current working directory. | |
| acceptanceCriteria | Yes | Observable, checkable conditions that define done — something you can confirm by reading the diff or running a command. | |
| verificationCommands | No | Shell-free commands proving the work (e.g. 'npm test', 'pytest -q'). The worker runs them AND the orchestrator independently re-runs them after the worker exits; the orchestrator's exit codes are authoritative. Only allowlisted executables run, and pipes/redirects/&&/; are refused. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | ||
| notes | Yes | ||
| usage | Yes | ||
| effort | Yes | ||
| errors | Yes | Runtime errors surfaced during the turn. | |
| attempt | Yes | Attempt number for this objective, from `previousAttempts`. | |
| summary | Yes | Worker's summary of what it did. | |
| verdict | Yes | Orchestrator's verdict, derived from independently re-run verification and scope checks — NOT copied from the worker's claim. | |
| followUps | Yes | ||
| trustworthy | Yes | False when the worker's claim conflicts with observed evidence. False demands a careful diff review before accepting anything. | |
| effortReason | Yes | ||
| filesChanged | Yes | Union of edits observed by the Codex runtime and edits the worker claimed. `observed: false` means the runtime saw no such patch. | |
| verification | Yes | Verification outcomes. Prefer `source: orchestrator` rows. | |
| discrepancies | Yes | Concrete mismatches between the worker's claims and observed reality. Non-empty means do not accept the result as-is. | |
| workerThreadId | Yes | Codex thread id of the worker, for inspecting or resuming it. | |
| durationSeconds | Yes | ||
| reviewChecklist | Yes | What you, Sol, must still check yourself before accepting. | |
| scopeViolations | Yes | Files touched outside allowedFiles, inside forbiddenFiles, or outside the workspace. | |
| escalationAdvice | Yes | When the task did not pass, what to change before retrying — including whether raising effort is actually justified. | |
| verificationMode | Yes | Execution policy in force: allowlist, off, or shell. | |
| workerClaimedStatus | Yes | What the worker reported. Compare against `verdict`. |