-
Notifications
You must be signed in to change notification settings - Fork 1
feat(acp): wire claim_task and list_tasks to the DB indexer #146
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
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 (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, respectingplanIdandstatusfilters -
claim_taskselects the nextGAPagent using the existing scoring/priority logic -
claim_taskcallsupdateTaskStatusto transition the agent toWIPbefore returning -
claim_taskresolves and injects the plan primer into the response - Both tools handle missing plan gracefully (return empty/error, not throw)
- Tests cover real DB queries with a temp SQLite fixture
Files 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 DB
Related
src/cli/task-resolver.ts— existing plan/agent resolution logic to reusesrc/indexer.ts— DB access layer
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request