Compare commits
2 Commits
ralph/chor
...
fix/expand
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e42e4d778c | ||
|
|
b8649b2f8d |
@@ -461,19 +461,44 @@ async function expandTask(
|
|||||||
`${combinedAdditionalContext}\n\n# Project Context\n\n${gatheredContext}`.trim();
|
`${combinedAdditionalContext}\n\n# Project Context\n\n${gatheredContext}`.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure expansionPrompt is a string (handle both string and object formats)
|
||||||
|
let expansionPromptText = undefined;
|
||||||
|
if (taskAnalysis?.expansionPrompt) {
|
||||||
|
if (typeof taskAnalysis.expansionPrompt === 'string') {
|
||||||
|
expansionPromptText = taskAnalysis.expansionPrompt;
|
||||||
|
} else if (
|
||||||
|
typeof taskAnalysis.expansionPrompt === 'object' &&
|
||||||
|
taskAnalysis.expansionPrompt.text
|
||||||
|
) {
|
||||||
|
expansionPromptText = taskAnalysis.expansionPrompt.text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ensure gatheredContext is a string (handle both string and object formats)
|
||||||
|
let gatheredContextText = gatheredContext;
|
||||||
|
if (typeof gatheredContext === 'object' && gatheredContext !== null) {
|
||||||
|
if (gatheredContext.data) {
|
||||||
|
gatheredContextText = gatheredContext.data;
|
||||||
|
} else if (gatheredContext.text) {
|
||||||
|
gatheredContextText = gatheredContext.text;
|
||||||
|
} else {
|
||||||
|
gatheredContextText = JSON.stringify(gatheredContext);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const promptParams = {
|
const promptParams = {
|
||||||
task: task,
|
task: task,
|
||||||
subtaskCount: finalSubtaskCount,
|
subtaskCount: finalSubtaskCount,
|
||||||
nextSubtaskId: nextSubtaskId,
|
nextSubtaskId: nextSubtaskId,
|
||||||
additionalContext: additionalContext,
|
additionalContext: additionalContext,
|
||||||
complexityReasoningContext: complexityReasoningContext,
|
complexityReasoningContext: complexityReasoningContext,
|
||||||
gatheredContext: gatheredContext,
|
gatheredContext: gatheredContextText || '',
|
||||||
useResearch: useResearch,
|
useResearch: useResearch,
|
||||||
expansionPrompt: taskAnalysis?.expansionPrompt || undefined
|
expansionPrompt: expansionPromptText || undefined
|
||||||
};
|
};
|
||||||
|
|
||||||
let variantKey = 'default';
|
let variantKey = 'default';
|
||||||
if (taskAnalysis?.expansionPrompt) {
|
if (expansionPromptText) {
|
||||||
variantKey = 'complexity-report';
|
variantKey = 'complexity-report';
|
||||||
logger.info(
|
logger.info(
|
||||||
`Using expansion prompt from complexity report for task ${task.id}.`
|
`Using expansion prompt from complexity report for task ${task.id}.`
|
||||||
|
|||||||
Reference in New Issue
Block a user