Problem
claim_task and list_tasks in src/acp/tools.ts are stubs that return hardcoded data. They do not query the SQLite/FTS5 index, so the ACP hub cannot actually dispatch real tasks from the workspace.
Current behavior
// claim_task — stub
return {
taskId: req.planId ? `${req.planId}#000` : 'unknown',
title: 'Unclaimed task',
frontmatter: {},
primerContent: null,
files: [],
};
// list_tasks — stub
return [];
Expected behavior
list_tasks({ planId?, status? }) — queries the agent index (via listAgents or equivalent DB call) and returns real tasks filtered by plan and status
claim_task({ planId?, agentId? }) — finds the next GAP agent in the specified plan (or highest-priority across all plans), marks it WIP via updateTaskStatus, resolves its primer via resolvePrimer, and returns the full task payload (frontmatter + primer content + files list)
Acceptance criteria
Files to modify
src/acp/tools.ts — replace stubs with real DB calls
src/acp/types.ts — extend ClaimTaskResponse if needed
tests/acp/tools.test.ts — add integration tests with temp DB
Related
src/cli/task-resolver.ts — existing plan/agent resolution logic to reuse
src/indexer.ts — DB access layer
Problem
claim_taskandlist_tasksinsrc/acp/tools.tsare stubs that return hardcoded data. They do not query the SQLite/FTS5 index, so the ACP hub cannot actually dispatch real tasks from the workspace.Current behavior
Expected behavior
list_tasks({ planId?, status? })— queries the agent index (vialistAgentsor equivalent DB call) and returns real tasks filtered by plan and statusclaim_task({ planId?, agentId? })— finds the nextGAPagent in the specified plan (or highest-priority across all plans), marks itWIPviaupdateTaskStatus, resolves its primer viaresolvePrimer, and returns the full task payload (frontmatter + primer content + files list)Acceptance criteria
list_tasksreturns real agents from the DB, respectingplanIdandstatusfiltersclaim_taskselects the nextGAPagent using the existing scoring/priority logicclaim_taskcallsupdateTaskStatusto transition the agent toWIPbefore returningclaim_taskresolves and injects the plan primer into the responseFiles to modify
src/acp/tools.ts— replace stubs with real DB callssrc/acp/types.ts— extendClaimTaskResponseif neededtests/acp/tools.test.ts— add integration tests with temp DBRelated
src/cli/task-resolver.ts— existing plan/agent resolution logic to reusesrc/indexer.ts— DB access layer