rtk-ai/rtk · error

OMP extension at contains RTK content that does not match…

Error message

OMP extension at {} contains RTK content that does not match the stock extension. Remove the file manually.

What it means

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.

Solutions

  1. Inspect the file, back up any custom edits, then delete it manually (`rm <path>`) and rerun `rtk init`.
  2. Regenerate a fresh stock extension via `rtk init` and reapply only needed customizations.
  3. 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.

Example fix

// before (shell)
rtk init   # refuses: OMP content mismatch
// after (shell)
cp ~/.omp/extensions/rtk.ts ~/.omp/extensions/rtk.ts.bak && rm ~/.omp/extensions/rtk.ts && rtk init
Defensive patterns

Strategy: fallback

Validate before calling

f=~/.omp/extensions/rtk.ts
if [ -f "$f" ] && grep -q RTK "$f"; then
  echo "$f has RTK content — back up or delete manually before rtk init"
fi

Try / catch

rtk init || { cp <path> <path>.bak && rm <path> && rtk init; }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


AI-assisted analysis of rtk-ai/rtk@0924356b4c (2026-09-19). Data as JSON: /api/errors/9dd41f9528d0baf1. Report an issue: GitHub.

Appendix: source

Thrown at src/hooks/init.rs:4743

                .with_context(|| format!("Failed to remove OMP extension: {}", path.display()))?;
            remove_managed_agent_state(&ownership_state_path, ctx)?;
            if verbose > 0 {
                eprintln!("Removed OMP extension: {}", path.display());
            }
            println!("RTK uninstalled (OMP):");
            println!("  - Extension: {}", path.display());
            println!("\nRestart OMP to apply changes.");
        }
    } else if looks_like_rtk_pi_plugin(&content) {
        if dry_run {
            println!(
                "[dry-run] would refuse to remove OMP extension: {}",
                path.display()
            );
            print_dry_run_footer();
            return Ok(());
        }
        anyhow::bail!(
            "OMP extension at {} contains RTK content that does not match the stock extension. Remove the file manually.",
            path.display()
        );
    } else {
        println!(
            "OMP extension at {} is not RTK content; leaving it alone.",
            path.display()
        );
        if dry_run {
            print_dry_run_footer();
        }
    }

    Ok(())
}

// ─── Cursor Agent support ─────────────────────────────────────────────

View on GitHub (pinned to 0924356b4c)