{"record":{"id":"5fded5e9935f778d","repo":"eyaltoledano/claude-task-master","slug":"tag-deletion-cancelled","errorCode":null,"errorMessage":"Tag deletion cancelled","messagePattern":"Tag deletion cancelled","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"info","filePath":"scripts/modules/task-manager/tag-management.js","lineNumber":353,"sourceCode":"\t\t\t\t\t\tborderStyle: 'round',\n\t\t\t\t\t\tmargin: { top: 1, bottom: 1 }\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// First confirmation\n\t\t\tconst firstConfirm = await inquirer.prompt([\n\t\t\t\t{\n\t\t\t\t\ttype: 'confirm',\n\t\t\t\t\tname: 'proceed',\n\t\t\t\t\tmessage: `Are you sure you want to delete tag \"${tagName}\" and its ${taskCount} tasks?`,\n\t\t\t\t\tdefault: false\n\t\t\t\t}\n\t\t\t]);\n\n\t\t\tif (!firstConfirm.proceed) {\n\t\t\t\tlogFn.info('Tag deletion cancelled by user');\n\t\t\t\tthrow new Error('Tag deletion cancelled');\n\t\t\t}\n\n\t\t\t// Second confirmation (double-check)\n\t\t\tconst secondConfirm = await inquirer.prompt([\n\t\t\t\t{\n\t\t\t\t\ttype: 'input',\n\t\t\t\t\tname: 'tagNameConfirm',\n\t\t\t\t\tmessage: `To confirm deletion, please type the tag name \"${tagName}\":`,\n\t\t\t\t\tvalidate: (input) => {\n\t\t\t\t\t\tif (input === tagName) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn `Please type exactly \"${tagName}\" to confirm deletion`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]);\n\n\t\t\tif (secondConfirm.tagNameConfirm !== tagName) {","sourceCodeStart":335,"sourceCodeEnd":371,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/scripts/modules/task-manager/tag-management.js#L335-L371","documentation":"When running in interactive text mode without the `yes` option, deleteTag() prompts for confirmation before removing a tag that contains tasks. If the user answers 'no' at the first confirmation prompt, the function throws 'Tag deletion cancelled' to abort the operation. This is control flow via exception, not a malfunction.","triggerScenarios":"Running `task-master delete-tag <name>` (or calling deleteTag without {yes:true}) in a TTY, seeing the warning box about N tasks being deleted, and answering 'n' at the 'Are you sure...' prompt.","commonSituations":"Users hesitating during a destructive operation, accidental invocations of the delete command, automated environments without TTY support where the prompt behaves unexpectedly.","solutions":["No action needed — nothing was deleted; the tag and its tasks are intact.","Re-run the command and answer 'y' if you do want to delete, or use --yes to skip prompts when scripting.","If prompts appear unintentionally in automation, pass { yes: true } in options or outputFormat 'json' to bypass interactive confirmation."],"exampleFix":"// before (script hangs/prompts, or aborts on 'n')\nawait deleteTag(tasksPath, tag, {}, context);\n// after (non-interactive)\nawait deleteTag(tasksPath, tag, { yes: true }, context);","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await deleteTag(tasksPath, tag, opts, ctx);\n} catch (e) {\n  if (e.message === 'Tag deletion cancelled') {\n    console.log('Deletion aborted by user; no changes made.');\n    return;\n  }\n  throw e;\n}","preventionTips":["Pass { yes: true } when running non-interactively to skip prompts entirely.","Catch and handle cancellation errors gracefully in custom UX built on deleteTag.","Show the task count warning yourself before calling so users aren't surprised by the prompt."],"tags":["user-cancelled","interactive-prompt","tag-management"],"backgroundTag":"operation-cancelled-by-user","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}