-
Notifications
You must be signed in to change notification settings - Fork 10.2k
feat(integrations): add omp support #3107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
omar2535
wants to merge
7
commits into
github:main
Choose a base branch
from
omar2535:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+101
−5
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fecf133
feat(integrations): add omp support
omar2535 66e3fed
Update updated_at timestamp
omar2535 266fdaf
Merge branch 'main' into main
omar2535 f073742
Merge branch 'github:main' into main
omar2535 4459df3
refactor(integrations): delegate omp build_exec_args to base, registe…
omar2535 5d50ecb
fix(integrations): use --print + positional prompt for omp argv
omar2535 1558af8
Merge branch 'github:main' into main
omar2535 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,6 +85,7 @@ body: | |
| - Kiro CLI | ||
| - Lingma | ||
| - Mistral Vibe | ||
| - Oh My Pi | ||
| - opencode | ||
| - Pi Coding Agent | ||
| - Qoder CLI | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,6 +79,7 @@ body: | |
| - Kiro CLI | ||
| - Lingma | ||
| - Mistral Vibe | ||
| - Oh My Pi | ||
| - opencode | ||
| - Pi Coding Agent | ||
| - Qoder CLI | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| """Oh My Pi (omp) coding agent integration.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from ..base import MarkdownIntegration | ||
|
|
||
|
|
||
| class OmpIntegration(MarkdownIntegration): | ||
| key = "omp" | ||
| config = { | ||
| "name": "Oh My Pi", | ||
| "folder": ".omp/", | ||
| "commands_subdir": "commands", | ||
| "install_url": "https://www.npmjs.com/package/@oh-my-pi/pi-coding-agent", | ||
| "requires_cli": True, | ||
| } | ||
| registrar_config = { | ||
| "dir": ".omp/commands", | ||
| "format": "markdown", | ||
| "args": "$ARGUMENTS", | ||
| "extension": ".md", | ||
| } | ||
| context_file = "AGENTS.md" | ||
|
|
||
| def build_exec_args( | ||
| self, | ||
| prompt: str, | ||
| *, | ||
| model: str | None = None, | ||
| output_json: bool = True, | ||
| ) -> list[str] | None: | ||
| # Diverges from MarkdownIntegration.build_exec_args because OMP's | ||
| # CLI parser treats `-p`/`--print` as a boolean (one-shot mode) and | ||
| # consumes the prompt as a positional argument — see args.ts in | ||
| # can1357/oh-my-pi. JSON output is selected via `--mode json`. | ||
| if not self.config or not self.config.get("requires_cli"): | ||
| return None | ||
| args = [self._resolve_executable(), "--print"] | ||
| self._apply_extra_args_env_var(args) | ||
| if model: | ||
| args.extend(["--model", model]) | ||
| if output_json: | ||
| args.extend(["--mode", "json"]) | ||
| args.append(prompt) | ||
| return args |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| """Tests for OmpIntegration.""" | ||
|
|
||
| from specify_cli.integrations import get_integration | ||
|
|
||
| from .test_integration_base_markdown import MarkdownIntegrationTests | ||
|
|
||
|
|
||
| class TestOmpIntegration(MarkdownIntegrationTests): | ||
| KEY = "omp" | ||
| FOLDER = ".omp/" | ||
| COMMANDS_SUBDIR = "commands" | ||
| REGISTRAR_DIR = ".omp/commands" | ||
| CONTEXT_FILE = "AGENTS.md" | ||
|
|
||
| def test_build_exec_args_uses_omp_json_mode(self): | ||
| i = get_integration(self.KEY) | ||
|
|
||
| args = i.build_exec_args( | ||
| "/speckit.specify Build auth", | ||
| model="gpt-5", | ||
| ) | ||
|
|
||
| assert args == [ | ||
| "omp", | ||
| "--print", | ||
| "--model", | ||
| "gpt-5", | ||
| "--mode", | ||
| "json", | ||
| "/speckit.specify Build auth", | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,7 @@ | |
| "kiro-cli", | ||
| "lingma", | ||
| "vibe", | ||
| "omp", | ||
| "opencode", | ||
| "pi", | ||
| "qodercli", | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.