fix(expand-task): include parent task context in complexity report variant (#1094)

- Fixed bug where expand task generated generic authentication subtasks
- The complexity-report prompt variant now includes parent task details
- Added comprehensive unit tests to prevent regression
- Added debug logging to help diagnose similar issues

Previously, when using a complexity report with expansionPrompt, only the
expansion guidance was sent to the AI, missing the actual task context.
This caused the AI to generate unrelated generic subtasks.

Fixes the issue where all tasks would get the same generic auth-related
subtasks regardless of their actual purpose (AWS infrastructure, Docker
containerization, etc.)

Co-authored-by: Sadaqat Ali <32377500+sadaqat12@users.noreply.github.com>
This commit is contained in:
Ralph Khreish
2025-08-06 22:00:32 +03:00
committed by GitHub
parent 59f7676051
commit 4357af3f13
4 changed files with 154 additions and 1 deletions

View File

@@ -527,6 +527,18 @@ async function expandTask(
const { systemPrompt, userPrompt: promptContent } =
await promptManager.loadPrompt('expand-task', promptParams, variantKey);
// Debug logging to identify the issue
logger.debug(`Selected variant: ${variantKey}`);
logger.debug(
`Prompt params passed: ${JSON.stringify(promptParams, null, 2)}`
);
logger.debug(
`System prompt (first 500 chars): ${systemPrompt.substring(0, 500)}...`
);
logger.debug(
`User prompt (first 500 chars): ${promptContent.substring(0, 500)}...`
);
// --- End Complexity Report / Prompt Logic ---
// --- AI Subtask Generation using generateTextService ---