Parent umbrella issue: #408
Source audit: Weekly tech debt audit: dispatch - 2026-06-17
Source audit date: 2026-06-17
Original recommendation
P3 — Add idle and mode=groom contract tests for /api/agents/[agentName]/next-task; add auth-coverage tests once #2 lands.
Matched top finding
The new next-task test file has 9 cases focused on happy-path task shaping, but no contract test for:
- the
idle task shape returned when neither queue nor PR-fix has work
- the
mode=groom groom-task-shape
- the
?includeClaimed=true / ?includeRenovate=true query parameter handling
The tasks/report test file is similarly happy-path only (12 cases, no auth, no persistence).
Evidence:
wc -l src/app/api/agents/[agentName]/next-task/route.test.ts → not super high; count of it( cases: 9.
wc -l src/app/api/agents/[agentName]/tasks/report/route.test.ts → 12 cases, all validation only.
Parent umbrella issue: #408
Source audit: Weekly tech debt audit: dispatch - 2026-06-17
Source audit date: 2026-06-17
Original recommendation
P3 — Add
idleandmode=groomcontract tests for/api/agents/[agentName]/next-task; add auth-coverage tests once #2 lands.Matched top finding
The new
next-tasktest file has 9 cases focused on happy-path task shaping, but no contract test for:idletask shape returned when neither queue nor PR-fix has workmode=groomgroom-task-shape?includeClaimed=true/?includeRenovate=truequery parameter handlingThe
tasks/reporttest file is similarly happy-path only (12 cases, no auth, no persistence).Evidence:
wc -l src/app/api/agents/[agentName]/next-task/route.test.ts→ not super high; count ofit(cases: 9.wc -l src/app/api/agents/[agentName]/tasks/report/route.test.ts→ 12 cases, all validation only.