{"record":{"id":"72ab100f850babef","repo":"rtk-ai/rtk","slug":"omp-extension-at-was-not-changed-remove-or-back-up-the-file","errorCode":null,"errorMessage":"OMP extension at {} was not changed; remove or back up the file manually before retrying.","messagePattern":"OMP extension at (.+?) was not changed; remove or back up the file manually before retrying\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/hooks/init.rs","lineNumber":4614,"sourceCode":"/// Install the shared Pi extension file for OMP with an explicit\n/// confirmation policy for an existing non-stock file.\npub fn run_omp_mode_with_patch_mode(\n    global: bool,\n    patch_mode: PatchMode,\n    ctx: InitContext,\n) -> Result<()> {\n    let InitContext { dry_run, .. } = ctx;\n    let path = omp_extension_path_for_scope(global)?;\n    let extension_was_present = path.exists();\n\n    warn_if_extension_shared_on_install(global, &path, PiCompatibleAgent::Omp)?;\n\n    if !validate_stock_pi_plugin_path(&path, \"OMP extension\", patch_mode, ctx)? {\n        if dry_run {\n            print_dry_run_footer();\n            return Ok(());\n        }\n        anyhow::bail!(\n            \"OMP extension at {} was not changed; remove or back up the file manually before retrying.\",\n            path.display()\n        );\n    }\n\n    if let Some(parent) = path.parent() {\n        ensure_pi_extensions_dir(\n            parent,\n            if global {\n                \"OMP extensions directory\"\n            } else {\n                \"local OMP extensions directory\"\n            },\n            ctx,\n        )?;\n    }\n\n    let installed =","sourceCodeStart":4596,"sourceCodeEnd":4632,"githubUrl":"https://github.com/rtk-ai/rtk/blob/0924356b4caba4989607227b7c8824d3d8098719/src/hooks/init.rs#L4596-L4632","documentation":"Same guard as the Pi flow but for the OMP extension install/patch path: if the existing OMP extension file fails `validate_stock_pi_plugin_path` (policy declined or only previewed) and this is not a dry run, rtk bails rather than overwriting an unvalidated file. The file must be removed or backed up manually before retrying.","triggerScenarios":"Running `rtk init` OMP install/patch mode where the target extension file exists, validation returns false (stock/unrecognized content declined by patch_mode), and dry_run is false.","commonSituations":"Scripted run without `--auto-patch`; user declined the prompt; a stock extension from another install occupies the OMP extension path.","solutions":["Rerun with `rtk init --auto-patch` to let rtk replace the existing OMP extension file.","Back up and remove the file manually (`mv <path> <path>.bak`), then rerun `rtk init`.","Preview first with `rtk init --auto-patch --dry-run` to see exactly what will change.","Point rtk at a different extension path if the current file must be preserved."],"exampleFix":"// before (shell)\nrtk init   # OMP extension not changed\n// after (shell)\nmv ~/.omp/extensions/rtk.ts ~/.omp/extensions/rtk.ts.bak && rtk init --auto-patch","handlingStrategy":"fallback","validationCode":"f=~/.omp/extensions/rtk.ts\nif [ -f \"$f\" ]; then echo \"$f exists — use --auto-patch or remove it before rtk init\"; fi","typeGuard":null,"tryCatchPattern":"rtk init || { mv <path> <path>.bak && rtk init --auto-patch; }","preventionTips":["Pass `--auto-patch` for OMP installs on machines with pre-existing extension files.","Back up the OMP extensions directory before running rtk init.","Use `--dry-run` to preview which files will be replaced."],"tags":["uninstall","approval-required","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"}