Skip to content

feat(source-control-ai): support OMP generation - #20624

Merged
nwparker merged 7 commits into
mainfrom
nwparker/omp-source-control-ai
Sep 19, 2026
Merged

nwparker merged 7 commits into
mainfrom
nwparker/omp-source-control-ai

Conversation

@nwparker

@nwparker nwparker commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 12 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​383 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​380
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​105 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​103

Fixes #15646. Follows up #15678 by @yzxcj797, credited as co-author.

OMP is now available for Source Control AI commit messages, PR descriptions and branch names, including when OMP is the default agent. Generation sends the prompt through stdin and requests text output without creating a session or loading tools, extensions, skills or rules. An empty model override uses OMP's configured model; an explicit provider/model remains supported.

ELI5: if you use OMP for coding, Orca can now use it to write the short descriptions of your changes too. It uses your usual OMP model unless you choose another one.

The existing generation planner handles local, Windows and remote execution. Model discovery uses the same OMP JSON parser as terminal model discovery. Tests cover large stdin input, default and explicit model arguments, Windows command parsing and all three Source Control AI operations.

Independently reviewed; review found and fixed a synthetic-default leak into terminal discovery. Final correction passes 56 focused tests, node/web typechecks and changed-code quality. Parent also checked the native-quality rules and reran the actual OMP argument-parser smoke.

Runtime proof: an actual installed OMP invocation received synthetic stdin and returned exactly fix: preserve OMP session titles with exit 0. A separate smoke using the read-only OMP source verifies real argument parsing for default/explicit models with zero model calls. No live SSH generation or native Windows generation was exercised.

Visual proof uses the production settings component, store and styles in hidden Electron. Actual menu selection and Save clicks verify empty arguments for the configured default and saved --model provider/exact-model. Persistence is in memory; this fixture does not invoke a generator or prove restart persistence. Full input values are asserted even where the screenshots clip long text. Rerun with ORCA_BACKGROUND_LAUNCH=1 node tests/tools/omp-source-control-ui/run.mjs.

OMP selected with configured default

Explicit model saved

@nwparker
nwparker marked this pull request as ready for review September 14, 2026 13:44
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 355307cc-e58f-4785-a8b4-0b1f27b9a4f4

📥 Commits

Reviewing files that changed from the base of the PR and between 93c3702 and bfe36ee.

📒 Files selected for processing (16)
  • src/main/text-generation/omp-model-discovery-policy.test.ts
  • src/renderer/src/components/settings/source-control-action-recipe-options.ts
  • src/shared/agent-model-probe-spec.test.ts
  • src/shared/agent-model-probe-spec.ts
  • src/shared/commit-message-agent-spec.test.ts
  • src/shared/commit-message-agent-spec.ts
  • src/shared/commit-message-omp.test.ts
  • src/shared/omp-model-list-probe.ts
  • src/shared/omp-source-control-discovery.test.ts
  • src/shared/source-control-ai-action-recipes.test.ts
  • tests/tools/omp-source-control-runtime-smoke.mjs
  • tests/tools/omp-source-control-ui/README.md
  • tests/tools/omp-source-control-ui/fixture.css
  • tests/tools/omp-source-control-ui/fixture.tsx
  • tests/tools/omp-source-control-ui/index.html
  • tests/tools/omp-source-control-ui/run.mjs

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The change adds OMP to Source Control AI. It defines non-interactive generation arguments, stdin prompt delivery, optional model and thinking flags, and JSON model discovery. OMP probe output hides the configuration-only default model while preserving discovered models. Source-control operations resolve OMP defaults and explicit provider-qualified models. Tests cover generation, discovery, host selection, runtime arguments, and the settings UI.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to bfe36

No actionable merge-blocking risk remains from the reviewed change.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 13 files. (3 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding OMP support for Source Control AI generation.
Description check ✅ Passed The description explains the change, motivation, linked issue, ELI5 summary, testing, runtime evidence, and visual proof. It is mostly complete, although it omits several template headings and checkli…
Linked Issues check ✅ Passed Issue #15646 requires OMP support for Source Control AI generation. COMMIT_MESSAGE_AGENT_SPECS now defines OMP with stdin prompt delivery, --print, text mode, and no-session, no-tools, no-extensio…
Out of Scope Changes check ✅ Passed The changes remain within Issue #15646. The UI updates expose the OMP agent and model placeholder required for configuration. The parser, runtime smoke test, unit tests, discovery tests, and UI fixtur…
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 13 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@pullfrog pullfrog 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.

Important

omp.buildArgs passes --no-extensions, which disables the OMP extension subsystem that can register the model provider being used, while discovery (omp models --json) does not pass the flag. A model can therefore be discoverable yet fail to resolve at generation — the failure mode Orca's Pi spec already guards against. Details inline.

Reviewed changes

  • OMP generation spec — omp is added to COMMIT_MESSAGE_AGENT_SPECS with stdin delivery, isolated --print/--no-* argv, dynamic discovery via omp models --json, and a default seed meaning "OMP's configured model".
  • Discovery parser — new parseOmpModelList maps OMP's {models:[{provider,id,selector,name}]} JSON to provider-qualified ids, preferring selector and falling back to provider/id.
  • Probe/generation split — getAgentModelProbeSpec('omp') strips the default sentinel from the generic discovery catalog while generation keeps it, so an unset selection still defers to OMP config.
  • Tests and fixtures — OMP spec and planner tests, local+SSH discovery-resolution tests, a hidden-Electron settings proof, and an argument-parser smoke script run against real OMP source.
  • Preserved surfaces — supported-agent text and the recipe CLI-args placeholder are updated for OMP.

ℹ️ Nitpicks

  • OMP is inserted first in COMMIT_MESSAGE_AGENT_SPECS, so the user-facing supported-agent list now reads "OMP, Claude, ..." and listCommitMessageAgentCapabilities() reorders. If first position isn't intentional, placing it with the other primaries keeps the list stable.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

'--print',
'--no-session',
'--no-tools',
'--no-extensions',

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.

--no-extensions disables OMP's ambient extension discovery, yet OMP extensions can register the model provider being used (pi.registerProvider). Because discovery sends omp models --json without that flag, a model can appear selectable and then fail to resolve when generation runs with --no-extensions — the same failure Orca's Pi spec avoids by deliberately omitting this flag (commit-message-plan.test.ts:5, pi-provider-runtime-smoke.mjs). The runtime smoke only proves the flag parses, not that a model call succeeds.

Technical details
# --no-extensions can disable the provider an OMP extension registered

## Affected sites
- src/shared/commit-message-agent-spec.ts:101 — generation argv includes `--no-extensions`
- src/shared/commit-message-agent-spec.ts:111 — discovery argv is `['models','--json']` and does NOT include it (inconsistent surface)
- src/shared/commit-message-agent-specs-primary.ts:196-207 — Pi spec omits it; commit-message-plan.test.ts:5 pins that
- tests/tools/omp-source-control-runtime-smoke.mjs:16 — asserts only `parsed.noExtensions`, no model call

## Evidence
- OMP is `can1357/oh-my-pi` (Pi fork). `docs/extension-loading.md`: `--no-extensions` excludes project `.omp/extensions`, user `~/.omp/agent/extensions`, settings `extensions:`, and installed plugin entries; only explicit `-e/--extension`/`--hook` still load.
- `docs/models.md` ("Extension provider registration"): extensions can register providers at runtime (`pi.registerProvider(...)`), including model append/replacement.
- `pi-provider-runtime-smoke.mjs`: Pi with `--no-extensions` -> 0 provider requests, non-zero exit; without it succeeds.

## Required outcome
- Either drop `--no-extensions` for OMP generation (matching Pi), or explicitly scope extension-registered providers out and make discovery consistent with generation.
- If generation keeps the flag, cover an extension-registered provider in a test so the limitation is intentional and pinned.

const bareId = 'id' in value && typeof value.id === 'string' ? value.id.trim() : ''
const selector =
'selector' in value && typeof value.selector === 'string' ? value.selector.trim() : ''
const id = selector || (provider && bareId ? `${provider}/${bareId}` : '')

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.

This is the shared OMP discovery parser, but the provider/id fallback here, the labelFromModelId fallback, and the noise-prefixed-JSON path in parseJsonObject have no coverage — the current tests only exercise the selector+name happy path. parseGrokModelList and parseClaudeModelList each have a dedicated *-model-list-probe.test.ts; an omp-model-list-probe.test.ts would pin these fallbacks before a real JSON shape change slips through.

@nwparker

Copy link
Copy Markdown
Contributor Author

Risk-reduction review at bfe36ee8da3b1b3fa9db0e0008b8550ca4f6bc47: Hold — provider/tool conflict.

Real OMP loopback test: original flags cannot find custom model; removing --no-extensions generates successfully, but independent provider+tool proof sends harmless_probe to the model despite --no-tools. Candidate archived and withdrawn; PR unchanged.

Remaining user-facing consequence: Current PR can fail on selectable custom models. Simply enabling extensions allows custom tools during commit-message generation. Needs a consistent supported provider/tool policy before merge.

@nwparker

Copy link
Copy Markdown
Contributor Author

Readiness review — not merge-ready yet

ELI5: this PR safely keeps OMP generation behind --no-extensions, but the experiments suggesting an extension-based tool guard are not a safe replacement. OMP extensions can re-add tools after the guard, custom providers can bypass the request hook, and some transports do not expose a uniform payload boundary. Removing --no-extensions would therefore create a model-visible/tool-executable capability leak.

The read-only OMP source review and loopback OpenAI/Anthropic probes found:

  • --no-tools disables built-in tools, not extension-registered tools.
  • Request hooks are order-dependent and later extensions can re-add schemas.
  • tool_call blocks execution only after schemas may already have reached the model.
  • Custom provider APIs and stream transports can bypass the hook.
  • SSH/WSL execution cannot use a client-local generated guard without host materialization.

Recommendation: keep the current restrictive flags until OMP provides a final, host-enforced tool policy applied after extensions across all transports. This is a security/capability boundary, so the PR should not be merged by weakening --no-extensions.

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.

Source Control AI fails for OMP users: 'Choose a supported Source Control AI agent' on every action (incl. first-work auto branch rename)

1 participant