{"record":{"id":"9dd41f9528d0baf1","repo":"rtk-ai/rtk","slug":"omp-extension-at-contains-rtk-content-that-does-not-match","errorCode":null,"errorMessage":"OMP extension at {} contains RTK content that does not match the stock extension. Remove the file manually.","messagePattern":"OMP 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":4743,"sourceCode":"                .with_context(|| format!(\"Failed to remove OMP extension: {}\", path.display()))?;\n            remove_managed_agent_state(&ownership_state_path, ctx)?;\n            if verbose > 0 {\n                eprintln!(\"Removed OMP extension: {}\", path.display());\n            }\n            println!(\"RTK uninstalled (OMP):\");\n            println!(\"  - Extension: {}\", path.display());\n            println!(\"\\nRestart OMP to apply changes.\");\n        }\n    } else if looks_like_rtk_pi_plugin(&content) {\n        if dry_run {\n            println!(\n                \"[dry-run] would refuse to remove OMP extension: {}\",\n                path.display()\n            );\n            print_dry_run_footer();\n            return Ok(());\n        }\n        anyhow::bail!(\n            \"OMP extension at {} contains RTK content that does not match the stock extension. Remove the file manually.\",\n            path.display()\n        );\n    } else {\n        println!(\n            \"OMP extension at {} is not RTK content; leaving it alone.\",\n            path.display()\n        );\n        if dry_run {\n            print_dry_run_footer();\n        }\n    }\n\n    Ok(())\n}\n\n// ─── Cursor Agent support ─────────────────────────────────────────────\n","sourceCodeStart":4725,"sourceCodeEnd":4761,"githubUrl":"https://github.com/rtk-ai/rtk/blob/0924356b4caba4989607227b7c8824d3d8098719/src/hooks/init.rs#L4725-L4761","documentation":"OMPa analog of error 31: during OMP extension removal, rtk finds RTK content in the extension file but the content does not match the stock extension shipped with this version (user customization or older RTK output). To avoid destroying user edits, rtk refuses the auto-removal and bails, asking for manual deletion.","triggerScenarios":"Running `rtk init` OMP uninstall/removal flow where the file at path contains RTK markers but fails the content comparison against the stock OMP extension.","commonSituations":"User customized the generated OMP extension; rtk version upgraded so the old file no longer matches; extension written by a different rtk build or fork.","solutions":["Inspect the file, back up any custom edits, then delete it manually (`rm <path>`) and rerun `rtk init`.","Regenerate a fresh stock extension via `rtk init` and reapply only needed customizations.","If the customization is intentional, keep the file — rtk will leave non-matching content alone only if it is not RTK content; otherwise manual removal is required."],"exampleFix":"// before (shell)\nrtk init   # refuses: OMP content mismatch\n// after (shell)\ncp ~/.omp/extensions/rtk.ts ~/.omp/extensions/rtk.ts.bak && rm ~/.omp/extensions/rtk.ts && rtk init","handlingStrategy":"fallback","validationCode":"f=~/.omp/extensions/rtk.ts\nif [ -f \"$f\" ] && grep -q RTK \"$f\"; then\n  echo \"$f has 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":["Never hand-edit rtk-generated OMP extension files.","Re-diff extension content after every rtk upgrade.","Keep a pristine copy of the stock extension for comparison."],"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"}