Skip to content

feat(agents): add Oh My Pi (omp) agent#1132

Closed
jSydorowicz21 wants to merge 4 commits into
rcfrom
feat/omp-agent
Closed

feat(agents): add Oh My Pi (omp) agent#1132
jSydorowicz21 wants to merge 4 commits into
rcfrom
feat/omp-agent

Conversation

@jSydorowicz21

@jSydorowicz21 jSydorowicz21 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Oh My Pi (omp, package @oh-my-pi/pi-coding-agent) as a real, selectable BETA agent, registered in every spot gemini-cli is. It complements the existing pi agent (omp's predecessor, same protocol).

Changes

  • Spawns non-interactively as omp -p --mode json with --resume <id>, --model <fuzzy>, --cwd, and @image support (verified against omp --help, v16.x).
  • New custom OmpOutputParser for omp's JSON event stream (session / agent_start / message_update[text_delta, thinking_delta] / message_end[usage + cost] / agent_end / tool_execution_*), modeled on the sibling pi-output-parser. Registered in parser-factory and parsers/index.
  • OMP_ERROR_PATTERNS, capabilities (json/stream/resume/model/sessionId/usage/cost/thinking/image/batch), 200K context window, BETA badge, agent icon, NewInstanceModal entry, path discovery (~/.bun/bin/omp[.exe], npm, version managers), and README.

Output format provenance

The parser was written against a real captured omp -p --mode json sample (used inline as the parser test fixture), not inferred docs.

Verification

  • npm run lint (tsc x3): clean
  • vitest run: parser (fixture), parsers/index, definitions, capabilities, agentMetadata, agentIds, and agent-completeness: 177 tests pass
  • eslint + prettier: clean

Notes / deviations

  • No system-prompt arg is wired because the live AgentDefinition type has no field for it (trusted the code over the suggested arg); capability left false.
  • supportsReadOnlyMode is false: omp --help did not confirm a read-only/tools-allowlist flag. Easy to enable later.

Summary by CodeRabbit

  • New Features
    • Added Oh My Pi (beta) as a selectable AI coding agent, including icon/selection-list support, installation-path probing, model discovery, and support for JSONL streaming with session resume.
  • Bug Fixes
    • Improved output parsing (streamed text/thinking deltas, usage/cost, and final result/error handling with retry behavior).
    • Enhanced recoverable error detection for common omp failure scenarios.
  • Documentation
    • Updated README to include Oh My Pi (beta) in the supported-agent list.
  • Tests
    • Added/expanded coverage for the new agent’s capabilities, definitions, parsing, and discovery behavior.

Adds omp (Oh My Pi, @oh-my-pi/pi-coding-agent) as a real, selectable BETA agent registered everywhere gemini-cli is. Spawns non-interactively as 'omp -p --mode json' with --resume and --model; new custom OmpOutputParser handles omp's JSON event stream (session/message_update[text_delta]/message_end[usage+cost]/agent_end), modeled on the sibling Pi parser. Includes capabilities, error patterns, path discovery, NewInstanceModal entry, README, and tests (parser fixture, definitions, capabilities, metadata, ids); agent-completeness passes.
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds Oh My Pi (omp) support across shared agent metadata, runtime configuration, parser registration, error handling, UI exposure, documentation, and tests.

Changes

Oh My Pi agent support

Layer / File(s) Summary
Shared identity and UI exposure
src/shared/agentIds.ts, src/shared/agentMetadata.ts, src/shared/agentConstants.ts, src/renderer/constants/agentIcons.ts, src/renderer/components/NewInstanceModal/types.ts, README.md, src/__tests__/shared/agentIds.test.ts, src/__tests__/shared/agentMetadata.test.ts
Registers omp in shared ids, metadata, defaults, icons, supported-agent lists, documentation, and shared assertions.
Agent definition and probing
src/main/agents/capabilities.ts, src/main/agents/definitions.ts, src/main/agents/path-prober.ts, src/main/agents/detector.ts, src/__tests__/main/agents/capabilities.test.ts, src/__tests__/main/agents/definitions.test.ts, src/__tests__/main/agents/detector.test.ts
Adds omp capability flags, CLI definition, install-path probing, model discovery, and matching capability/definition tests.
Omp parser and registry
src/main/parsers/omp-output-parser.ts, src/main/parsers/error-patterns.ts, src/main/parsers/index.ts, src/main/parsers/parser-factory.ts, src/__tests__/main/parsers/index.test.ts, src/__tests__/main/parsers/omp-output-parser.test.ts
Adds OmpOutputParser, its error patterns, parser registration, and parser-focused tests.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • RunMaestro/Maestro#1005: Shares the same context-window fallback path that this PR extends with omp: 200000.
  • RunMaestro/Maestro#1032: Touches the same agent registry, parser registration, and shared metadata wiring patterns used here for omp.

Suggested labels

approved

Poem

A rabbit tapped the keys all night,
And omp came hopping into sight.
Parsers hummed and tests ran bright,
Owl-iconed paths felt just right.
🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding the Oh My Pi (omp) agent.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/omp-agent

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.

@greptile-apps

greptile-apps Bot commented Jun 26, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds Oh My Pi as a beta agent. The main changes are:

  • Agent registration, metadata, capabilities, icon, and selection UI.
  • OMP process arguments for JSON mode, resume, model selection, working directory, and images.
  • A JSON event-stream parser for OMP output, usage, cost, sessions, tools, thinking, and final results.
  • Parser registration, error patterns, path probing, README updates, and tests.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
src/main/parsers/omp-output-parser.ts Adds the OMP JSON event parser and avoids emitting an empty final result when the final transcript has no assistant message.
src/tests/main/parsers/omp-output-parser.test.ts Adds fixture-based parser coverage, including missing, empty, and user-only final transcript cases.
src/main/agents/definitions.ts Registers OMP with batch, JSON, resume, model, working directory, image, and configuration arguments.
src/main/agents/capabilities.ts Adds OMP capability metadata for streaming JSON output, sessions, resume, images, usage, cost, and thinking display.
src/main/parsers/index.ts Exports and registers the OMP parser with the parser registry.
src/main/parsers/parser-factory.ts Adds OMP parser construction to the parser factory.

Reviews (2): Last reviewed commit: "fix(agents): omp prompt-separator, tab-n..." | Re-trigger Greptile

Comment thread src/main/parsers/omp-output-parser.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/main/agents/definitions.ts (1)

438-447: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

model option type: 'select' contradicts the documented fuzzy free-form input.

The description advertises arbitrary fuzzy values (e.g. anthropic/claude-opus-4-8), and modelArgs/argBuilder accept any string, but a select control restricts users to the fixed options list. Users can't enter the very values the description suggests. Consider type: 'text' (as opencode does) to honor free-form fuzzy matching, or keep select only if the set is truly closed.

♻️ Option: use free-form text to match the description
 			{
 				key: 'model',
-				type: 'select' as const,
+				type: 'text' as const,
 				label: 'Model',
 				description:
 					'Fuzzy model selector passed to --model (for example, opus, sonnet, or anthropic/claude-opus-4-8). Leave empty for the CLI default.',
-				options: ['', 'opus', 'sonnet', 'haiku', 'gpt-5', 'gemini-2.5-pro'],
 				default: '',
 				argBuilder: (value: string) => (value && value.trim() ? ['--model', value.trim()] : []),
 			},
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/agents/definitions.ts` around lines 438 - 447, The `model` field in
`agents/definitions.ts` is configured as a closed `select`, which conflicts with
its free-form fuzzy model description and `argBuilder` behavior. Update the
`model` option definition to use a free-text input (matching the
`modelArgs`/`argBuilder` flexibility) so users can enter arbitrary model names
like the description examples, or otherwise tighten the description and accepted
values if you intend to keep `select`.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/main/parsers/omp-output-parser.ts`:
- Around line 233-253: detectErrorFromParsed is treating non-error events as
errors because extractErrorText can return messageText even when the event is
not flagged as an error. Update extractErrorText and/or detectErrorFromParsed in
OmpOutputParser so messageText is only used when event.isError is explicitly
true, or otherwise limit the fallback to error-specific fields. Keep the current
error matching flow with matchErrorPattern/getErrorPatterns, but ensure only
genuine error payloads produce an AgentError.
- Around line 98-105: The top-level error guard in omp-output-parser.ts is too
broad and is intercepting recoverable tool failures before the switch in
parseEvent. Update the early return around event.error /
event.message?.errorMessage so it does not treat tool_execution_end as a fatal
error, and let the tool_execution_end branch use event.isError and
toolState.status to classify failures correctly. Keep the fix localized to
parseEvent and the tool_execution_end handling logic.

---

Nitpick comments:
In `@src/main/agents/definitions.ts`:
- Around line 438-447: The `model` field in `agents/definitions.ts` is
configured as a closed `select`, which conflicts with its free-form fuzzy model
description and `argBuilder` behavior. Update the `model` option definition to
use a free-text input (matching the `modelArgs`/`argBuilder` flexibility) so
users can enter arbitrary model names like the description examples, or
otherwise tighten the description and accepted values if you intend to keep
`select`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 32ecbf5c-ac0e-4290-b40b-d6c8bf0163dd

📥 Commits

Reviewing files that changed from the base of the PR and between 9972eee and 19a6de1.

📒 Files selected for processing (19)
  • README.md
  • src/__tests__/main/agents/capabilities.test.ts
  • src/__tests__/main/agents/definitions.test.ts
  • src/__tests__/main/parsers/index.test.ts
  • src/__tests__/main/parsers/omp-output-parser.test.ts
  • src/__tests__/shared/agentIds.test.ts
  • src/__tests__/shared/agentMetadata.test.ts
  • src/main/agents/capabilities.ts
  • src/main/agents/definitions.ts
  • src/main/agents/path-prober.ts
  • src/main/parsers/error-patterns.ts
  • src/main/parsers/index.ts
  • src/main/parsers/omp-output-parser.ts
  • src/main/parsers/parser-factory.ts
  • src/renderer/components/NewInstanceModal/types.ts
  • src/renderer/constants/agentIcons.ts
  • src/shared/agentConstants.ts
  • src/shared/agentIds.ts
  • src/shared/agentMetadata.ts

Comment on lines +98 to +105
if (event.error || event.message?.errorMessage) {
return {
type: 'error',
text: this.extractErrorText(event),
sessionId,
raw: event,
};
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

cat -n src/main/parsers/omp-output-parser.ts | sed -n '90,110p'

Repository: RunMaestro/Maestro

Length of output: 785


🏁 Script executed:

cat -n src/main/parsers/omp-output-parser.ts | sed -n '180,210p'

Repository: RunMaestro/Maestro

Length of output: 1078


🏁 Script executed:

rg -n "tool_execution_end" src/main/parsers/omp-output-parser.ts -A 5 -B 5

Repository: RunMaestro/Maestro

Length of output: 459


🏁 Script executed:

rg -n "interface OmpRawEvent" src/main/parsers/omp-output-parser.ts -A 30

Repository: RunMaestro/Maestro

Length of output: 901


🏁 Script executed:

rg -n "error" src/main/parsers/omp-output-parser.ts | head -20

Repository: RunMaestro/Maestro

Length of output: 1041


🏁 Script executed:

cat -n src/main/parsers/omp-output-parser.ts | sed -n '95,125p'

Repository: RunMaestro/Maestro

Length of output: 1114


🏁 Script executed:

rg -n "\.error.*tool" src/main --type ts -i

Repository: RunMaestro/Maestro

Length of output: 272


🏁 Script executed:

rg -n "tool_execution_end" src/main --type ts -B 3 -A 3

Repository: RunMaestro/Maestro

Length of output: 992


🏁 Script executed:

cat -n src/main/parsers/pi-output-parser.ts | sed -n '170,185p'

Repository: RunMaestro/Maestro

Length of output: 589


🏁 Script executed:

rg -n "interface OmpRawEvent" src/main/parsers/pi-output-parser.ts -A 30

Repository: RunMaestro/Maestro

Length of output: 156


🏁 Script executed:

head -80 src/main/parsers/pi-output-parser.ts

Repository: RunMaestro/Maestro

Length of output: 1841


🏁 Script executed:

cat -n src/main/parsers/pi-output-parser.ts | sed -n '85,110p'

Repository: RunMaestro/Maestro

Length of output: 913


The global event.error check incorrectly intercepts recoverable tool failures.

The condition if (event.error || event.message?.errorMessage) at Lines 98-105 short-circuits execution before the switch statement. If a tool_execution_end event carries a top-level error field (even when intended only to signal a recoverable tool failure via toolState.status: 'failed'), it will be misclassified as a fatal agent error instead of a tool_use event.

The parser relies on event.isError within the tool_execution_end case (Lines 187-198) to determine failure status. Ensure the global error guard excludes tool_execution_end events, or verify that the upstream omp tool never sets a truthy error field on recoverable tool failures.

Problematic flow
  if (event.error || event.message?.errorMessage) {
-   // If event.type === 'tool_execution_end' but event.error is set,
-   // this returns 'error' here, skipping the switch below.
    return { type: 'error', ... };
  }

  switch (event.type) {
    case 'tool_execution_end':
-     // This code is unreachable if event.error is set,
-     // even if the intention was just to mark the tool as 'failed' (recoverable).
      return { type: 'tool_use', toolState: { status: event.isError ? 'failed' : ... } };
  }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/parsers/omp-output-parser.ts` around lines 98 - 105, The top-level
error guard in omp-output-parser.ts is too broad and is intercepting recoverable
tool failures before the switch in parseEvent. Update the early return around
event.error / event.message?.errorMessage so it does not treat
tool_execution_end as a fatal error, and let the tool_execution_end branch use
event.isError and toolState.status to classify failures correctly. Keep the fix
localized to parseEvent and the tool_execution_end handling logic.

Comment on lines +233 to +253
detectErrorFromParsed(parsed: unknown): AgentError | null {
if (!parsed || typeof parsed !== 'object') {
return null;
}

const event = parsed as OmpRawEvent;
const errorText = this.extractErrorText(event);
if (!errorText) {
return null;
}

const match = matchErrorPattern(getErrorPatterns(this.agentId), errorText, { minLength: 0 });
return {
type: match?.type || 'unknown',
message: match?.message || errorText,
recoverable: match?.recoverable ?? true,
agentId: this.agentId,
timestamp: Date.now(),
parsedJson: parsed,
};
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find any omp sample fixtures and inspect occurrences of messageText / error fields
fd -e jsonl -e json | xargs rg -l 'messageText' 2>/dev/null
rg -n 'messageText' --type=ts -C2 src/main/parsers/omp-output-parser.ts
rg -n 'messageText' --type=ts src/__tests__/main/parsers/omp-output-parser.test.ts

Repository: RunMaestro/Maestro

Length of output: 327


detectErrorFromParsed risks false-positive errors by treating any messageText as an error.

The extractErrorText function falls back to event.messageText || '' (line 335) without verifying event.isError. Consequently, detectErrorFromParsed classifies any event containing a messageText field as an unknown error (lines 240–252), regardless of whether the event is actually an error.

Ensure messageText is only treated as an error payload when event.isError is explicitly true, or restrict the fallback to fields specific to error events.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/parsers/omp-output-parser.ts` around lines 233 - 253,
detectErrorFromParsed is treating non-error events as errors because
extractErrorText can return messageText even when the event is not flagged as an
error. Update extractErrorText and/or detectErrorFromParsed in OmpOutputParser
so messageText is only used when event.isError is explicitly true, or otherwise
limit the fallback to error-specific fields. Keep the current error matching
flow with matchErrorPattern/getErrorPatterns, but ensure only genuine error
payloads produce an AgentError.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 19a6de1c47

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

modelArgs: (modelId: string) => ['--model', modelId],
workingDirArgs: (dir: string) => ['--cwd', dir],
imageArgs: (imagePath: string) => [`@${imagePath}`],
configOptions: [

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Disable OMP tools for tab naming

For OMP agents, tab naming currently launches with tools enabled because tabNaming.ts only appends a tool-disabling flag when agent.noToolsArgs is present, and this new definition omits it. I checked the OMP CLI parser and --no-tools is a recognized value-less launch flag, so task-like first messages can make the throwaway naming request run a real OMP agent with read/write/bash tools or time out instead of returning a short name. Add noToolsArgs: ['--no-tools'] here, matching the Pi integration.

Useful? React with 👍 / 👎.

Comment thread src/main/agents/definitions.ts Outdated
args: [],
batchModePrefix: ['-p'],
jsonOutputArgs: ['--mode', 'json'],
noPromptSeparator: true,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve flag-like prompts with the POSIX separator

With noPromptSeparator set, Maestro appends the user prompt directly after OMP's flags, so prompts that begin with -, --, or markdown front matter like --- are parsed by OMP as CLI options and can fail with unknown flags instead of reaching the model. I checked OMP's parser and it supports -- as the end-of-options marker, so this agent should use Maestro's default separator path rather than treating the prompt as an unguarded positional.

Useful? React with 👍 / 👎.

supportsGroupChatModeration: false,
usesJsonLineOutput: true,
usesCombinedContextWindow: false,
supportsAppendSystemPrompt: false,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use OMP's native append-system-prompt flag

OMP exposes --append-system-prompt, but this capability is set to false, so process:spawn falls back to prepending Maestro's system prompt into the first user message and then skips re-sending it on resumed turns. For OMP agents with nudge or custom system instructions, that makes the instructions part of the conversation transcript instead of system metadata and prevents updates from applying on subsequent resumes; mark this true so the existing spawn path passes OMP's native flag.

Useful? React with 👍 / 👎.

Comment thread src/main/agents/definitions.ts Outdated
configOptions: [
{
key: 'model',
type: 'select' as const,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Allow custom OMP model selectors

Using a fixed select here prevents users from entering OMP's normal fuzzy or provider-qualified model strings in the new-agent and edit-agent config panels, because AgentConfigPanel renders selects only from the declared options. This even makes the documented example anthropic/claude-opus-4-8 impossible to choose unless it is one of the hard-coded entries; use the text input pattern from Pi so any OMP-supported selector can be passed to --model.

Useful? React with 👍 / 👎.

*/
omp: {
supportsResume: true,
supportsReadOnlyMode: false,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Expose OMP's read-only tool allowlist

With supportsReadOnlyMode false, Maestro hides the Read-Only toggle for OMP even though OMP accepts a --tools allowlist like the Pi integration uses. Since OMP's default approval mode allows write and exec tools, users running OMP on untrusted prompts have no way to start a read-only turn from the UI; add read-only args such as a read/search tool allowlist and mark this capability true.

Useful? React with 👍 / 👎.

…(#omp)

Review fixes for the Oh My Pi agent: drop noPromptSeparator so omp uses Maestro's '--' end-of-options separator (verified omp supports it), protecting flag-like prompts while keeping @image args before the separator; add noToolsArgs ['--no-tools'] so tab-naming launches name-only (mirrors Pi); make OmpOutputParser fall back to assembled streamed text when agent_end has no/empty messages. Declined --append-system-prompt (Windows uses --append-system-prompt-file which omp lacks; cross-cutting) and model free-text (SELECT matches gemini/qwen convention); deferred read-only allowlist.
@jSydorowicz21

Copy link
Copy Markdown
Contributor Author

@greptile re-review please

@jSydorowicz21 jSydorowicz21 added the ready to merge This PR is ready to merge label Jun 26, 2026
…fixed dropdown

omp --model is fuzzy and multi-provider (opus, gpt-5.2, openai/gpt-5.2, ollama/..., 20+ providers). The hardcoded 6-item select (incl. stale gpt-5) couldn't represent that; switched to type:'text' matching its sibling pi/hermes/opencode/codex agents.
Adds an omp case to runModelDiscovery so the model combobox lists omp's full multi-provider catalog (provider-qualified selectors, de-duplicated). Without it the picker showed no models. Mirrors the OpenCode discovery pattern; parseJsonWithBom for robustness.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/main/agents/detector.ts`:
- Line 475: The model discovery call in detector.ts is running locally via
execFileNoThrow, so it ignores SSH remote execution when sshRemoteConfig.enabled
is set. Update the omp models --json path in the relevant discovery flow to use
wrapSpawnWithSsh() (or the existing SSH-aware spawn helper used for agent
processes) so it queries the remote agent instead of the local machine, and make
sure it fails loudly if SSH is enabled but the remote cannot be resolved.
- Around line 489-493: The parse failure branch in detector.ts only logs and
returns an empty list, so explicit malformed omp models --json errors are not
reported to Sentry. In the catch block around the JSON parse in the relevant
detector helper, keep the existing warn log but also call captureException()
from src/utils/sentry.ts with the parseError and add enough context (for example
the omp models --json operation and LOG_CONTEXT) so handled failures are visible
in Sentry before returning [].
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: da9f3198-1a70-47b3-b72c-83ac8902ce85

📥 Commits

Reviewing files that changed from the base of the PR and between 6907aee and 9cc36d2.

📒 Files selected for processing (2)
  • src/__tests__/main/agents/detector.test.ts
  • src/main/agents/detector.ts

// Oh My Pi: `omp models --json` returns { models: [{ id, selector, ... }] }
// across every configured provider. Prefer the provider-qualified `selector`
// (e.g. anthropic/claude-opus-4-8), which is unambiguous for --model.
const result = await execFileNoThrow(command, ['models', '--json'], undefined, env);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Make omp model discovery SSH-aware.

This new spawn path runs omp models --json locally only. When omp is configured with sshRemoteConfig.enabled, discovery will query the wrong machine and the model picker can come back empty/stale even though the remote agent is available.

As per coding guidelines, src/main/**/*.{ts,js} features that spawn agent processes must “support SSH remote execution… use wrapSpawnWithSsh()… and fail loudly if SSH is enabled but the remote can't be resolved.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/agents/detector.ts` at line 475, The model discovery call in
detector.ts is running locally via execFileNoThrow, so it ignores SSH remote
execution when sshRemoteConfig.enabled is set. Update the omp models --json path
in the relevant discovery flow to use wrapSpawnWithSsh() (or the existing
SSH-aware spawn helper used for agent processes) so it queries the remote agent
instead of the local machine, and make sure it fails loudly if SSH is enabled
but the remote cannot be resolved.

Source: Coding guidelines

Comment on lines +489 to +493
} catch (parseError) {
logger.warn('Failed to parse omp models --json output', LOG_CONTEXT, {
error: parseError,
});
return [];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Report handled parse failures to Sentry too.

This branch handles malformed omp models --json output explicitly, so the outer catch never sees it. Right now that means we silently downgrade to [] with only a log line, which makes field failures hard to diagnose.

Suggested change
 					} catch (parseError) {
 						logger.warn('Failed to parse omp models --json output', LOG_CONTEXT, {
 							error: parseError,
 						});
+						captureException(parseError, {
+							operation: 'agent:modelDiscovery',
+							agentId,
+							command: 'omp models --json',
+						});
 						return [];
 					}

As per coding guidelines, src/**/*.{ts,tsx,js,jsx} should “Use captureException() and captureMessage() from src/utils/sentry.ts for explicit error reporting with context.”

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
} catch (parseError) {
logger.warn('Failed to parse omp models --json output', LOG_CONTEXT, {
error: parseError,
});
return [];
} catch (parseError) {
logger.warn('Failed to parse omp models --json output', LOG_CONTEXT, {
error: parseError,
});
captureException(parseError, {
operation: 'agent:modelDiscovery',
agentId,
command: 'omp models --json',
});
return [];
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/agents/detector.ts` around lines 489 - 493, The parse failure branch
in detector.ts only logs and returns an empty list, so explicit malformed omp
models --json errors are not reported to Sentry. In the catch block around the
JSON parse in the relevant detector helper, keep the existing warn log but also
call captureException() from src/utils/sentry.ts with the parseError and add
enough context (for example the omp models --json operation and LOG_CONTEXT) so
handled failures are visible in Sentry before returning [].

Source: Coding guidelines

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9cc36d288e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


private extractErrorText(event: OmpRawEvent): string {
if (event.message?.errorMessage) {
return event.message.errorMessage;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Handle OMP's top-level errorMessage

When OMP finishes a failed turn it can put the failure on the event itself as errorMessage, for example on agent_end, but this extractor never reads that field. The stdout path calls detectErrorFromParsed before normal parsing, so those frames fall through as system/result events and the UI or CLI can report a successful or empty response instead of the provider error. Add errorMessage?: string to OmpRawEvent and check it here before looking at nested messages.

Useful? React with 👍 / 👎.

requiresPromptToStart: true,
supportsStreaming: true,
supportsResultMessages: true,
supportsModelSelection: true,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add OMP-specific SSH model discovery

I checked discoverModelsRemote in src/main/ipc/handlers/agents.ts: once this capability is true, SSH model refreshes run the generic omp models command and split stdout by line. OMP documents that models prints provider-grouped tables, not one selector per line, so SSH sessions can populate the dropdown with headers or table rows; choosing one saves that row and later passes it to --model. Add an OMP-specific remote discovery path that requests and parses JSON selectors, or disable remote model suggestions for OMP.

Useful? React with 👍 / 👎.

@jSydorowicz21

Copy link
Copy Markdown
Contributor Author

Superseded by #1138, which bundles Qwen Coder (qwen3-coder) and Oh My Pi (omp) into a single PR. The two agents edit the same shared registry files (parser registry, agent metadata/constants, error patterns, supported-agents list, parser-count test), so they cannot merge independently without conflicts; #1138 resolves that union once. Closing in favor of #1138.

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

Labels

ready to merge This PR is ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant