fix: merge metadata in update-subtask when prompt also provided

When both prompt and metadata are provided to update-subtask, the
metadata was being ignored. Now metadata is merged after AI update,
similar to how update-task handles it.

Fixes Cursor Bugbot review comment about ignored metadata.
This commit is contained in:
Cedric Hurst
2026-01-02 17:34:20 -06:00
parent d7df066734
commit fd01e77065

View File

@@ -358,6 +358,14 @@ async function updateSubtaskById(
const updatedSubtask = parentTask.subtasks[subtaskIndex];
// Merge metadata if provided (preserve existing metadata)
if (metadata) {
updatedSubtask.metadata = {
...(updatedSubtask.metadata || {}),
...metadata
};
}
if (outputFormat === 'text' && getDebugFlag(session)) {
console.log(
'>>> DEBUG: Subtask details AFTER AI update:',