feat: add full Oh My Pi (OMP) support — rebased, conflict-free

Closed
QI
3mo ago
+3397-242

This PR carries the complete work of #256 (Lynricsy's feat/omp-support) rebased onto current master with all 16 merge conflicts resolved, verified.

What #256 adds (unchanged)

  • CLI: setup --harness omp / doctor --harness omp (auto-detect, min-version check, disables native compaction + automatic memory, atomic config writes, --force repair)
  • doctor migrate --from opencode --to omp (OpenCode DB → Pi/OMP JSONL + Magic Context compartment re-home)
  • Pi-compatible extension with explicit OMP manifest ("omp": {"extensions": [...]}), optional Pi peers
  • Dashboard: OMP model/session discovery incl. named profiles, dedup across aliased roots
  • CI: real OMP Docker E2E lane

Rebase work (this PR)

  • Rebased 19 commits onto master — conflicts in packages/cli/package.json, packages/pi-plugin/package.json, packages/pi-plugin/src/subagent-runner.test.ts, packages/plugin/scripts/build-config-docs.ts, and 3 docs files resolved (kept master's 0.35.1 versions + merged OMP semantics; docs wording merged to cover all three harnesses)
  • Verification on Windows: workspace typecheck clean; CLI suite 296 pass / 10 skip / 22 fail — the identical 22 tests fail on the untouched pre-rebase PR head (sh-fixture/ComSpec/chmod environment artifacts; CI's Linux lane is the authoritative gate)
  • Greptile (5/5 safe-to-merge), cubic, Socket, and the author's own test claims all previously green

Closes #256's blocker (mergeable state was CONFLICTING). Can be merged or used to unblock #256.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Adds full Oh My Pi (OMP) support across the CLI, Pi/OMP extension, and dashboard with real Docker E2E coverage. Enables OpenCode → OMP migration and keeps one shared config and database across OpenCode, Pi, and OMP.

  • New Features

    • CLI: --harness omp for setup and doctor; disables OMP native compaction and automatic memory; atomic config writes; auto-detect updated; migration supports doctor migrate --from opencode --to omp.
    • Extension: @cortexkit/pi-magic-context runs on Pi and OMP; adds an OMP manifest ("omp": {"extensions": [...]}); translates provider/model refs for OMP; subagent runner handles OMP model resolution and paths.
    • Dashboard: discovers OMP models and sessions (profiles supported), merges with Pi, and deduplicates across aliased roots.
    • CI: adds a real OMP Docker E2E lane and focused unit tests for OMP CLI/paths/provider mapping.
  • Bug Fixes

    • Hardened OMP discovery and precedence (require executable evidence), normalized/trimmed env paths, and isolated host config boundaries; safer CLI/provider lookups.
    • Deduplicated multi-root sessions and improved session/model gating for OMP.
    • Cleanup: ignore agent logs and refine doctor/setup path handling.

Greptile Summary

Adds Oh My Pi support throughout Magic Context.

  • Adds OMP setup, doctor, detection, path resolution, and OpenCode migration support to the CLI.
  • Adds OMP model and session discovery to the dashboard.
  • Makes the Pi-compatible extension available to OMP and adds a real OMP Docker E2E lane.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains within the scope of the available follow-up review threads.

No blocking failure remains.

Important Files Changed

FilenameOverview
packages/cli/src/adapters/omp.tsImplements OMP detection, plugin registration, removal, cache inspection, and version discovery.
packages/cli/src/commands/setup-omp.tsIntegrates OMP host configuration and rollback behavior with the shared Pi-compatible setup flow.
packages/cli/src/commands/doctor-omp.tsAdds OMP-specific installation, configuration, conflict, path, and database diagnostics and repairs.
packages/cli/src/commands/migrate.tsExtends OpenCode session migration to write Pi-compatible JSONL sessions under the resolved OMP session root.
packages/dashboard/src-tauri/src/pi_sessions.rsExtends Pi-compatible session discovery to OMP roots and profiles with alias deduplication.
packages/pi-plugin/src/subagent-runner.tsAdapts Pi-compatible subagent execution and provider/model handling for OMP.
packages/plugin/src/shared/harness-provider-map.tsAdds OMP-aware provider and model reference translation.
.github/workflows/ci.ymlAdds a Docker-based OMP installation and session smoke-test job.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    CLI[Magic Context CLI] --> Detect[Detect OMP and resolve profile paths]
    Detect --> Setup[Install extension and configure OMP]
    Detect --> Doctor[Check and repair OMP integration]
    CLI --> Migration[Convert OpenCode sessions to OMP JSONL]
    Extension[Pi-compatible extension] --> OMP[Oh My Pi runtime]
    OMP --> Store[(Shared Magic Context database)]
    Migration --> Sessions[OMP session directory]
    Dashboard[Dashboard] --> Sessions
    Dashboard --> Store

Reviews (2): Last reviewed commit: "test(omp): 🧪 tighten smoke and local ru..." | Re-trigger Greptile