Parent umbrella issue: #408
Source audit: Weekly tech debt audit: dispatch - 2026-06-17
Source audit date: 2026-06-17
Original recommendation
P1 — Reconcile AGENTS.md and docs/worker-execution-contract.md with the new next-task, tasks/report, work-summary, active-work, and AgentTask contract.
Matched top finding
The "OpenClaw Agent Workflow Contract" section of AGENTS.md documents POST /api/sync, POST /api/agent-runs, GET /api/issues, and GET /api/agents/[agentName]/queue, but does not mention:
GET /api/agents/[agentName]/next-task (the canonical entry point for new harnesses)
POST /api/agents/[agentName]/tasks/report (where harnesses report task outcomes)
GET /api/agents/[agentName]/work-summary (lane-aware work counts)
GET /api/agents/[agentName]/active-work (resume context)
GET /api/agents/[agentName]/queue is documented but the AgentTask contract from src/lib/agent-task.ts is not.
This drift is exactly what the previous audit flagged (#317 "Reconcile maintainer docs with implemented lane routes"), but the next wave of endpoint additions was not picked up by the same fix.
Evidence:
grep -n "/api/agents" AGENTS.md returns only queue/heartbeat/lane references.
src/lib/agent-task.ts (200+ lines) is not referenced anywhere in AGENTS.md or README.md.
docs/worker-execution-contract.md references getQueuedPrFixItems indirectly but does not show the next-task contract shape.
Parent umbrella issue: #408
Source audit: Weekly tech debt audit: dispatch - 2026-06-17
Source audit date: 2026-06-17
Original recommendation
P1 — Reconcile
AGENTS.mdanddocs/worker-execution-contract.mdwith the newnext-task,tasks/report,work-summary,active-work, andAgentTaskcontract.Matched top finding
The "OpenClaw Agent Workflow Contract" section of
AGENTS.mddocumentsPOST /api/sync,POST /api/agent-runs,GET /api/issues, andGET /api/agents/[agentName]/queue, but does not mention:GET /api/agents/[agentName]/next-task(the canonical entry point for new harnesses)POST /api/agents/[agentName]/tasks/report(where harnesses report task outcomes)GET /api/agents/[agentName]/work-summary(lane-aware work counts)GET /api/agents/[agentName]/active-work(resume context)GET /api/agents/[agentName]/queueis documented but the AgentTask contract fromsrc/lib/agent-task.tsis not.This drift is exactly what the previous audit flagged (#317 "Reconcile maintainer docs with implemented lane routes"), but the next wave of endpoint additions was not picked up by the same fix.
Evidence:
grep -n "/api/agents" AGENTS.mdreturns only queue/heartbeat/lane references.src/lib/agent-task.ts(200+ lines) is not referenced anywhere inAGENTS.mdorREADME.md.docs/worker-execution-contract.mdreferencesgetQueuedPrFixItemsindirectly but does not show the next-task contract shape.