feat(desktop): first-class Oh My Pi (OMP) support — registration + model/plan controls
What
Combines two community PRs into one branch that gives Oh My Pi (OMP) first-class support in Superset, plus two gap fixes found during verification:
- #5375 (@werkamsus, Nick Raziborsky): first-class OMP registration — builtin/default terminal preset,
agent-wrappers-ompextension writer,omp-extensionlifecycle-hook template, preset icon, and agent-setup targets. - #6804 (@monoclonalAb, Eric Zheng): OMP model/plan/effort launch controls —
resolveAgentLaunchPresetIdvirtualompresolution from the executable (kept off legacypi),--model/--thinking/--plan-yoloargv support, and the New Workspace UI mode preference.
Both PRs were deep-verified working individually before combining. They touch disjoint files; the only conflicts were #5375's staleness against main's agent-setup package refactor.
Conflict resolution (#5375 vs main)
Main moved agent setup from apps/desktop/src/main/lib/agent-setup/ into packages/agent-setup/ after #5375 was cut. Resolution was a union:
agent-wrappers-omp.tsandomp-extension.template.tsrelocated intopackages/agent-setup/(template now resolved viagetTemplatePath, matching pi).- OMP registered in
AGENT_SETUP_TARGETSandAGENT_SETUP_DEFINITIONS(the successors of the deleteddesktop-agent-capabilities.ts/desktop-agent-setup.ts). - README agent table, preset-icons index, and the default-v2-terminal-presets test resolved by keeping main's newer entries (kimi, grok, vibe, hermes, …) and adding OMP alongside them.
Gap fixes
- OMP teardown — pi gained
removePiExtensionin a refactor but OMP had no equivalent, so disabling OMP hooks left~/.omp/agent/extensions/superset-hooks.tson disk. AddedremoveOmpExtension(signature-gated, mirrors pi) and wired it as OMP's teardown inAGENT_SETUP_DEFINITIONS. Tests cover removal, no-op on absence, and preserving user-authored files. - Env-var collision — OMP honored
PI_CODING_AGENT_DIR(which pi itself no longer reads), soPI_CODING_AGENT_DIR=~/.pi/agentmade pi and OMP fight over onesuperset-hooks.ts. OMP now resolves its extension dir from its ownOMP_CODING_AGENT_DIR, defaulting to~/.omp/agent, and ignoresPI_CODING_AGENT_DIR. A test proves pi and OMP resolve to distinct trees even withPI_CODING_AGENT_DIRset.
Review nits folded in
- Executable lowercased before compare in
resolveAgentLaunchPresetId(from #6804, kept). - Test suite saves/restores
OMP_CODING_AGENT_DIRandPI_CODING_AGENT_DIRinstead of unconditionally deleting. alttext on the README OMP icon row (matches the table's descriptive-alt convention).EXTERNAL_FILES.mddocuments the full OMP lifecycle-hook set (session_start,agent_start,before_agent_start,tool_execution_end,agent_end,session_end,session_shutdown) and theOMP_CODING_AGENT_DIRoverride.
Skipped (scope): adding "omp"/"oh my pi" keywords to settings-search, and an OMP entry in the agent icon picker — neither PR touched those and OMP reuses the pi icon via presetId.
Verification
bun run typecheck— exit 0.bun run lint:fix(biome 2.4.2) — 6327 files checked, no fixes needed.packages/agent-setupfull suite: 263 pass / 0 fail (12 files) — includes agent-wrappers (67 pass) with the new OMP teardown + env-var tests.packages/sharedagent-models + agent-command + agent-settings: 80 pass / 0 fail.- host-service agent-configs + agents router: 63 pass / 0 fail.
- host-service workspace-creation + workspaces routers: 170 pass / 0 fail.
- desktop default-v2-terminal-presets: 4 pass / 0 fail.
Desktop app behavior for both PRs was already verified end-to-end upstream; this branch was validated statically + via unit tests.
Supersedes #5375 and #6804; closes #6801.
Co-authored with Eric Zheng (@monoclonalAb) and Nick Raziborsky (@werkamsus) — thank you both!
https://claude.ai/code/session_01YbC49AqamkRtURuMiepkqz
Summary by cubic
Adds first-class Oh My Pi (OMP) as a separate built-in terminal agent with model/effort/plan controls and a Superset-managed OMP lifecycle extension, so OMP no longer piggybacks on pi and the UI shows accurate working/completion state. Capabilities are resolved from the configured executable, and Superset Chat v3 gating remains unchanged.
- Adds built-in
omppreset (commandomp) to default terminal presets; keeps legacypi; reuses thepiicon. - Installs an OMP lifecycle extension at
~/.omp/agent/extensions/superset-hooks.ts(honorsOMP_CODING_AGENT_DIR); teardown removes only Superset-owned files. - Adds launch options:
--model,--thinking, and plan-first--plan-yolo; UI exposes model/effort/mode pickers and persists preferences per preset. - Validates mode/effort server-side and builds args/env only when supported; TRPC now accepts an optional
mode. - Resolves capabilities by executable via
resolveAgentLaunchPresetId, so OMP controls appear when the command resolves toomp(works with absolute paths or extra args); retains Chat v3 flag gating inuseV2AgentChoices.
Migration
- OMP now resolves its extension dir from
OMP_CODING_AGENT_DIRand ignoresPI_CODING_AGENT_DIR. - If you set
PI_CODING_AGENT_DIRfor OMP, setOMP_CODING_AGENT_DIRinstead.
Summary by CodeRabbit
-
New Features
- Added Oh My Pi as a supported built-in terminal agent with default setup and branding.
- Added model, effort, and “Plan first” mode options for Oh My Pi.
- Workspace creation now supports selecting and remembering agent modes per preset.
- Added lifecycle notifications for Oh My Pi sessions running in Superset terminals.
-
Documentation
- Documented Oh My Pi support and its lifecycle hook configuration files.