Repository navigation
feat(source-control-ai): support OMP generation - #20624
Conversation
Read prompts on stdin, retain OMP configured model by default, and reuse JSON model discovery. Co-authored-by: unknown <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (16)
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe 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 Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk remains from the reviewed change. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation 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.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
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 —
ompis added toCOMMIT_MESSAGE_AGENT_SPECSwith stdin delivery, isolated--print/--no-*argv, dynamic discovery viaomp models --json, and adefaultseed meaning "OMP's configured model". - Discovery parser — new
parseOmpModelListmaps OMP's{models:[{provider,id,selector,name}]}JSON to provider-qualified ids, preferringselectorand falling back toprovider/id. - Probe/generation split —
getAgentModelProbeSpec('omp')strips thedefaultsentinel 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, ..." andlistCommitMessageAgentCapabilities()reorders. If first position isn't intentional, placing it with the other primaries keeps the list stable.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| '--print', | ||
| '--no-session', | ||
| '--no-tools', | ||
| '--no-extensions', |
There was a problem hiding this comment.
--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}` : '') |
There was a problem hiding this comment.
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.
|
Risk-reduction review at 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. |
Readiness review — not merge-ready yetELI5: this PR safely keeps OMP generation behind The read-only OMP source review and loopback OpenAI/Anthropic probes found:
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 |

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 titleswith 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 withORCA_BACKGROUND_LAUNCH=1 node tests/tools/omp-source-control-ui/run.mjs.