{"record":{"id":"183e6d68e39551f8","repo":"rtk-ai/rtk","slug":"shared-pi-omp-extension-at-was-not-removed-rerun-with-auto","errorCode":null,"errorMessage":"Shared Pi/OMP extension at {} was not removed; rerun with --auto-patch to approve the removal.","messagePattern":"Shared Pi/OMP extension at (.+?) was not removed; rerun with --auto-patch to approve the removal\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/hooks/init.rs","lineNumber":4393,"sourceCode":"        );\n        if dry_run {\n            print_dry_run_footer();\n        }\n        return Ok(());\n    }\n\n    if !confirm_shared_extension_uninstall(\n        global,\n        &plugin_path,\n        PiCompatibleAgent::Pi,\n        patch_mode,\n        ctx,\n    )? {\n        if dry_run {\n            print_dry_run_footer();\n            return Ok(());\n        }\n        anyhow::bail!(\n            \"Shared Pi/OMP extension at {} was not removed; rerun with --auto-patch to approve the removal.\",\n            plugin_path.display()\n        );\n    }\n\n    if dry_run {\n        println!(\n            \"[dry-run] would remove Pi extension: {}\",\n            plugin_path.display()\n        );\n        remove_managed_agent_state(&ownership_state_path, ctx)?;\n        print_dry_run_footer();\n    } else {\n        // nosemgrep: filesystem-deletion -- Pi uninstall removes only a known RTK stock extension.\n        fs::remove_file(&plugin_path)\n            .with_context(|| format!(\"Failed to remove Pi extension: {}\", plugin_path.display()))?;\n        remove_managed_agent_state(&ownership_state_path, ctx)?;\n        if verbose > 0 {","sourceCodeStart":4375,"sourceCodeEnd":4411,"githubUrl":"https://github.com/rtk-ai/rtk/blob/0924356b4caba4989607227b7c8824d3d8098719/src/hooks/init.rs#L4375-L4411","documentation":"When removing the shared Pi/OMP extension file (a single file used by both Pi and OpenAI-compatible/OMP agents), rtk requires explicit approval because removing it affects more than one agent. If the removal policy did not approve the action (auto-patch not enabled), rtk bails telling the user to rerun with `--auto-patch`. In dry-run mode the removal is only previewed.","triggerScenarios":"Running `rtk init` uninstall flow where `validate_stock_pi_plugin_path` reports the shared plugin path is present and removable, but `patch_mode` is not auto-patch (and not dry-run), so the action was skipped/declined.","commonSituations":"Interactive run where the user declined the removal prompt; script forgot the `--auto-patch` flag; dry-run executed first and the user reran without flags.","solutions":["Rerun with `rtk init --auto-patch` to approve removal of the shared extension file.","Preview first with `rtk init --auto-patch --dry-run`, then run without `--dry-run`.","Delete the shared file manually if you prefer not to grant auto-patch.","If the file is actually needed by the other agent, leave it and skip the removal step."],"exampleFix":"// before (shell)\nrtk init   # shared file not removed\n// after (shell)\nrtk init --auto-patch","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"rtk init --auto-patch || echo 'Shared Pi/OMP extension removal failed — remove the file manually'","preventionTips":["Always pass `--auto-patch` in scripts/uninstall flows that touch shared extension files.","Preview destructive removals with `--auto-patch --dry-run` first.","Document that shared files affect both Pi and OMP agents and need explicit approval."],"tags":["cli-flag","approval-required","uninstall","init"],"backgroundTag":"missing-required-flag","analyzedSha":"0924356b4caba4989607227b7c8824d3d8098719","analyzedAt":"2026-09-19T19:25:29.612Z","contentChangedAt":"2026-09-19T19:25:29.612Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}