{"record":{"id":"41bc19bf5261d043","repo":"rtk-ai/rtk","slug":"pi-extension-at-contains-rtk-content-that-does-not-match-the","errorCode":null,"errorMessage":"Pi extension at {} contains RTK content that does not match the stock extension. Remove the file manually.","messagePattern":"Pi extension at (.+?) contains RTK content that does not match the stock extension\\. Remove the file manually\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/hooks/init.rs","lineNumber":4367,"sourceCode":"        return Ok(());\n    }\n\n    let ownership_state_path = shared_agent_state_path(&plugin_path);\n    let Some(content) = read_extension_for_uninstall(&plugin_path, \"Pi extension\", ctx)? else {\n        return Ok(());\n    };\n\n    if !is_known_stock_pi_plugin(&content) {\n        if looks_like_rtk_pi_plugin(&content) {\n            if dry_run {\n                println!(\n                    \"[dry-run] would refuse to remove Pi extension: {}\",\n                    plugin_path.display()\n                );\n                print_dry_run_footer();\n                return Ok(());\n            }\n            anyhow::bail!(\n                \"Pi extension at {} contains RTK content that does not match the stock extension. Remove the file manually.\",\n                plugin_path.display()\n            );\n        }\n        println!(\n            \"Pi extension at {} is not RTK content; leaving it alone.\",\n            plugin_path.display()\n        );\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,","sourceCodeStart":4349,"sourceCodeEnd":4385,"githubUrl":"https://github.com/rtk-ai/rtk/blob/0924356b4caba4989607227b7c8824d3d8098719/src/hooks/init.rs#L4349-L4385","documentation":"When uninstalling the Pi extension, rtk detects that the existing extension file contains RTK markers but its content does not match the current stock extension shipped with this rtk version (user customization or a stale/older RTK version). Because auto-deleting it could destroy user edits, rtk bails and asks the user to remove the file manually.","triggerScenarios":"Running `rtk init` (Pi uninstall/removal flow) where the plugin file at plugin_path contains RTK-identifying content but a hash/content comparison against the stock extension fails.","commonSituations":"User edited the generated rtk.ts extension; rtk was upgraded and the old extension format no longer matches; a fork or pinned older rtk version wrote the file.","solutions":["Inspect the file, and if it is disposable or you saved your edits, delete it manually (`rm <path>`), then rerun `rtk init`.","Back up your customizations first (`cp <path> <path>.bak`) and then remove the file.","Re-generate the extension fresh with `rtk init` and reapply only the customizations you still need."],"exampleFix":"// before (shell)\nrtk init   # refuses: content does not match stock extension\n// after (shell)\ncp ~/.pi/extensions/rtk.ts ~/.pi/extensions/rtk.ts.bak && rm ~/.pi/extensions/rtk.ts && rtk init","handlingStrategy":"fallback","validationCode":"f=~/.pi/extensions/rtk.ts\nif [ -f \"$f\" ] && grep -q RTK \"$f\"; then\n  echo \"$f contains RTK content — back up or delete manually before rtk init\"\nfi","typeGuard":null,"tryCatchPattern":"rtk init || { cp <path> <path>.bak && rm <path> && rtk init; }","preventionTips":["Do not hand-edit generated extension files; keep customizations in a separate overlay.","Back up agent extension files before upgrading rtk.","Diff existing extension content against the freshly generated one after upgrades."],"tags":["uninstall","content-mismatch","manual-intervention","init"],"backgroundTag":"conflicting-config-options","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"}