Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion mcp-server/src/core/direct-functions/move-task-cross-tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,23 @@ export async function moveTaskCrossTagDirect(args, log, context = {}) {
{ projectRoot }
);

// Check if any tasks were renumbered during the move
const renumberedTasks = (result.movedTasks || []).filter(
(t) => t.newId !== undefined
);
let message = `Successfully moved ${sourceIds.length} task(s) from "${args.sourceTag}" to "${args.targetTag}"`;
if (renumberedTasks.length > 0) {
const renumberDetails = renumberedTasks
.map((t) => `${t.originalId} → ${t.newId}`)
.join(', ');
message += `. Renumbered to avoid ID collisions: ${renumberDetails}`;
Comment on lines +120 to +129
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This success message uses sourceIds.length, which will be incorrect when --with-dependencies expands the move set (core can move more tasks than were explicitly requested). Consider using result.movedTasks.length (or just result.message from core) so the MCP response stays accurate.

Copilot uses AI. Check for mistakes.
}

return {
success: true,
data: {
...result,
message: `Successfully moved ${sourceIds.length} task(s) from "${args.sourceTag}" to "${args.targetTag}"`,
message,
moveOptions,
sourceTag: args.sourceTag,
targetTag: args.targetTag
Expand Down
Loading
Loading