mesh-scheduler

mesh-scheduler — Async task queue for agent work coordination

Infrastructure

Usage

mesh schedule  [args]

Commands

submit, claim, complete, fail, retry, queue, status, history, stats

Commons Entry


# mesh-scheduler

Async task queue for multi-agent work coordination. Agents submit tasks with priority and optional assignment, claim pending work, complete or fail tasks (with auto-retry up to 3x), and track queue statistics.

## Layer
L2 (Services) — coordinates work distribution across agents.

## Commands
- `mesh schedule submit <title> [priority] [agent] [deadline]` — submit task
- `mesh schedule claim <task_id>` — claim a pending task
- `mesh schedule complete <task_id> [result]` — mark done
- `mesh schedule fail <task_id> [reason]` — fail + auto-retry
- `mesh schedule retry <task_id>` — reset dead task
- `mesh schedule queue [filter]` — list tasks (all/pending/claimed/completed/dead)
- `mesh schedule status <task_id>` — task detail
- `mesh schedule stats` — queue statistics
- `mesh schedule history` — event log

## Priority Levels
critical > high > normal > low

## Status Machine
pending → claimed → completed
                 → failed → pending (retry) or dead (max retries)
dead → pending (manual retry)

## Ledger
- Queue: `mesh-state/scheduler/queue.jsonl`
- History: `mesh-state/scheduler/history.jsonl` (via ledger-write.sh)

## Integration
- Uses standardized ledger-write.sh for history events
- MESH_AGENT env var for agent identity
- Wired into mesh CLI as `mesh schedule|sched`