Skip to content

feat(integrations): add OMP client support - #1109

Merged
Wibias merged 7 commits into
lidge-jun:devfrom
n3wr1ch:feat/omp-integration
Aug 9, 2026
Merged

feat(integrations): add OMP client support#1109
Wibias merged 7 commits into
lidge-jun:devfrom
n3wr1ch:feat/omp-integration

Conversation

@n3wr1ch

@n3wr1ch n3wr1ch commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add OMP as a first-class file integration backed by ~/.omp/agent/models.yml
  • export the complete routed opencodex catalog in OMP's YAML provider schema, including non-GPT models and capability metadata
  • expose OMP in the GUI dashboard, management API, CLI help, localized copy, and integration documentation
  • keep OMP loopback-only and serialize only the existing non-secret opencodex-loopback placeholder

Dependency

The prerequisite Pi visibility fix has landed on dev via #1151. This branch is now rebased onto current dev; the inherited #1085 commits and the broader export-policy changes that were not part of OMP have been removed.

Overlap

#1109 was opened first and intentionally remained draft while the Pi prerequisite was unresolved. The overlapping #1140 was closed as a duplicate of this earlier PR. This update keeps #1109 focused on its original OMP contract without the former stacked diff.

Security review

This adds a credential destination and requires explicit maintainer security review. No user or provider secret is serialized: OMP receives the non-secret opencodex-loopback placeholder, and integration writes remain restricted to loopback proxy binds. Upstream provider credentials stay in opencodex's own configuration.

Verification

Verified after rebasing onto the latest dev at final head 0865270b:

  • bun run typecheck
  • final-head OMP path, export, writer, and integration suites — 123 pass, 0 fail
  • bun run test on final head — 10,101 pass, 7 skip, 0 fail
  • bun run privacy:scan
  • cd gui && bun test tests — 696 pass, 0 fail
  • final-head focused GUI integration suites — 30 pass, 0 fail
  • bun run lint:gui
  • cd gui && bun run lint:i18n
  • bun run build:gui
  • cd docs-site && bun run build
  • live OMP 17.2.11 verification — loaded all 16 routed GPT, Claude, Grok, Kimi, and GLM models
  • live prompt through opencodex/gpt-5.4-mini returned the requested OMP_OPENCODEX_OK response

Screenshots

The GUI exposes OMP as its own integration tab and reports the generated models.yml destination and restart guidance.

OMP integration tab

OMP 17.2.11 loads the complete routed opencodex catalog from the generated configuration.

OMP model catalog

A live English prompt sent with opencodex/gpt-5.4-mini receives the expected response through /v1/chat/completions.

OMP live prompt response

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults; explicit maintainer security review is requested above.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • All CI tests are green on my local testing.

  • I pushed my PR to the latest dev commit.

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

Summary by CodeRabbit

  • New Features
    • Added OMP as a supported integration with a dedicated GUI tab and localized labels.
    • Added OMP configuration export with YAML output, profile-aware paths, and loopback placeholders instead of real credentials.
    • Expanded configuration export support to seven file-based integrations.
  • UI Improvements
    • Renamed “Copy JSON” actions to clearer configuration-focused wording and added copy-failure messaging.
  • Documentation
    • Updated multilingual CLI, API, and integration documentation with expanded client support and credential guidance.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The change adds OMP as a supported file integration and export client. It adds profile-aware paths, YAML serialization, loopback credentials, GUI routing, localized labels, API coverage, tests, and documentation updates.

Changes

OMP integration

Layer / File(s) Summary
OMP export paths and serialization
src/clients/config-export.ts, src/integrations/writer.ts, src/cli/*, tests/client-config-export*, tests/cli-export-command.test.ts, tests/integrations-writer.test.ts
Adds OMP profile validation, path resolution, YAML export, loopback credentials, registry wiring, and export tests.
Integration registry and management response
src/integrations/registry.ts, tests/integrations-*, tests/management-client-config-route.test.ts
Registers OMP paths and validates OMP metadata, YAML content, model data, and placeholder credentials.
GUI routing, client lists, and localized labels
gui/src/app-routing.ts, gui/src/components/*, gui/src/pages/*, gui/src/i18n/*, gui/tests/*
Adds the OMP integration tab, file-client support, translated labels, restart semantics, and updated configuration-copy terminology.
CLI, API, and integration documentation
docs-site/src/content/docs/guides/integrations.md, docs-site/src/content/docs/*/reference/cli/agents.md, docs-site/src/content/docs/*/reference/management-api.md
Documents OMP exports, destinations, environment overrides, loopback placeholders, supported clients, and generalized client-configuration responses.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested reviewers: ingwannu, lidge-jun

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.77% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding first-class OMP integration support.
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 unit tests (beta)
  • Create PR with unit tests

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.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the enhancement New feature or request label Aug 6, 2026
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • review readiness checklist open (3/4 boxes ticked).

What to do

  • Tick all four boxes in the PR description once you're done (currently 3/4).

Review readiness checklist

  • ✅ All CI tests are green on my local testing.
  • ✅ I pushed my PR to the latest dev commit.
  • ✅ I resolved all correct Codex and CodeRabbit findings.
  • ⬜ My PR is ready for review.

3/4 boxes ticked.

This PR stays in draft until every box above is ticked.

@n3wr1ch
n3wr1ch force-pushed the feat/omp-integration branch from ca9183d to 6860b6c Compare August 7, 2026 04:04
@github-actions
github-actions Bot marked this pull request as ready for review August 7, 2026 04:05

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
docs-site/src/content/docs/ja/reference/cli/agents.md (1)

136-148: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Update the localized CLI output contract.

Both pages list seven clients in the command heading but still restrict the --client flag to opencode|pi. Both pages also state that --json produces JSON, although OMP, Hermes, and Gajae produce YAML, OpenClaw produces JSON5, and Kimi produces TOML.

  • docs-site/src/content/docs/ja/reference/cli/agents.md#L136-L148: List all seven client IDs. Replace JSON-only output wording with generated configuration bytes.
  • docs-site/src/content/docs/ko/reference/cli/agents.md#L142-L154: List all seven client IDs. Replace JSON-only output wording with generated configuration bytes.

As per path instructions, translated locale pages must not contradict the English source.

🤖 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 `@docs-site/src/content/docs/ja/reference/cli/agents.md` around lines 136 -
148, Update the CLI documentation in
docs-site/src/content/docs/ja/reference/cli/agents.md lines 136-148 and
docs-site/src/content/docs/ko/reference/cli/agents.md lines 142-154: change the
--client option to list all seven supported client IDs, and revise --json
wording to describe generated configuration bytes rather than JSON-only output,
matching the English source and accounting for each client’s format.

Source: Path instructions

docs-site/src/content/docs/ru/reference/cli/agents.md (1)

155-193: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

The localized CLI references retain the same client-list and output-format drift.

Both pages add OMP to the heading and examples but leave the client option and destination tables incomplete. Both also describe --json as JSON-only even though OMP emits YAML.

  • docs-site/src/content/docs/ru/reference/cli/agents.md#L155-L193: Update Line 167, add the four omitted client rows, and describe --json as native-format output.
  • docs-site/src/content/docs/zh-cn/reference/cli/agents.md#L129-L155: Update Line 137, add the four omitted client rows, and describe --json as native-format output.

As per path instructions, localized documentation must stay consistent with actual CLI and API behavior.

🤖 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 `@docs-site/src/content/docs/ru/reference/cli/agents.md` around lines 155 -
193, Update docs-site/src/content/docs/ru/reference/cli/agents.md lines 155-193
and docs-site/src/content/docs/zh-cn/reference/cli/agents.md lines 129-155
consistently: revise the client option description to include all supported
clients, add the four missing client rows to each destination table, and
describe --json as native-format output so OMP’s YAML is covered rather than
claiming JSON-only output.

Source: Path instructions

🤖 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 `@docs-site/src/content/docs/guides/integrations.md`:
- Around line 19-22: Update docs-site/src/content/docs/guides/integrations.md
lines 19-22 to include PI_PROFILE and document ompAgentDir() precedence:
OMP_PROFILE overrides PI_PROFILE; with an active profile, PI_CODING_AGENT_DIR is
ignored and PI_CONFIG_DIR supplies the profile root; without a profile,
PI_CODING_AGENT_DIR takes precedence. Apply the same precedence rule in
docs-site/src/content/docs/reference/cli/agents.md line 180, replacing the flat
variable list.

In `@tests/management-client-config-route.test.ts`:
- Around line 162-176: Extend the OMP test around clientConfigApi and
PiGeneratedConfig to assert the complete routed model catalog: a/m1, a/m2, and
b/no-context. Also verify the exported models preserve their capability and
reasoning metadata, including the expected modelContextWindows values, while
retaining the existing provider and API key assertions.
- Around line 162-176: Update the OMP test around clientConfigApi and the
body.config assertions to verify that neither body.text nor the serialized
body.config contains REAL_LOOKING_KEY. Keep the existing provider model and
placeholder API-key assertions unchanged.

---

Outside diff comments:
In `@docs-site/src/content/docs/ja/reference/cli/agents.md`:
- Around line 136-148: Update the CLI documentation in
docs-site/src/content/docs/ja/reference/cli/agents.md lines 136-148 and
docs-site/src/content/docs/ko/reference/cli/agents.md lines 142-154: change the
--client option to list all seven supported client IDs, and revise --json
wording to describe generated configuration bytes rather than JSON-only output,
matching the English source and accounting for each client’s format.

In `@docs-site/src/content/docs/ru/reference/cli/agents.md`:
- Around line 155-193: Update
docs-site/src/content/docs/ru/reference/cli/agents.md lines 155-193 and
docs-site/src/content/docs/zh-cn/reference/cli/agents.md lines 129-155
consistently: revise the client option description to include all supported
clients, add the four missing client rows to each destination table, and
describe --json as native-format output so OMP’s YAML is covered rather than
claiming JSON-only output.
🪄 Autofix

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: ASSERTIVE

Plan: Pro Plus

Run ID: cfc8af1a-b446-49d9-b51a-426e76c08cf9

📥 Commits

Reviewing files that changed from the base of the PR and between 1fc24f0 and 6860b6c.

⛔ Files ignored due to path filters (1)
  • devlog/_plan/260806_omp_integration/evidence/omp-dashboard.png is excluded by !**/*.png
📒 Files selected for processing (35)
  • docs-site/src/content/docs/guides/integrations.md
  • docs-site/src/content/docs/ja/reference/cli/agents.md
  • docs-site/src/content/docs/ja/reference/management-api.md
  • docs-site/src/content/docs/ko/reference/cli/agents.md
  • docs-site/src/content/docs/ko/reference/management-api.md
  • docs-site/src/content/docs/reference/cli/agents.md
  • docs-site/src/content/docs/reference/management-api.md
  • docs-site/src/content/docs/ru/reference/cli/agents.md
  • docs-site/src/content/docs/ru/reference/management-api.md
  • docs-site/src/content/docs/zh-cn/reference/cli/agents.md
  • docs-site/src/content/docs/zh-cn/reference/management-api.md
  • gui/src/app-routing.ts
  • gui/src/components/apikeys-workspace/client-config-clients.ts
  • gui/src/i18n/de.ts
  • gui/src/i18n/en.ts
  • gui/src/i18n/ja.ts
  • gui/src/i18n/ko.ts
  • gui/src/i18n/ru.ts
  • gui/src/i18n/zh.ts
  • gui/src/pages/Integrations.tsx
  • gui/src/pages/integrations/FileIntegrationPage.tsx
  • gui/src/pages/integrations/integration-api.ts
  • gui/src/pages/integrations/overview-clients.ts
  • gui/tests/client-config-panel.test.tsx
  • gui/tests/integrations-overview-rows.test.ts
  • src/cli/export-command.ts
  • src/cli/help.ts
  • src/clients/config-export.ts
  • src/integrations/registry.ts
  • tests/cli-export-command.test.ts
  • tests/client-config-export-new-clients.test.ts
  • tests/client-config-export.test.ts
  • tests/integrations-invariants.test.ts
  • tests/integrations-state.test.ts
  • tests/management-client-config-route.test.ts

Comment thread docs-site/src/content/docs/guides/integrations.md Outdated
Comment thread tests/management-client-config-route.test.ts

@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: 6860b6c4ac

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/clients/config-export.ts Outdated
Comment thread docs-site/src/content/docs/reference/cli/agents.md Outdated
Comment thread src/clients/config-export.ts Outdated
@github-actions
github-actions Bot marked this pull request as draft August 7, 2026 04:31

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

Actionable comments posted: 3

🤖 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 `@docs-site/src/content/docs/ja/reference/cli/agents.md`:
- Line 154: Synchronize the OMP destination metadata rows in
docs-site/src/content/docs/ja/reference/cli/agents.md:154-154,
docs-site/src/content/docs/ko/reference/cli/agents.md:160-160,
docs-site/src/content/docs/ru/reference/cli/agents.md:187-187, and
docs-site/src/content/docs/zh-cn/reference/cli/agents.md:155-155: mark
~/.omp/agent/models.yml as the default path, document OMP_PROFILE/PI_PROFILE
precedence, and replace the generic placeholder with the literal
opencodex-loopback value in each localized table.
- Around line 141-144: Update the localized export-output descriptions to
reflect that non-JSON output is generated client configuration or the selected
native format, rather than always JSON. In
docs-site/src/content/docs/ja/reference/cli/agents.md lines 141-144, revise the
adjacent Line 148 wording; apply the equivalent correction in
docs-site/src/content/docs/ko/reference/cli/agents.md lines 147-150 for Line
154, docs-site/src/content/docs/ru/reference/cli/agents.md lines 172-175 for
Lines 179-181, and docs-site/src/content/docs/zh-cn/reference/cli/agents.md
lines 142-145 for Line 149.

In `@tests/client-config-export.test.ts`:
- Around line 479-488: Make the test around EXPORT_CLIENTS.omp.destination
deterministic by isolating homedir() or mocking the filesystem check used by
ompModelsConfigPath, so the real test account cannot affect the selected
filename. Preserve separate assertions covering both canonical models.yml and
legacy models.yaml resolution.
🪄 Autofix

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: ASSERTIVE

Plan: Pro Plus

Run ID: cc38f932-0454-4ec6-a12e-105f1d85597c

📥 Commits

Reviewing files that changed from the base of the PR and between 6860b6c and e35bc9b.

📒 Files selected for processing (10)
  • docs-site/src/content/docs/guides/integrations.md
  • docs-site/src/content/docs/ja/reference/cli/agents.md
  • docs-site/src/content/docs/ko/reference/cli/agents.md
  • docs-site/src/content/docs/reference/cli/agents.md
  • docs-site/src/content/docs/ru/reference/cli/agents.md
  • docs-site/src/content/docs/zh-cn/reference/cli/agents.md
  • src/cli/export-command.ts
  • src/cli/help.ts
  • src/clients/config-export.ts
  • tests/client-config-export.test.ts

Comment thread docs-site/src/content/docs/ja/reference/cli/agents.md
Comment thread docs-site/src/content/docs/ja/reference/cli/agents.md Outdated
Comment thread tests/client-config-export.test.ts Outdated
@n3wr1ch
n3wr1ch force-pushed the feat/omp-integration branch from e35bc9b to 1370270 Compare August 7, 2026 12:18
@n3wr1ch
n3wr1ch marked this pull request as ready for review August 7, 2026 13:32
@github-actions
github-actions Bot marked this pull request as draft August 7, 2026 13:32

@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: 1370270476

ℹ️ 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".

Comment thread docs-site/src/content/docs/guides/integrations.md Outdated

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs-site/src/content/docs/guides/integrations.md (1)

83-88: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Do not state that OMP has no header slot.

OMP supports provider-level headers. This integration still does not emit remote x-opencodex-api-key wiring, so it remains loopback-only. Split OMP from clients whose schemas have no header field, and document the deferred remote-header limitation instead.

As per path instructions, OMP documentation must distinguish provider-adapter header behavior from client export and preserve the loopback-only limitation.

🤖 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 `@docs-site/src/content/docs/guides/integrations.md` around lines 83 - 88, The
integration guidance should distinguish OMP from Pi, Kimi Code, and Gajae Code:
do not claim OMP lacks a header slot. Update the OMP-specific wording to
acknowledge provider-level headers while stating that this integration does not
emit remote x-opencodex-api-key wiring, so OMP remains loopback-only; keep the
no-header-schema explanation only for the other clients.

Source: Path instructions

🤖 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 `@docs-site/src/content/docs/ja/reference/cli/agents.md`:
- Around line 128-130: Update the localized CLI introductions to describe the
actual native serialization contract: the selected client’s native format
contains a credential reference or the opencodex-loopback placeholder, as
applicable, rather than always an environment reference. Apply this wording to
docs-site/src/content/docs/ja/reference/cli/agents.md lines 128-130,
docs-site/src/content/docs/ko/reference/cli/agents.md lines 134-136, and
docs-site/src/content/docs/zh-cn/reference/cli/agents.md lines 129-131; update
docs-site/src/content/docs/ru/reference/cli/agents.md line 155 to mention native
format and loopback placeholders.

In `@src/clients/config-export.ts`:
- Around line 1006-1019: Update the filename value in EXPORT_CLIENTS.omp to
"models.yml" so downloaded OMP configurations match the canonical path selected
by ompModelsConfigPath. Keep the existing destination and loopback-only behavior
unchanged.

---

Outside diff comments:
In `@docs-site/src/content/docs/guides/integrations.md`:
- Around line 83-88: The integration guidance should distinguish OMP from Pi,
Kimi Code, and Gajae Code: do not claim OMP lacks a header slot. Update the
OMP-specific wording to acknowledge provider-level headers while stating that
this integration does not emit remote x-opencodex-api-key wiring, so OMP remains
loopback-only; keep the no-header-schema explanation only for the other clients.
🪄 Autofix

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: ASSERTIVE

Plan: Pro Plus

Run ID: 6b424375-3b85-44de-9851-84c63c7452d4

📥 Commits

Reviewing files that changed from the base of the PR and between e35bc9b and 1370270.

📒 Files selected for processing (16)
  • docs-site/src/content/docs/guides/integrations.md
  • docs-site/src/content/docs/ja/reference/cli/agents.md
  • docs-site/src/content/docs/ko/reference/cli/agents.md
  • docs-site/src/content/docs/reference/cli/agents.md
  • docs-site/src/content/docs/ru/reference/cli/agents.md
  • docs-site/src/content/docs/zh-cn/reference/cli/agents.md
  • gui/src/app-routing.ts
  • gui/src/i18n/de.ts
  • gui/src/i18n/en.ts
  • gui/src/i18n/ja.ts
  • gui/src/i18n/ko.ts
  • gui/src/i18n/ru.ts
  • gui/src/i18n/zh.ts
  • src/clients/config-export.ts
  • tests/client-config-export.test.ts
  • tests/management-client-config-route.test.ts

Comment thread docs-site/src/content/docs/ja/reference/cli/agents.md Outdated
Comment thread src/clients/config-export.ts
@n3wr1ch
n3wr1ch force-pushed the feat/omp-integration branch from 1370270 to 9d67776 Compare August 7, 2026 23:13
@Wibias

Wibias commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Is this ready? If yes I will please need some screenshots out of omp which shows that it is working. @n3wr1ch

@n3wr1ch
n3wr1ch force-pushed the feat/omp-integration branch from 9d67776 to f203792 Compare August 8, 2026 22:49
@n3wr1ch
n3wr1ch marked this pull request as ready for review August 8, 2026 22:55
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@n3wr1ch
n3wr1ch force-pushed the feat/omp-integration branch from f203792 to 195c885 Compare August 8, 2026 22:57
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

Wibias
Wibias previously requested changes Aug 8, 2026

@Wibias Wibias left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Verdict: REQUEST CHANGES

Reviewed current head 195c8853 against dev (243c3f4), including the full PR diff, OMP's current upstream path/model contracts, integration writer/rollback behaviour, credential handling, existing review threads, maintainer feedback, CI state, and the added live OMP evidence.

Blocking findings

P2 — PI_CONFIG_DIR resolution does not match OMP, so opencodex can manage the wrong file.

ompAgentDir() special-cases absolute and ~-prefixed PI_CONFIG_DIR values and treats them as absolute/expanded paths. OMP itself does not do that: upstream getConfigDirName() returns PI_CONFIG_DIR as the config-directory name and getBaseConfigRoot() always resolves it with path.join(os.homedir(), getConfigDirName()); OMP documents this value as relative to home. The PR therefore gives some environment values different filesystem meaning from the client it claims to follow. For example, an absolute or ~-prefixed value can make opencodex write/manage a different models.yml from the one OMP resolves. The new test currently locks this divergence in by using an absolute PI_CONFIG_DIR and expecting it to stay absolute.

Please mirror OMP's actual resolution semantics exactly, or explicitly reject forms opencodex will not mirror. Do not silently assign the same env value a different target path.

Relevant code: src/clients/config-export.ts (ompAgentDir) and tests/client-config-export.test.ts.

P2 — the non-loopback refusal message is factually wrong for OMP.

The shared applyIntegration() refusal says ${clientId} has nowhere to put the admission header ... and writing one by hand would not help either. That remains true for the genuinely headerless clients, but not for OMP. OMP supports provider-level headers; this PR intentionally defers managed remote x-opencodex-api-key wiring to keep the first integration loopback-only. The user-facing docs now describe that scope correctly, while the runtime error still tells OMP users that manual remote configuration is impossible.

Please make this message describe the generated integration policy, or make it client-specific. It must not claim OMP lacks a header capability it actually has.

Relevant code: src/integrations/writer.ts (applyIntegration).

CI / review gate

At the current head, both Cross-platform CI and React Doctor completed as action_required without running jobs. CodeRabbit is also processing the new head. Local validation and the live OMP screenshots are useful evidence, but they do not replace an executed green GitHub CI run. Please get the current-head checks to actually run and pass before merge.

The PR is also marked ready while the body still has My PR is ready for review unchecked. That is only hygiene, but it should be made consistent.

Security review

I did not find a new secret leak, auth bypass, path-traversal primitive, or unsafe overwrite path in the OMP changes. The generated OMP document uses the non-secret opencodex-loopback placeholder; the management regression checks that the real-looking upstream credential is absent from both text and structured config; integration writes retain the existing ownership/fingerprint/conflict protections. Existing-file snapshots can contain the user's own credentials, but they use the existing hardened 0600/Windows-ACL snapshot path and bounded retention design.

The deliberate loopback-only OMP scope is acceptable for this PR. The problem is the incorrect path contract and the misleading runtime explanation, not the decision to defer remote credential wiring.

Usefulness

The feature itself is worthwhile: OMP is wired through export, management API, managed integration state, GUI, localisation, docs, and focused tests, and the supplied OMP 17.2.11 catalog/prompt evidence materially improves confidence. After the two P2 issues are corrected and current-head CI is green, I would expect this to be in approvable shape.

@Wibias
Wibias marked this pull request as draft August 8, 2026 23:00

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

Actionable comments posted: 3

🤖 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 `@docs-site/src/content/docs/guides/integrations.md`:
- Line 13: Update the OMP row in the integrations table to name the literal
loopback placeholder as opencodex-loopback instead of the generic “loopback
placeholder” description. Keep this value clearly separate from upstream
provider credentials.

In `@docs-site/src/content/docs/ja/reference/cli/agents.md`:
- Line 166: Update the remote credential guidance in
docs-site/src/content/docs/ja/reference/cli/agents.md:166-166,
docs-site/src/content/docs/ko/reference/cli/agents.md:172-172,
docs-site/src/content/docs/ru/reference/cli/agents.md:206-209, and
docs-site/src/content/docs/zh-cn/reference/cli/agents.md:167-167 to list
OPENCODEX_HERMES_API_KEY and OPENCODEX_OPENCLAW_API_KEY alongside the existing
opencode variable for non-loopback proxies. Preserve the loopback-only guidance
for OMP, Pi, Kimi, and Gajae, matching the export contract in config-export.ts.

In `@tests/client-config-export.test.ts`:
- Around line 468-497: The test covering ompModelsConfigPath and
EXPORT_CLIENTS.omp.destination must also assert that PI_PROFILE is used when
OMP_PROFILE is undefined, producing the expected profile path. Add assertions
that unsafe profile values such as ".." and Windows-reserved names throw
ClientPathError, using ompModelsConfigPath directly and preserving the existing
explicit OMP_PROFILE precedence cases.
🪄 Autofix

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: ASSERTIVE

Plan: Pro Plus

Run ID: 4253cc9e-d251-4303-9107-ccd5a1300893

📥 Commits

Reviewing files that changed from the base of the PR and between 243c3f4 and 195c885.

⛔ Files ignored due to path filters (3)
  • devlog/_plan/260806_omp_integration/evidence/omp-dashboard.png is excluded by !**/*.png
  • devlog/_plan/260806_omp_integration/evidence/omp-live-prompt.png is excluded by !**/*.png
  • devlog/_plan/260806_omp_integration/evidence/omp-model-catalog.png is excluded by !**/*.png
📒 Files selected for processing (35)
  • docs-site/src/content/docs/guides/integrations.md
  • docs-site/src/content/docs/ja/reference/cli/agents.md
  • docs-site/src/content/docs/ja/reference/management-api.md
  • docs-site/src/content/docs/ko/reference/cli/agents.md
  • docs-site/src/content/docs/ko/reference/management-api.md
  • docs-site/src/content/docs/reference/cli/agents.md
  • docs-site/src/content/docs/reference/management-api.md
  • docs-site/src/content/docs/ru/reference/cli/agents.md
  • docs-site/src/content/docs/ru/reference/management-api.md
  • docs-site/src/content/docs/zh-cn/reference/cli/agents.md
  • docs-site/src/content/docs/zh-cn/reference/management-api.md
  • gui/src/app-routing.ts
  • gui/src/components/apikeys-workspace/client-config-clients.ts
  • gui/src/i18n/de.ts
  • gui/src/i18n/en.ts
  • gui/src/i18n/ja.ts
  • gui/src/i18n/ko.ts
  • gui/src/i18n/ru.ts
  • gui/src/i18n/zh.ts
  • gui/src/pages/Integrations.tsx
  • gui/src/pages/integrations/FileIntegrationPage.tsx
  • gui/src/pages/integrations/integration-api.ts
  • gui/src/pages/integrations/overview-clients.ts
  • gui/tests/client-config-panel.test.tsx
  • gui/tests/integrations-overview-rows.test.ts
  • src/cli/export-command.ts
  • src/cli/help.ts
  • src/clients/config-export.ts
  • src/integrations/registry.ts
  • tests/cli-export-command.test.ts
  • tests/client-config-export-new-clients.test.ts
  • tests/client-config-export.test.ts
  • tests/integrations-invariants.test.ts
  • tests/integrations-state.test.ts
  • tests/management-client-config-route.test.ts

Comment thread docs-site/src/content/docs/guides/integrations.md Outdated
Comment thread docs-site/src/content/docs/ja/reference/cli/agents.md Outdated
Comment thread tests/client-config-export.test.ts
@n3wr1ch

n3wr1ch commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the current-head review blockers in 0865270b:

  • OMP PI_CONFIG_DIR now mirrors OMP’s home-relative path.join semantics, with PI_PROFILE fallback and unsafe-profile regression coverage.
  • The non-loopback refusal now describes the generated integration policy without claiming manual OMP headers are impossible.
  • Updated the literal placeholder and remote-capable credential guidance across the directly affected docs/locales.

Final-head focused suites: 123 pass, typecheck and privacy scan pass, docs build passes. The fork workflow run is currently action_required; a maintainer must approve it before current-head CI can execute.

@n3wr1ch

n3wr1ch commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

Final-head full suite is now also green: 10,101 pass, 7 skip, 0 fail.

@Wibias
Wibias marked this pull request as ready for review August 8, 2026 23:55

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

Actionable comments posted: 1

🤖 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 `@tests/client-config-export.test.ts`:
- Around line 481-503: Extend the OMP path contract tests around
ompModelsConfigPath to cover PI_CONFIG_DIR values beginning with "/" and "~",
asserting they resolve via path.join(home, value) using the temporary home. Add
a profile-active case that sets PI_CODING_AGENT_DIR and verifies it is ignored,
with the profile-based models path unchanged.
🪄 Autofix

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: ASSERTIVE

Plan: Pro Plus

Run ID: 0991914b-903d-4e9d-9626-9862f8ef66c1

📥 Commits

Reviewing files that changed from the base of the PR and between 195c885 and 0865270.

📒 Files selected for processing (11)
  • docs-site/src/content/docs/guides/integrations.md
  • docs-site/src/content/docs/ja/reference/cli/agents.md
  • docs-site/src/content/docs/ko/reference/cli/agents.md
  • docs-site/src/content/docs/reference/cli/agents.md
  • docs-site/src/content/docs/ru/reference/cli/agents.md
  • docs-site/src/content/docs/zh-cn/reference/cli/agents.md
  • src/clients/config-export.ts
  • src/integrations/writer.ts
  • tests/client-config-export-new-clients.test.ts
  • tests/client-config-export.test.ts
  • tests/integrations-writer.test.ts

Comment on lines +481 to +503
const configDir = "custom-omp";
const configRoot = join(home, configDir);
const profiled = { OMP_PROFILE: "work", PI_CONFIG_DIR: configDir } as NodeJS.ProcessEnv;
expect(ompModelsConfigPath(profiled, home)).toBe(
join(configRoot, "profiles", "work", "agent", "models.yml"),
);
expect(ompModelsConfigPath({ PI_CONFIG_DIR: configDir } as NodeJS.ProcessEnv, home)).toBe(
join(configRoot, "agent", "models.yml"),
);
expect(ompModelsConfigPath({ PI_PROFILE: "legacy", PI_CONFIG_DIR: configDir } as NodeJS.ProcessEnv, home)).toBe(
join(configRoot, "profiles", "legacy", "agent", "models.yml"),
);
// OMP_PROFILE wins by presence, so an explicit blank selects the default
// profile instead of inheriting a legacy PI_PROFILE.
expect(ompModelsConfigPath({
OMP_PROFILE: " ",
PI_PROFILE: "legacy",
PI_CONFIG_DIR: configDir,
} as NodeJS.ProcessEnv, home)).toBe(
join(configRoot, "agent", "models.yml"),
);
expect(() => ompModelsConfigPath({ OMP_PROFILE: ".." } as NodeJS.ProcessEnv, home)).toThrow(ClientPathError);
expect(() => ompModelsConfigPath({ OMP_PROFILE: "NUL.txt" } as NodeJS.ProcessEnv, home)).toThrow(ClientPathError);

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.

📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add regression cases for the full OMP path contract.

The current cases use only PI_CONFIG_DIR = "custom-omp". They do not protect the new home-relative behavior for values beginning with / or ~. They also do not prove that PI_CODING_AGENT_DIR is ignored when a profile is active.

Add both cases with the temporary home:

Suggested assertions
       const profiled = {
         OMP_PROFILE: "work",
         PI_CONFIG_DIR: configDir,
+        PI_CODING_AGENT_DIR: join(home, "wrong-agent"),
       } as NodeJS.ProcessEnv;

+      for (const value of ["/custom-omp", "~/.custom-omp"]) {
+        expect(ompModelsConfigPath({ PI_CONFIG_DIR: value } as NodeJS.ProcessEnv, home)).toBe(
+          join(home, value, "agent", "models.yml"),
+        );
+      }

As per path instructions, tests/** should include focused regression coverage for behavior changes in src/**. The supplied OMP path contract requires these values to follow the path.join(home, value) behavior.

📝 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
const configDir = "custom-omp";
const configRoot = join(home, configDir);
const profiled = { OMP_PROFILE: "work", PI_CONFIG_DIR: configDir } as NodeJS.ProcessEnv;
expect(ompModelsConfigPath(profiled, home)).toBe(
join(configRoot, "profiles", "work", "agent", "models.yml"),
);
expect(ompModelsConfigPath({ PI_CONFIG_DIR: configDir } as NodeJS.ProcessEnv, home)).toBe(
join(configRoot, "agent", "models.yml"),
);
expect(ompModelsConfigPath({ PI_PROFILE: "legacy", PI_CONFIG_DIR: configDir } as NodeJS.ProcessEnv, home)).toBe(
join(configRoot, "profiles", "legacy", "agent", "models.yml"),
);
// OMP_PROFILE wins by presence, so an explicit blank selects the default
// profile instead of inheriting a legacy PI_PROFILE.
expect(ompModelsConfigPath({
OMP_PROFILE: " ",
PI_PROFILE: "legacy",
PI_CONFIG_DIR: configDir,
} as NodeJS.ProcessEnv, home)).toBe(
join(configRoot, "agent", "models.yml"),
);
expect(() => ompModelsConfigPath({ OMP_PROFILE: ".." } as NodeJS.ProcessEnv, home)).toThrow(ClientPathError);
expect(() => ompModelsConfigPath({ OMP_PROFILE: "NUL.txt" } as NodeJS.ProcessEnv, home)).toThrow(ClientPathError);
const configDir = "custom-omp";
const configRoot = join(home, configDir);
const profiled = {
OMP_PROFILE: "work",
PI_CONFIG_DIR: configDir,
PI_CODING_AGENT_DIR: join(home, "wrong-agent"),
} as NodeJS.ProcessEnv;
expect(ompModelsConfigPath(profiled, home)).toBe(
join(configRoot, "profiles", "work", "agent", "models.yml"),
);
for (const value of ["/custom-omp", "~/.custom-omp"]) {
expect(ompModelsConfigPath({ PI_CONFIG_DIR: value } as NodeJS.ProcessEnv, home)).toBe(
join(home, value, "agent", "models.yml"),
);
}
expect(ompModelsConfigPath({ PI_CONFIG_DIR: configDir } as NodeJS.ProcessEnv, home)).toBe(
join(configRoot, "agent", "models.yml"),
);
expect(ompModelsConfigPath({ PI_PROFILE: "legacy", PI_CONFIG_DIR: configDir } as NodeJS.ProcessEnv, home)).toBe(
join(configRoot, "profiles", "legacy", "agent", "models.yml"),
);
// OMP_PROFILE wins by presence, so an explicit blank selects the default
// profile instead of inheriting a legacy PI_PROFILE.
expect(ompModelsConfigPath({
OMP_PROFILE: " ",
PI_PROFILE: "legacy",
PI_CONFIG_DIR: configDir,
} as NodeJS.ProcessEnv, home)).toBe(
join(configRoot, "agent", "models.yml"),
);
expect(() => ompModelsConfigPath({ OMP_PROFILE: ".." } as NodeJS.ProcessEnv, home)).toThrow(ClientPathError);
expect(() => ompModelsConfigPath({ OMP_PROFILE: "NUL.txt" } as NodeJS.ProcessEnv, home)).toThrow(ClientPathError);
🤖 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 `@tests/client-config-export.test.ts` around lines 481 - 503, Extend the OMP
path contract tests around ompModelsConfigPath to cover PI_CONFIG_DIR values
beginning with "/" and "~", asserting they resolve via path.join(home, value)
using the temporary home. Add a profile-active case that sets
PI_CODING_AGENT_DIR and verifies it is ignored, with the profile-based models
path unchanged.

Source: Path instructions

@Wibias Wibias left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-review complete on current head 0865270b. The two prior P2 production blockers are fixed, the security review is clean, and the only remaining CodeRabbit item is a trivial regression-coverage gap. Because the GitHub integration cannot push into the contributor fork despite maintainer edits being enabled, I reproduced the exact #1109 head on maintainer PR #1323, added only the missing OMP path-contract regression cases, and ran the full Cross-platform CI + React Doctor matrix there. Both are green. Approving #1109; the test-only maintainer follow-up will be rebased onto post-merge dev and landed immediately after.

@Wibias
Wibias merged commit 637711b into lidge-jun:dev Aug 9, 2026
29 checks passed
Wibias added a commit that referenced this pull request Aug 9, 2026
test(omp): close final #1109 path-contract review gap

Wibias commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Thanks @n3wr1ch for the OMP integration and for working through the review rounds. #1109 is merged, and the final maintainer-only OMP path regression coverage has now also landed via #1323 with a fresh green Cross-platform CI + React Doctor run.

The live OMP verification, complete client/UI/docs wiring, and careful credential handling made this feature much easier to validate. Appreciate the thorough follow-through on the review feedback. 🙌

@n3wr1ch
n3wr1ch deleted the feat/omp-integration branch August 9, 2026 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants