fix(cli): Correctly pass manual task data in add-task command

The add-task command handler in commands.js was incorrectly passing null for the manualTaskData parameter to the core addTask function. This caused the core function to always fall back to the AI generation path, even when only manual flags like --title and --description were provided. This commit updates the call to pass the correctly constructed manualTaskData object, ensuring that manual task creation via the CLI works as intended without unnecessarily calling the AI service.
This commit is contained in:
Eyal Toledano
2025-04-26 18:30:02 -04:00
parent b47f189cc2
commit 96aeeffc19
7 changed files with 65 additions and 16 deletions

View File

@@ -913,14 +913,16 @@ function registerCommands(programInstance) {
// Pass mcpLog and session for MCP mode
const newTaskId = await addTask(
options.file,
options.prompt,
options.prompt, // Pass prompt (will be null/undefined if not provided)
dependencies,
options.priority,
{
session: process.env // Pass environment as session for CLI
// For CLI, session context isn't directly available like MCP
// We don't need to pass session here for CLI API key resolution
// as dotenv loads .env, and utils.resolveEnvVariable checks process.env
},
'text', // outputFormat
null, // manualTaskData
manualTaskData, // Pass the potentially created manualTaskData object
options.research || false // Pass the research flag value
);