Framing: a solo developer's workflow (2026-11). The task runner is a solo developer's personal local tool; this recipe covers the general pattern and does not require the same tool. Codex / Grok are examples; check each provider's terms for your region (this recipe doesn't judge that). If you use Claude: not supported in mainland China, Hong Kong or Macau since 2026-11-12 (checked 2026-11-23).
Situation
- Audience: you want to hand tasks to background agents without watching, but want them to stop for your approval of the plan before any code is written.
- Difference from
dual-agent-write-review-loop: that loop runs in front of you in one worktree; this is a background, unattended-capable task: state on disk, default stop at "awaiting approval", completion by notification. - When not to use: few-line changes, or exploratory work needing conversation.
Steps
- One directory per task, state as files: task description, plan A, plan B (critique of A),
agreed_plan, approval flag, implementation notes, review, stage logs, state JSON. The directory is the handoff record. - Two models in the plan phase: A drafts, B critiques read-only, the two are merged into
agreed_plan. - Stop at
awaiting_approvalby default. No auto-approve unless the owner explicitly allows it for that class of task. Approval is a flag file created by a human, never by an agent; it records the task ID and the hash ofagreed_plan.mdand is verified before implementation — any plan edit invalidates it. - Implement only after approval, in an isolated worktree/task branch; independent review; mark completed — no merge, no push.
- Notify on done/failed with a local webhook instead of polling (
hooks-not-polling-notifications); the message holds only task ID, status and a one-line summary. - Collab mode (A plans + B critiques + human approves) for complex tasks, single-model mode for mechanical ones; neither bypasses "no merge".
Templates
State machine and task-directory layout: see the Chinese section (code block is English). Map stages to pipeline.yaml: gates "approval flag created by a human and its hash matches the current agreed plan"; reliability.timeout_seconds/max_agent_turns per stage and "review verdict APPROVE"; budget per stage. Calibrate the reviewer with the eval / golden-set checklist.
Cost (order of magnitude, estimate)
- Collab turns one task into "two plan calls + implementation + one review", about 2–3 more calls than a single model; it buys you a chance to stop wrong directions before code exists. Use it where rework is expensive. Estimate per stage in the ROI input table.
Failure cases and guards
- Auto-approve by default (guard): it empties the gate; the flag must be human-made.
- Approval flag not bound to a plan version (guard): an edited plan would inherit the old approval; hence the hash check.
- No notification, so you babysit (guard).
- Serious findings in review (occurred, recorded): on a camera-app task, the independent review returned a graded (blocker/major/minor) list of concurrency and lifecycle issues, with major items needing another pass — the point of separating writer and reviewer (the review record stays in the task directory and is not published here).
- Background task quietly pushing/merging (guard): the task spec forbids it and the state machine has no such step.
- Secrets leaking into logs or notifications (guard): notifications carry ID and summary only; check logs before pasting.
China alternatives
china_availability: partial. The method is generic: A and B can be Kimi Code / GLM Coding Plan / Qwen Code / DeepSeek; notify via Feishu/DingTalk/WeCom bots.- Check regional availability of Codex, Grok and Claude yourself; no circumvention advice.
Safety notes
- Only a human can create the approval flag; the agents' environment should lack permission to do so.
- Never give sudo passwords or tokens to background agents; keep webhook addresses and tokens in config, not in task dirs, logs or repos.
- Background tasks run in an isolated worktree and never touch main.
Test notes
- 2026-11-02 to 2026-11-12: the tool ran 9 collab tasks, all completed; directories retain plans A/B,
agreed_plan, approval flag, implementation notes, review and logs. The earliest (2026-11-02) has a graded review. - The layout above is a summary of the task directories, not re-run verbatim. The personal tool has no version number; Codex CLI on the same machine was 0.171.0 (2026-11-23).
Verification
- Submit a task: it must stop at
awaiting_approval; without the flag, nothing is implemented. - After creating the flag, implementation starts, a notification arrives at the end, and the main branch is untouched.