fix(mcp, expand): pass projectRoot through expand/expand-all flows

Problem: expand_task & expand_all MCP tools failed with .env keys due to missing projectRoot propagation for API key resolution. Also fixed a ReferenceError: wasSilent is not defined in expandTaskDirect.

Solution: Modified core logic, direct functions, and MCP tools for expand-task and expand-all to correctly destructure projectRoot from arguments and pass it down through the context object to the AI service call (generateTextService). Fixed wasSilent scope in expandTaskDirect.

Verification: Tested expand_task successfully in MCP using .env keys. Reviewed expand_all flow for correct projectRoot propagation.
This commit is contained in:
Eyal Toledano
2025-05-01 22:37:33 -04:00
parent 303b13e3d4
commit f5585e6c31
5 changed files with 42 additions and 39 deletions

View File

@@ -503,7 +503,8 @@ async function expandTask(
prompt: promptContent,
systemPrompt: systemPrompt, // Use the determined system prompt
role,
session
session,
projectRoot
});
logger.info(
'Successfully received text response from AI service',