{"record":{"id":"c355c47c8cc0dd25","repo":"xai-org/grok-build","slug":"plugin-name-belongs-to-repo-repo-key-which","errorCode":null,"errorMessage":"Plugin \"{name}\" belongs to repo \"{repo_key}\" which also contains:\n{}\n\nUninstalling will remove all {total} plugin(s). To proceed:\n  grok plugin uninstall {name} --confirm","messagePattern":"Plugin \"(.+?)\" belongs to repo \"(.+?)\" which also contains:\n(.+?)\n\nUninstalling will remove all (.+?) plugin\\(s\\)\\. To proceed:\n  grok plugin uninstall (.+?) --confirm","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/codegen/xai-grok-pager/src/plugin_cmd.rs","lineNumber":549,"sourceCode":"                xai_grok_telemetry::events::PluginUninstalled {\n                    confirmed: true,\n                    success: true,\n                },\n            );\n            let suffix = if keep_data { \" (data preserved)\" } else { \"\" };\n            println!(\n                \"Uninstalled {} plugin(s): {}{suffix}\",\n                outcome.removed_plugins.len(),\n                outcome.removed_plugins.join(\", \"),\n            );\n            Ok(())\n        }\n        Err(UninstallError::NeedsConfirm {\n            name,\n            repo_key,\n            other_plugins,\n            total,\n        }) => bail!(\n            \"Plugin \\\"{name}\\\" belongs to repo \\\"{repo_key}\\\" which also contains:\\n\\\n             {}\\n\\n\\\n             Uninstalling will remove all {total} plugin(s). To proceed:\\n\\\n               grok plugin uninstall {name} --confirm\",\n            other_plugins\n                .iter()\n                .map(|p| format!(\"  - {p}\"))\n                .collect::<Vec<_>>()\n                .join(\"\\n\"),\n        ),\n        Err(e @ UninstallError::NotFound { .. }) => bail!(\"{e}\"),\n    }\n}\n\nfn cmd_update(name: Option<&str>) -> Result<()> {\n    let outcomes = plugin::update_plugins(name).map_err(|e| anyhow::anyhow!(\"{e}\"))?;\n\n    if outcomes.is_empty() {","sourceCodeStart":531,"sourceCodeEnd":567,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-pager/src/plugin_cmd.rs#L531-L567","documentation":"`cmd_uninstall` refuses to uninstall when the target plugin's repository directory also contains other installed plugins. `UninstallError::NeedsConfirm` is converted into this multi-line message listing the sibling plugins and the total count, instructing the user to re-run with `--confirm` to remove the whole repo (all plugins in it). This is a destructive-action safety gate, not an unexpected failure.","triggerScenarios":"`grok plugin uninstall <name>` where plugin::uninstall_plugin returns NeedsConfirm because the plugin's repo_key maps to a directory with more than one installed plugin and no --confirm flag was passed.","commonSituations":"Installing multiple plugins from a monorepo (e.g. a company plugins repo cloned locally) and later uninstalling one of them; scripted cleanups that hit the confirmation gate; users unaware uninstall removes the whole cloned repo.","solutions":["Re-run with confirmation if removing all plugins in the repo is intended: grok plugin uninstall <name> --confirm","Uninstall the other plugins individually first if you want to keep them, then remove the last one","Use --keep-data if the plugin's data should survive the uninstall","Run grok plugin list to see which plugins share the repo before confirming"],"exampleFix":"// before (blocked)\ngrok plugin uninstall monorepo-plugin-a\n\n// after (explicit confirmation)\ngrok plugin uninstall monorepo-plugin-a --confirm","handlingStrategy":"validation","validationCode":"// before uninstall, detect shared-repo situation\nfn needs_confirm(name: &str, registry: &InstallRegistry) -> bool {\n    registry.find_plugin(name)\n        .map(|p| registry.plugins_in_repo(&p.repo_key).len() > 1)\n        .unwrap_or(false)\n}","typeGuard":"fn is_installed(registry: &InstallRegistry, name: &str) -> bool {\n    registry.find_plugin(name).is_some()\n}","tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"--confirm\") => {\n        eprintln!(\"Shared repo detected: re-run with --confirm to remove all plugins in it.\");\n    }\n    other => other?,\n}","preventionTips":["Inspect grok plugin list to see repo grouping before uninstalling","Always pass --confirm in non-interactive scripts that intend full removal","Add --keep-data when plugin data must survive","Uninstall siblings individually when they should be kept"],"tags":["cli","plugin-uninstall","safety-gate","confirmation-required"],"backgroundTag":"destructive-action-confirmation-required","analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}