Skip to content

Add oh-my-pi (omp) agent provider#500

Open
Git-on-my-level wants to merge 4 commits into
ymichael:mainfrom
Git-on-my-level:add-omp-provider
Open

Add oh-my-pi (omp) agent provider#500
Git-on-my-level wants to merge 4 commits into
ymichael:mainfrom
Git-on-my-level:add-omp-provider

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds omp (oh-my-pi) as a fourth built-in agent provider alongside codex, claude-code, and pi.

omp is a divergent fork of vanilla pi — different auth store (~/.omp/agent/agent.db, SQLite + multi-credential), Bun-first runtime with Rust native bindings, and its own RPC protocol. bb's existing "pi" provider bundles the pre-rename @mariozechner/pi-coding-agent@0.70.5, which cannot read omp's auth DB (verified: AuthStorage.hasAuth() returns false for every provider against a real omp install). Rather than migrate that dependency (broken at import time by omp's Bun-only APIs), this PR adds omp as a separate provider that drives the user-installed omp CLI over its RPC mode via a thin framing bridge — no omp SDK is bundled, so there is no version drift, and omp owns auth/models entirely.

image image

Changes

  • Provider registry (agent-providers): "omp" entry, full-only perms, pi-mirroring caps; AgentRuntimeOmpSkillRoot.
  • Adapter (omp/adapter.ts): bb JSON-RPC ↔ omp AgentSessionEvent translation — turn lifecycle + assistant text streaming. Unrecognized lifecycle/UI events are dropped silently (no timeline noise).
  • Bridge (omp/bridge/bridge.ts): JSON-RPC 2.0 ↔ omp {type:...} RPC framing; spawns the user's omp --mode rpc (no shell); answers omp extension_ui_request frames so turns don't block; resets child state on exit so the bridge recovers after an omp crash; preserves text alongside attachment input; surfaces prompt/steer dispatch failures instead of hanging.
  • UI: OmpIcon (pi glyph), provider-icon wiring, model picker groups by provider (groupModelOptionsByProvider) when a catalog spans 2+ provider/ prefixes.
  • Host-daemon: bridge bundle manifest entry.
  • Server/tests: catalog-driven (no source changes); + tests mirroring pi.
  • Docs: agent-runtime README, bb-guide template (+ regen), configuration.md (BB_OMP_BINARY).

Verified

  • All touched packages typecheck (agent-runtime, agent-providers, server, app, host-daemon, templates).
  • 211 unit tests pass across the touched suites (no regressions); 10 omp adapter tests.
  • Live end-to-end against omp 16.2.2: model/list returns the user's full catalog (157 models across cursor/openai-codex/xai-oauth/zai), and a full turn streams assistant text and completes cleanly (turn/completed, zero provider/unhandled).
  • Subagent review completed; all three reported bridge defects (attachment input loss, post-crash bridge deadlock, swallowed dispatch errors) addressed.

Test plan

  • bb provider models omp → lists the user's omp models grouped by provider.
  • bb thread spawn --provider omp --model <provider/model> ... → turn runs and completes.
  • omp must be installed and authenticated (omp then /login); override binary via BB_OMP_BINARY.

Known limitations (follow-ups)

  • Permission modes: full only (omp has no bb readonly/workspace-write analog).
  • Event coverage: core streaming + turn lifecycle; full parity with the pi adapter's translator (compaction/reasoning/token accounting, subagent materialization) is deferred.
  • Host-tool / host-URI callbacks into omp are a future enhancement.

Review update

  • Fixed OMP resume session identity so bb persists the actual OMP session file as providerThreadId while keeping forwarded events routed to the bb thread id.
  • Added a regression for the thread/resume command shape.

Additional validation

  • pnpm exec turbo run test --filter=@bb/agent-runtime
  • pnpm exec turbo run typecheck --filter=@bb/agent-runtime

Git-on-my-level and others added 3 commits July 4, 2026 16:39
Adds omp as a fourth built-in agent provider alongside codex, claude-code,
and pi. omp is a divergent fork of vanilla pi with its own auth store,
Bun-first runtime, and RPC protocol, so bb drives the user-installed omp CLI
over its RPC mode via a thin framing bridge — no omp SDK is bundled, so there
is no version drift and omp owns auth/models at ~/.omp/agent.

- Provider registry entry (full-only perms, pi-mirroring caps) + skill-root type
- omp adapter: bb JSON-RPC <-> omp AgentSessionEvent translation (turn lifecycle
  + assistant text streaming; long-tail events route to the unhandled fallback)
- omp bridge: JSON-RPC 2.0 <-> omp {type:...} RPC framing, spawns omp --mode rpc
- UI: OmpIcon (pi glyph), provider-icon wiring, model picker groups by provider
- Host-daemon bundle manifest, server tests, bb-guide template, configuration.md

Verified end-to-end against omp 16.2.2: model/list returns the user's full
catalog and a full turn streams assistant text through agent_end.
… keys

- Track per-thread omp sessions with switch_session/new_session and route
  events through the active thread instead of a single currentThreadId
- Respawn omp when cwd or spawn-time options change between threads
- Forward reasoning level, instructions, skill paths, and env vars to omp
- Use providerKey instead of providerLabel for React group keys in the model picker
@SawyerHood

Copy link
Copy Markdown
Collaborator

I'm all for adding more providers! Our Pi provider is pretty out of date right now (I don't think anyone uses it).

I think omp uses ACP so to simplify the surface area we could just support it via this. This is how our OpenCode integration works as well!

It isn't well documented now but you should actually be able to add omp to editor by just adding a line to the ~/.bb/config.json, ask your agent how to do this!

I think then we can make a config that auto detects if you have omp installed and auto configures it via acp (again look at how we handle open code)

@SawyerHood SawyerHood left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to use ACP as the connector please. Also in the future open an issue before opening a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants