{"record":{"id":"2eb4a5114e8aa445","repo":"upstash/context7","slug":"remove-cancelled","errorCode":null,"errorMessage":"Remove cancelled","messagePattern":"Remove cancelled","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"packages/cli/src/commands/remove.ts","lineNumber":153,"sourceCode":"\nasync function resolveAgents(options: UninstallOptions, scope: Scope): Promise<SetupAgent[]> {\n  const explicit = getSelectedAgents(options);\n  if (explicit.length > 0) return explicit;\n\n  const detected = await detectConfiguredAgents(scope);\n  if (detected.length > 0 && options.yes) return detected;\n\n  if (detected.length === 0) {\n    log.warn(\n      `No Context7 setup detected. Pass one of: ${ALL_AGENT_NAMES.map((name) => `--${name}`).join(\", \")}.`\n    );\n    return [];\n  }\n\n  log.blank();\n  const selected = await promptAgents(detected);\n  if (!selected) {\n    log.warn(\"Remove cancelled\");\n    return [];\n  }\n\n  return selected;\n}\n\nfunction resolveFlagModes(options: UninstallOptions): UninstallMode[] {\n  if (options.all) return [\"mcp\", \"cli\"];\n\n  const selected: UninstallMode[] = [];\n\n  if (options.mcp) selected.push(\"mcp\");\n  if (options.cli) selected.push(\"cli\");\n\n  return selected.length > 0 ? selected : [\"mcp\", \"cli\"];\n}\n\nasync function pathExists(path: string): Promise<boolean> {","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/upstash/context7/blob/4416fb855b8f752be735e34f943b5d0762701aad/packages/cli/src/commands/remove.ts#L135-L171","documentation":"In remove.ts resolveAgents(), after detecting configured agents, the CLI prompts the user to select which ones to remove via promptAgents(detected). If the user aborts the prompt (Esc/Ctrl+C or explicit cancel), it logs 'Remove cancelled' and returns an empty array so nothing is uninstalled.","triggerScenarios":"promptAgents(detected) resolves falsy — the user cancels the multi-select of agents during a `context7 remove` run that had detected integrations but no explicit flags and no --yes.","commonSituations":"User changes their mind mid-uninstall; pressing Esc/Ctrl+C at the agent picker; running remove in a weak TTY where the prompt aborts immediately.","solutions":["Rerun `context7 remove` and select the agents to remove","Use --yes to skip the prompt and remove all detected integrations","Pass explicit agent flags (e.g. --cursor) to bypass the picker entirely"],"exampleFix":"// before: cancels at picker\n// $ context7 remove\n// after\n// $ context7 remove --yes      # or: context7 remove --cursor","handlingStrategy":"validation","validationCode":"if (!process.stdout.isTTY) {\n  args.push(\"--yes\"); // avoid the agent picker aborting in scripts\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use --yes or explicit agent flags in non-interactive contexts","Complete or explicitly cancel the picker — an abort removes nothing","Rerun the command if you aborted by accident"],"tags":["cli","user-cancelled","interactive-prompt"],"backgroundTag":"user-cancelled-operation","analyzedSha":"4416fb855b8f752be735e34f943b5d0762701aad","analyzedAt":"2026-09-16T20:28:07.148Z","contentChangedAt":"2026-09-16T20:28:07.148Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}