Skip to content

feat: add OMP (Oh My Pi) provider driver - #8582

Closed
FelipeMayerDev wants to merge 1 commit into
pingdotgg:mainfrom
FelipeMayerDev:feat-omp
Closed

feat: add OMP (Oh My Pi) provider driver#8582
FelipeMayerDev wants to merge 1 commit into
pingdotgg:mainfrom
FelipeMayerDev:feat-omp

Conversation

@FelipeMayerDev

@FelipeMayerDev FelipeMayerDev commented Aug 28, 2026

Copy link
Copy Markdown

Adds omp as a sixth built-in driver, driving the Oh My Pi CLI through its native ACP server (omp acp) via the shared AcpSessionRuntime — same pattern as the Cursor and Grok drivers.

What's included

  • contracts: OmpSettings (off by default, like Cursor/Grok/OpenCode), omp driver kind, display name
  • server: OmpDriver, OmpAdapter (ported from GrokAdapter), OmpProvider (ACP model discovery, --version probe), OmpAcpSupport (spawn omp acp, auth method agent), OmpTextGeneration; opt-in registration in serverSettings
  • web/mobile: OMP entry in the provider picker with a new OmpIcon
  • docs: install/providers/glossary/overview updated to six drivers
  • probe: OmpAcpCliProbe.test.ts integration check gated by T3_OMP_ACP_PROBE=1

Deliberately out of scope for v1

Usage/transcript reading, skills discovery, and xAI-style ask-user/plan extensions (OMP's ACP implementation doesn't declare them).

Testing

  • Workspace typecheck clean; provider test suite 809 passed (one expectation updated: built-in driver set 5→6)
  • T3_OMP_ACP_PROBE=1 probe passes against a real omp acp install: initialize, auth (agent), session/new

Note

Medium Risk
Large new provider adapter on the core turn/session path (child processes, ACP, approvals, stall detection), though it follows existing driver patterns and is off by default until enabled in settings.

Overview
Adds OMP (Oh My Pi) as a sixth built-in provider, wired like other ACP-based agents through omp acp and the shared AcpSessionRuntime.

Contracts & settings: New OmpSettings (disabled by default, configurable binaryPath and custom models), omp driver kind, and server-settings persistence/restoration aligned with Cursor, Grok, and OpenCode.

Server: OmpDriver bundles snapshot probing (omp --version, ACP model discovery), OmpAdapter (sessions, turns, ACP permission mapping, steer/in-flight prompt settlement, turn liveness watchdog, MCP hookup), OmpAcpSupport, and OmpTextGeneration for commit/PR/branch/title helpers. Registered in builtInDrivers and TextGenerationProvider.

Clients & docs: OmpIcon and provider metadata on web and mobile; install and internals docs updated to six drivers. Optional T3_OMP_ACP_PROBE=1 integration test against a real CLI.

Reviewed by Cursor Bugbot for commit 3b08d3c. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add OMP (Oh My Pi) provider driver with ACP session adapter and text generation

  • Introduces a full omp provider: driver registration, settings schema (OmpSettings with enabled, binaryPath, customModels), health probe via omp --version, and ACP-backed model discovery with reasoning effort support
  • Adds OmpAdapter.ts implementing session lifecycle, turn steering, permission approvals, cancellation, a liveness watchdog that auto-cancels stalled turns, and a PubSub event stream
  • Adds OmpTextGeneration.ts providing commit message, PR content, branch name, and thread title generation via OMP ACP with a 180s timeout and schema-validated JSON decoding
  • Updates web and mobile UIs with an OMP provider icon and settings panel; updates docs to list six built-in drivers
  • Behavioral Change: restoreUsedProviders in serverSettings.ts now auto-enables omp instances with undefined enabled that appear in provider history, and SQL history queries include 'omp' in their IN filter — existing deployments without OMP are unaffected since no history rows match
📊 Macroscope summarized 3b08d3c. 19 files reviewed, 4 issues evaluated, 0 issues filtered, 4 comments posted

🗂️ Filtered Issues

Adds omp as a sixth built-in driver, driving the Oh My Pi CLI through its
ACP server (omp acp) via the shared AcpSessionRuntime — same pattern as
the Cursor and Grok drivers.

- contracts: OmpSettings (off by default), omp driver kind + display name
- server: OmpDriver, OmpAdapter, OmpProvider, OmpAcpSupport,
  OmpTextGeneration; opt-in registration in serverSettings
- web/mobile: OMP entry in provider picker with OmpIcon
- docs: install/providers/glossary/overview updated to six drivers
- probe: OmpAcpCliProbe.test.ts gated by T3_OMP_ACP_PROBE=1

Skipped for v1: usage/transcript reading, skills discovery, and xAI-style
ask-user/plan extensions.
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8e2053f2-b280-4e47-8898-2068d254774c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Aug 28, 2026
ctx.notificationFiber = nf;
sessions.set(input.threadId, ctx);
yield* runTurnLivenessWatchdog(ctx).pipe(Effect.forkIn(ctx.scope), Effect.asVoid);
sessionScopeTransferred = true;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟠 High Layers/OmpAdapter.ts:1162

startSession can fail after registering ctx while leaving the ACP scope and fibers running. sessionScopeTransferred is set before the three startup events, so a failure in makeEventStamp() or event emission causes the enclosing finalizer to skip Scope.close(sessionScope). Move the assignment until after all startup events have succeeded, immediately before returning the session.

🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/server/src/provider/Layers/OmpAdapter.ts around line 1162:

`startSession` can fail after registering `ctx` while leaving the ACP scope and fibers running. `sessionScopeTransferred` is set before the three startup events, so a failure in `makeEventStamp()` or event emission causes the enclosing finalizer to skip `Scope.close(sessionScope)`. Move the assignment until after all startup events have succeeded, immediately before returning the session.

),
);
if (interruptedTurnId) {
ctx.interruptedTurnIds.add(interruptedTurnId);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Medium Layers/OmpAdapter.ts:1636

Cancelled and stalled turn IDs accumulate in ctx.interruptedTurnIds for the entire session, so repeated send/cancel cycles retain one UUID per turn and cause unbounded memory growth. Unlike normal completion, interruptTurn and the watchdog never remove these IDs; clean up an ID once all late prompt/event handling for that turn is finished.

🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/server/src/provider/Layers/OmpAdapter.ts around line 1636:

Cancelled and stalled turn IDs accumulate in `ctx.interruptedTurnIds` for the entire session, so repeated send/cancel cycles retain one UUID per turn and cause unbounded memory growth. Unlike normal completion, `interruptTurn` and the watchdog never remove these IDs; clean up an ID once all late prompt/event handling for that turn is finished.

Comment on lines +1145 to +1151
),
).pipe(
Effect.catch((cause) =>
Effect.logError("Failed to process OMP runtime notification.", { cause }),
),
// Fork into the session scope, not the calling fiber. `forkChild`
// makes this a child of `startSession`, and Effect interrupts a

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟠 High Layers/OmpAdapter.ts:1145

A failure while processing any single ACP event terminates the sole acp.getEvents() consumer, so the next sendTurn can hang forever in prepared.acp.drainEvents waiting for an EventStreamBarrier that is never acknowledged. Move the Effect.catch inside the per-event effect so one failed event is logged and skipped while the stream consumer remains alive.

-              }),
-            ),
-          ).pipe(
-            Effect.catch((cause) =>
-              Effect.logError("Failed to process OMP runtime notification.", { cause }),
-            ),
+              }).pipe(
+                Effect.catch((cause) =>
+                  Effect.logError("Failed to process OMP runtime notification.", { cause }),
+                ),
+              ),
+          ).pipe(
             // Fork into the session scope, not the calling fiber. `forkChild`
🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/server/src/provider/Layers/OmpAdapter.ts around lines 1145-1151:

A failure while processing any single ACP event terminates the sole `acp.getEvents()` consumer, so the next `sendTurn` can hang forever in `prepared.acp.drainEvents` waiting for an `EventStreamBarrier` that is never acknowledged. Move the `Effect.catch` inside the per-event effect so one failed event is logged and skipped while the stream consumer remains alive.

Semaphore.make(1).pipe(
Effect.map((semaphore) => {
const next = new Map(current);
next.set(threadId, semaphore);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Medium Layers/OmpAdapter.ts:312

threadLocksRef retains a semaphore for every historical thread, even after its session is stopped and removed from sessions, so long-lived adapters accumulate lock objects and memory grows with the total number of thread IDs. Remove the thread's semaphore during session teardown, while preserving synchronization with any in-flight lock users.

🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/server/src/provider/Layers/OmpAdapter.ts around line 312:

`threadLocksRef` retains a semaphore for every historical thread, even after its session is stopped and removed from `sessions`, so long-lived adapters accumulate lock objects and memory grows with the total number of thread IDs. Remove the thread's semaphore during session teardown, while preserving synchronization with any in-flight lock users.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3b08d3c. Configure here.

const CURSOR_DRIVER_KIND = ProviderDriverKind.make("cursor");
const GROK_DRIVER_KIND = ProviderDriverKind.make("grok");
const OPENCODE_DRIVER_KIND = ProviderDriverKind.make("opencode");
const OMP_DRIVER_KIND = ProviderDriverKind.make("omp");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

OMP falls back to Codex default model

High Severity

DEFAULT_MODEL_BY_PROVIDER has no omp entry, so the shared fallback resolves to Codex’s gpt-5.6-sol. Fresh OMP drafts and text generation therefore seed that slug, buildModelOptions synthesizes it as a custom model, and applyOmpAcpModelSelection calls setSessionModel with a Codex id instead of leaving OMP on the agent-reported current model.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3b08d3c. Configure here.

@macroscopeapp

macroscopeapp Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR introduces a large production OMP provider integration with ACP child-process sessions, permissions, MCP access, event streaming, liveness handling, and text generation rather than a small isolated option. Unresolved findings identify lifecycle leaks, possible event-stream hangs, and incorrect model fallback behavior, leaving material runtime risk for human review.

Not approved because:

  • 4 blocking correctness issues found at or above your repo's Minimum Blocking Severity

Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more.

@FelipeMayerDev

Copy link
Copy Markdown
Author

Superseded by #8583 (combined PR).

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

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant