Skip to content

30 Supervisor and Tasks

KepCup 开发助理 edited this page Oct 24, 2026 · 1 revision

30 Supervisor and Tasks

Source: docs/design/30-supervisor-and-tasks.md

Status: implemented (2026-10-08, D75) — some DEV-009–015 refinements pending confirmation

This is the deep design for the dual-loop model sketched in 02-Execution.

Two layers

Reply turn (supervisor): read-only, serial per (Bot, conversation), built-in engine, owns communication and scheduling (start_task / inject_task / cancel_task / list_tasks + async managed actions).

Task: full tools, parallel within caps, may use external agent engine when implemented. Writes and long work only here.

Private timeline

Bot↔task traffic (task_event) uses owner_bot_id on the same messages table — filtered per viewer. Shared conversation summary only includes shared rows.

Must-settle invariant

Every terminal task’s result is consumed at least once by a turn: persist notify (main.db, ≤1 per task, unique index) → task terminal (runs.db) → deliver → mark consumed at turn end. Prefer duplicate wakeup over silent loss. Reaper + startup reconcile.

Leases — not worktrees

Expand leases to workspace keys; one write task per workdir. Git worktree / CoW isolation explicitly out of scope (breaks remote-git policy, path gate, shadow checkpoints).

Impacts

Revises D2, D5, D29, D37, D56, D66, D67, D72. D92 renames task root to cwd and ties settlement wakeups to collaboration episodes. Harness additions: 43-Task-Loop-Harness. UI: 42-Task-Run-View.

Clone this wiki locally