Skip to content

chore: finalize OMP path regression coverage for #1109 - #1321

Closed
Wibias wants to merge 10 commits into
devfrom
maintainer/pr-1109-finalize
Closed

chore: finalize OMP path regression coverage for #1109#1321
Wibias wants to merge 10 commits into
devfrom
maintainer/pr-1109-finalize

Conversation

@Wibias

@Wibias Wibias commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Maintainer-only finalization branch for #1109.

This branch starts at #1109 head 0865270b and adds only the missing CodeRabbit regression coverage for the OMP path contract (60d2edc3). No production code changes are added here.

Purpose: run the repository CI against the exact #1109 tree plus the final test coverage before integrating it into dev.

Summary by CodeRabbit

  • New Features
    • Added Oh My Pi (OMP) as a supported integration in the app.
    • Added OMP configuration export in native YAML format.
    • Expanded client exports to support OMP, Hermes, OpenClaw, Kimi, and Gajae.
    • Added client-specific paths, profiles, filenames, and configuration examples.
  • Documentation
    • Updated integration, CLI, and API references across supported languages.
    • Clarified loopback-only behavior and remote configuration limitations.
  • UI Improvements
    • Added OMP integration navigation, labels, and localized translations.
    • Renamed “Copy JSON” actions to “Copy config.”

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change adds OMP as a loopback-only integration. It adds profile-aware YAML export, registry and GUI support, localized labels, CLI updates, documentation, and tests for paths, serialization, routing, and secret redaction.

Changes

OMP integration and export

Layer / File(s) Summary
OMP export and profile path resolution
src/clients/config-export.ts, src/cli/export-command.ts, src/cli/help.ts, tests/client-config-export.test.ts, tests/omp-path-contract.test.ts
Adds OMP profile precedence and validation, profile-specific paths, YAML serialization, omp-models.yaml destinations, loopback placeholders, and CLI output descriptions.
Integration registry and loopback enforcement
src/integrations/registry.ts, src/integrations/writer.ts, tests/integrations-*.test.ts, tests/management-client-config-route.test.ts
Registers OMP paths, enforces loopback-only behavior, updates client-count invariants, and tests YAML response metadata and secret redaction.
GUI integration and configuration actions
gui/src/app-routing.ts, gui/src/components/apikeys-workspace/*, gui/src/pages/Integrations.tsx, gui/src/pages/integrations/*, gui/src/i18n/*, gui/tests/*
Adds the OMP tab, file-integration mappings, localized labels and restart guidance, and generic configuration-copy actions.
CLI and translated documentation
docs-site/src/content/docs/**, src/cli/export-command.ts, src/cli/help.ts
Documents seven export clients, native formats, destinations, credential behavior, loopback restrictions, profile resolution, and generalized client configuration support.

Estimated code review effort: 4 (Complex) | ~45 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 identifies the OMP path regression-coverage work and references PR #1109, which is a stated objective of the changeset.
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 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch maintainer/pr-1109-finalize

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 added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Aug 9, 2026

@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/ru/reference/cli/agents.md`:
- Around line 206-211: Update the Russian agents documentation paragraph around
the generated integrations to remove Gajae from the loopback-placeholder and
loopback-only groups. Keep Gajae aligned with the documented
OPENCODEX_GAJAE_API_KEY environment reference and the English page, while
preserving the existing loopback behavior for Pi, OMP, and Kimi.

In `@docs-site/src/content/docs/zh-cn/reference/cli/agents.md`:
- Around line 151-167: 更新 Gajae 的中文凭据说明,使其与导出配置保持一致:保留 `OPENCODEX_GAJAE_API_KEY`
环境变量,并将 Gajae 从携带 `opencodex-loopback`
占位值且仅支持环回的客户端分组中移出,纳入环境变量引用客户端的说明;确保文档明确生成的 Gajae 配置不包含真实密钥。

In `@src/integrations/writer.ts`:
- Line 236: Update the localized non_loopback messages in the locale files’
corresponding translation entries so they describe the generated ${clientId}
integration as loopback-only and explain that loopback access must be provided
through a tunnel or local forwarder. Apply the same meaning consistently across
all listed locales, avoiding the outdated claim that the configuration has no
place for the admission header.
🪄 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: 347f623b-32a4-4df3-82c9-8277445624ba

📥 Commits

Reviewing files that changed from the base of the PR and between 243c3f4 and 60d2edc.

⛔ 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 (38)
  • 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
  • src/integrations/writer.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/integrations-writer.test.ts
  • tests/management-client-config-route.test.ts
  • tests/omp-path-contract.test.ts

Comment on lines +206 to +211
Никакой ключ никогда не сериализуется. Конфиги opencode, Hermes и OpenClaw несут только
env-reference, так что секрет остаётся в вашем окружении, а конфиги Pi, OMP, Kimi и Gajae несут
loopback-заглушку вместо учётных данных. Loopback-прокси (`127.0.0.1`, по умолчанию) вообще не
требует admission key. Если прокси слушает не на loopback, задайте соответствующую переменную
`OPENCODEX_OPENCODE_API_KEY`, `OPENCODEX_HERMES_API_KEY` или `OPENCODEX_OPENCLAW_API_KEY`.
Сгенерированные интеграции Pi, OMP, Kimi и Gajae работают только через loopback. Как выдаются

@coderabbitai coderabbitai Bot Aug 9, 2026

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Remove the contradictory Gajae loopback claim.

Line 191 documents OPENCODEX_GAJAE_API_KEY, but Lines 206-211 place Gajae in the loopback-placeholder and loopback-only groups. Users can omit the required environment variable and fail remote Gajae connections. Align these lines with the table and the English page.

Proposed correction
-... конфиги Pi, OMP, Kimi и Gajae несут loopback-заглушку вместо учётных данных.
+... конфиги Pi, OMP и Kimi несут loopback-заглушку вместо учётных данных; Gajae использует
+`OPENCODEX_GAJAE_API_KEY`.

-Сгенерированные интеграции Pi, OMP, Kimi и Gajae работают только через loopback.
+Сгенерированные интеграции Pi, OMP и Kimi работают только через loopback. Для удалённого
+Gajae используйте `OPENCODEX_GAJAE_API_KEY`.

As per path instructions, the translated locale page must not contradict the English source; docs-site/src/content/docs/reference/cli/agents.md documents the Gajae environment reference.

📝 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
Никакой ключ никогда не сериализуется. Конфиги opencode, Hermes и OpenClaw несут только
env-reference, так что секрет остаётся в вашем окружении, а конфиги Pi, OMP, Kimi и Gajae несут
loopback-заглушку вместо учётных данных. Loopback-прокси (`127.0.0.1`, по умолчанию) вообще не
требует admission key. Если прокси слушает не на loopback, задайте соответствующую переменную
`OPENCODEX_OPENCODE_API_KEY`, `OPENCODEX_HERMES_API_KEY` или `OPENCODEX_OPENCLAW_API_KEY`.
Сгенерированные интеграции Pi, OMP, Kimi и Gajae работают только через loopback. Как выдаются
Никакой ключ никогда не сериализуется. Конфиги opencode, Hermes и OpenClaw несут только
env-reference, так что секрет остаётся в вашем окружении, а конфиги Pi, OMP и Kimi несут
loopback-заглушку вместо учётных данных; Gajae использует
`OPENCODEX_GAJAE_API_KEY`.
Loopback-прокси (`127.0.0.1`, по умолчанию) вообще не
требует admission key. Если прокси слушает не на loopback, задайте соответствующую переменную
`OPENCODEX_OPENCODE_API_KEY`, `OPENCODEX_HERMES_API_KEY` или `OPENCODEX_OPENCLAW_API_KEY`.
Сгенерированные интеграции Pi, OMP и Kimi работают только через loopback. Для удалённого
Gajae используйте `OPENCODEX_GAJAE_API_KEY`.
Как выдаются
🤖 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 206 -
211, Update the Russian agents documentation paragraph around the generated
integrations to remove Gajae from the loopback-placeholder and loopback-only
groups. Keep Gajae aligned with the documented OPENCODEX_GAJAE_API_KEY
environment reference and the English page, while preserving the existing
loopback behavior for Pi, OMP, and Kimi.

Source: Path instructions

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The placeholder part of this finding is valid, but the remote-Gajae conclusion is not. EXPORT_CLIENTS.gajae.loopbackOnly is true: apiKeyEnv satisfies Gajae's own provider credential shape, but its strict schema cannot emit the dedicated x-opencodex-api-key admission header required by a non-loopback OpenCodex bind. Correct contract: Gajae belongs in the env-reference group and in the generated loopback-only group. Keep OPENCODEX_GAJAE_API_KEY out of the remote-bind instruction. Apply that correction consistently to ja/ko/ru/zh-cn.

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.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 5 \
  -e 'gajae' \
  -e 'loopbackOnly' \
  -e 'OPENCODEX_GAJAE_API_KEY' \
  src/clients/config-export.ts \
  src/integrations/writer.ts \
  docs-site/src/content/docs/reference/cli/agents.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/ru/reference/cli/agents.md \
  docs-site/src/content/docs/zh-cn/reference/cli/agents.md

Length of output: 35552


🏁 Script executed:

#!/bin/bash
set -euo pipefail

files=(
  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/ru/reference/cli/agents.md
  docs-site/src/content/docs/zh-cn/reference/cli/agents.md
)

# Each localized paragraph must retain Gajae in the environment-reference
# group and the generated loopback-only group.
rg -n -C 2 'Gajae|Gajae.*loopback|Gajae.*루프백|Gajae.*ループバック|Gajae.*环回' "${files[@]}"

# No localized remote-bind variable list may include Gajae's provider
# credential variable.
if rg -n -U 'OPENCODEX_OPENCODE_API_KEY[\s\S]{0,240}OPENCODEX_GAJAE_API_KEY' "${files[@]}"; then
  echo "Unexpected Gajae variable in a non-loopback instruction." >&2
  exit 1
fi

Length of output: 6314


@Wibias, the validation failed as expected. It confirms that the correction is still pending in all four localized pages.

The affected lines are:

  • docs-site/src/content/docs/ja/reference/cli/agents.md Line 166
  • docs-site/src/content/docs/ko/reference/cli/agents.md Line 172
  • docs-site/src/content/docs/ru/reference/cli/agents.md Lines 206-211
  • docs-site/src/content/docs/zh-cn/reference/cli/agents.md Line 167

Each paragraph must:

  1. Keep Gajae in the environment-reference group.
  2. Remove OPENCODEX_GAJAE_API_KEY from the non-loopback variable list.
  3. Include Gajae in the generated loopback-only group.

The validation script should pass after those four edits.


🧠 Learnings used
Learnt from: Wibias
Repo: lidge-jun/opencodex PR: 1012
File: docs-site/src/content/docs/reference/configuration/routing.md:153-164
Timestamp: 2026-08-05T03:26:52.240Z
Learning: For localized reference documentation pages under docs-site/src/content/docs, do not require same-PR translation when a newly added English section describes a feature omitted from older localized pages and does not contradict their existing behavior. Treat translation as follow-up work, but flag the change if the localized content states behavior that conflicts with the English source.

You are interacting with an AI system.

Comment on lines +151 to +167
| 客户端 | 规范目标路径 | 下载文件名 | 环境变量 |
| --- | --- | --- | --- |
| `opencode` | `~/.config/opencode/opencode.json`(设置了 `XDG_CONFIG_HOME` 时以其为准) | `opencode.json` | `OPENCODEX_OPENCODE_API_KEY` |
| `pi` | `~/.pi/agent/models.json` | `pi-models.json` | `OPENCODEX_API_KEY` |
| `pi` | `~/.pi/agent/models.json` | `pi-models.json` | 无 - 块中携带字面值 `opencodex-loopback` |
| `omp` | `~/.omp/agent/models.yml`(默认路径;即使为空,`OMP_PROFILE` 也优先于 `PI_PROFILE`) | `omp-models.yaml` | 无 - 字面值 `opencodex-loopback` |
| `hermes` | `~/.hermes/config.yaml` | `hermes-config.yaml` | `OPENCODEX_HERMES_API_KEY` |
| `openclaw` | `~/.openclaw/openclaw.json` | `openclaw.json5` | `OPENCODEX_OPENCLAW_API_KEY` |
| `kimi` | `~/.kimi-code/config.toml` | `kimi-config.toml` | 无 - loopback placeholder |
| `gajae` | `~/.gjc/agent/models.yml` | `gajae-models.yaml` | `OPENCODEX_GAJAE_API_KEY` |

这两个环境变量名称不同,而且每个客户端只会插入自己的那个。opencode 读取 `{env:OPENCODEX_OPENCODE_API_KEY}`Pi 读取 `$OPENCODEX_API_KEY`
opencode 会插值 `{env:OPENCODEX_OPENCODE_API_KEY}`。opencodex 生成的 Pi 导出不需要环境变量,而是携带字面占位值 `opencodex-loopback`。这个值是必需的:Pi 在构建模型列表时会解析 `apiKey`,如果已有配置包含未设置的环境变量引用,它就会隐藏整个 provider。回环上的代理从不校验生成的占位值

:::caution[合并,不要替换]
`ocx export` 从不写入你的真实客户端配置。该命令只会打印目标路径供你手动合并,而 `--out` 在没有 `--force` 的情况下拒绝覆盖已有文件,因为替换配置会破坏其中已有的其他 providers、agents 和 MCP 条目。
:::

任何密钥都不会被序列化。配置里只包含客户端的环境引用,因此密钥仍保留在你的环境中。环回代理(`127.0.0.1`,默认值)根本不需要准入密钥——该引用只是不会被使用。只有当代理绑定到环回地址之外时才设置该变量;关于准入密钥如何签发,请参见 [远程访问](/reference/configuration/#remote-access)。上游 providers 自身的密钥则完全是另一回事,需要按 [Providers](/guides/providers/) 单独配置。
任何密钥都不会被序列化。opencode、Hermes 和 OpenClaw 配置里只包含环境引用,因此密钥仍保留在你的环境中;Pi、OMP、Kimi 和 Gajae 配置里携带的是环回占位值而不是任何凭据。环回代理(`127.0.0.1`,默认值)根本不需要准入密钥。当代理绑定到环回地址之外时,请设置对应的 `OPENCODEX_OPENCODE_API_KEY`、`OPENCODEX_HERMES_API_KEY` 或 `OPENCODEX_OPENCLAW_API_KEY`。生成的 Pi、OMP、Kimi 和 Gajae 集成仅支持环回。关于准入密钥如何签发,请参见 [远程访问](/reference/configuration/#remote-access)。上游 providers 自身的密钥则完全是另一回事,需要按 [Providers](/guides/providers/) 单独配置。

@coderabbitai coderabbitai Bot Aug 9, 2026

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.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n -C 12 \
  'gajae:|GAJAE_API_KEY_ENV|buildGajaeClientConfig|OPENCODEX_GAJAE_API_KEY|opencodex-loopback' \
  src/clients/config-export.ts \
  tests/client-config-export.test.ts \
  tests/client-config-export-new-clients.test.ts

Repository: lidge-jun/opencodex

Length of output: 19389


Align the Gajae credential documentation with the exported config.

src/clients/config-export.ts emits providers.opencode.apiKeyEnv: OPENCODEX_GAJAE_API_KEY and includes that export hint in EXPORT_CLIENTS.gajae; tests/client-config-export-new-clients.test.ts asserts exported Gajae contains only apiKeyEnv and no apiKey. The Chinese docs later put Gajae in the opencodex-loopback group, so either split it out into the environment-backed clients or drop the source metadata/test assertion if the intended contract is the loopback placeholder.

🤖 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/zh-cn/reference/cli/agents.md` around lines 151 -
167, 更新 Gajae 的中文凭据说明,使其与导出配置保持一致:保留 `OPENCODEX_GAJAE_API_KEY` 环境变量,并将 Gajae 从携带
`opencodex-loopback` 占位值且仅支持环回的客户端分组中移出,纳入环境变量引用客户端的说明;确保文档明确生成的 Gajae
配置不包含真实密钥。

Source: Path instructions

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Same contract correction as the Russian thread: remove Gajae only from the opencodex-loopback placeholder group, not from the generated loopback-only group. Gajae references OPENCODEX_GAJAE_API_KEY, but loopbackOnly: true remains intentional because its schema cannot emit the dedicated remote admission header. Do not document the env var as enabling remote Gajae.

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.

@Wibias, understood. The corrected contract is:

  • Gajae exports apiKeyEnv: OPENCODEX_GAJAE_API_KEY.
  • Gajae does not export the literal opencodex-loopback credential placeholder.
  • Gajae remains loopbackOnly: true.
  • OPENCODEX_GAJAE_API_KEY does not enable remote Gajae use, because the generated schema cannot emit the required remote admission header.

The documentation correction must remove Gajae only from the placeholder-credential group. It must keep Gajae in the generated loopback-only group and must not list its environment variable as a remote-access configuration.


✏️ Learnings added
Learnt from: Wibias
Repo: lidge-jun/opencodex PR: 1321
File: docs-site/src/content/docs/zh-cn/reference/cli/agents.md:0-0
Timestamp: 2026-08-09T00:33:00.956Z
Learning: For the Gajae client integration in `src/clients/config-export.ts`, generated configuration references `OPENCODEX_GAJAE_API_KEY` through `apiKeyEnv` rather than using the literal `opencodex-loopback` credential placeholder. Gajae remains `loopbackOnly: true` because its schema cannot emit the dedicated remote admission header. Documentation must not state or imply that setting `OPENCODEX_GAJAE_API_KEY` enables remote Gajae access.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

You are interacting with an AI system.

if (isLoopbackOnly(clientId) && !isLoopbackHostname(input.config.hostname)) {
return refuse(clientId, "non_loopback", classified.state,
`${clientId} has nowhere to put the admission header a non-loopback bind requires, so a generated config would be rejected — and writing one by hand would not help either. Give it loopback access instead, through a tunnel or a local forwarder.`);
`The generated ${clientId} integration is loopback-only and does not emit the admission header a non-loopback bind requires. Give it loopback access instead, through a tunnel or a local forwarder.`);

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.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n -C 4 'describeRefusal|integrations\.error\.nonLoopback|non_loopback' \
  gui/src src tests

Repository: lidge-jun/opencodex

Length of output: 25516


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

# Inspect the GUI refusal formatter and exact locale wording around non_loopback.
cat -n gui/src/pages/integrations/refusal-copy.ts | sed -n '1,130p'
printf '\n--- affected integrations.error.nonLoopback locale entries ---\n'
for f in gui/src/i18n/en.ts gui/src/i18n/de.ts gui/src/i18n/ja.ts gui/src/i18n/ko.ts gui/src/i18n/zh.ts gui/src/i18n/ru.ts; do
  echo "--- $f ---"
  rg -n -C 2 '"integrations\.error\.nonLoopback"' "$f"
done
printf '\n--- server writer refusal implementation ---\n'
cat -n src/integrations/writer.ts | sed -n '200,245p'
cat -n src/integrations/writer.ts | sed -n '36,90p'
printf '\n--- client message extraction in API ---\n'
cat -n gui/src/pages/integrations/integration-api.ts | sed -n '1,180p'

Repository: lidge-jun/opencodex

Length of output: 19937


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path
import re

writer = Path("src/integrations/writer.ts").read_text()
message = re.search(r"`([^`]+generated \$\{clientId\} integration is loopback-only[^`]+)`", writer).group(1)
gui = Path("gui/src/pages/integrations/refusal-copy.ts").read_text()
localized_reasons = bool(re.search(r'LOCALIZED_REASONS.*Set\(\["non_loopback"\]', gui, re.S))
reason_key = bool(re.search(r'case|"non_loopback"\] return "integrations\.error\.nonLoopback"', gui))

for locale in ["en", "de", "ja", "ko", "zh", "ru"]:
    path = Path(f"gui/src/i18n/{locale}.ts")
    text = path.read_text()
    key = '"integrations.error.nonLoopback"'
    assert key in text, f"missing {key} in {path}"
    s = re.search(rf'{re.escape(key)}:\s*"([^"]+)"', text).group(1)
    matches_old = all(phrase in s for phrase in [
        "remote bind requires" if locale == "en" else "remote bind / Remote-Bindung / リモートバインド / 원격 바인드 / 远程绑定 / удалённой привязке",
        "header / Header / ヘッダー / 헤더 / 标头 / заголовок",
        "nowhere / kein Platz / 置く場所 / 자리가 / 位置 / негде",
        "hand / Hand / 手 / 직접 / 手动 / ручная"
    ])
    print(f"{locale}: old=false" if matches_old else f"{locale}: old=true")

print("localized_reasons:", localized_reasons)
print("reason_key", reason_key)
print("server_message", message)
PY

Repository: lidge-jun/opencodex

Length of output: 487


Update the localized non_loopback messages.

The server says the generated ${clientId} integration is loopback-only and does not emit the required admission header. describeRefusal replaces the server message for non_loopback, but gui/src/i18n/en.ts:1312, gui/src/i18n/de.ts:857, gui/src/i18n/ja.ts:1260, gui/src/i18n/ko.ts:881, gui/src/i18n/zh.ts:874, and gui/src/i18n/ru.ts:1302 still say the configuration has no place for the header. Update every locale so non-localizing copy is not sent to users.

🤖 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/integrations/writer.ts` at line 236, Update the localized non_loopback
messages in the locale files’ corresponding translation entries so they describe
the generated ${clientId} integration as loopback-only and explain that loopback
access must be provided through a tunnel or local forwarder. Apply the same
meaning consistently across all listed locales, avoiding the outdated claim that
the configuration has no place for the admission header.

Source: Path instructions

Wibias commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai autofix

Fix the three current review findings, with one important contract correction for the two Gajae docs findings: Gajae does use the OPENCODEX_GAJAE_API_KEY environment reference, so remove the false loopback-placeholder claim, but keep Gajae loopback-only. Its strict schema has no field for the dedicated x-opencodex-api-key admission header, and EXPORT_CLIENTS.gajae.loopbackOnly is intentionally true; do not document remote Gajae support. For non_loopback, update the localized GUI copy to say the generated integration is loopback-only / does not emit the required admission header and suggest a tunnel or local forwarder, without claiming the client schema itself has nowhere to put a header. Keep changes limited to these review findings.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Fixes Applied Successfully

Fixed 10 file(s) based on 3 unresolved review comments.

Files modified:

  • 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/ru/reference/cli/agents.md
  • docs-site/src/content/docs/zh-cn/reference/cli/agents.md
  • 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

Commit: eae6ff466fe061aa3615d6e88635f369e47cbdee

The changes have been pushed to the maintainer/pr-1109-finalize branch.

Time taken: 7m 55s

Fixed 10 file(s) based on 3 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>

Wibias commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai Your autofix commit eae6ff46 introduced a correctness regression in the translated Gajae docs. Please patch the current branch to correct it.

Authoritative contract: EXPORT_CLIENTS.gajae.apiKeyEnv = OPENCODEX_GAJAE_API_KEY, but EXPORT_CLIENTS.gajae.loopbackOnly = true because Gajae's strict schema cannot emit the dedicated x-opencodex-api-key admission header required by a remote OpenCodex bind.

For ja, ko, ru, and zh-cn agents docs:

  • keep Gajae in the environment-reference group (it does not carry opencodex-loopback),
  • keep Gajae in the generated loopback-only group,
  • do not tell users that OPENCODEX_GAJAE_API_KEY enables remote Gajae,
  • keep the remote-bind env-var instruction limited to clients whose generated schema can carry the admission header (opencode, Hermes, OpenClaw).

Do not change the six GUI nonLoopback translations from eae6ff46; those fixes are correct. Keep this correction docs-only and commit it to maintainer/pr-1109-finalize.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '== Current branch and working tree =='
git branch --show-current
git status --short
git diff -- 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/ru/reference/cli/agents.md \
  docs-site/src/content/docs/zh-cn/reference/cli/agents.md \
  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

printf '%s\n' '== Export client registry outline =='
ast-grep outline src/clients/config-export.ts --items all --match 'EXPORT_CLIENTS|ExportClientSpec|gajae'

printf '%s\n' '== Gajae registry entries =='
rg -n -A18 -B6 'gajae|OPENCODEX_GAJAE_API_KEY|loopbackOnly' src/clients/config-export.ts

for file in \
  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/ru/reference/cli/agents.md \
  docs-site/src/content/docs/zh-cn/reference/cli/agents.md
do
  printf '\n== %s: Gajae and remote-bind text ==\n' "$file"
  rg -n -i -A5 -B5 'gajae|OPENCODEX_GAJAE_API_KEY|opencodex-loopback|remote|tunnel|forwarder|Hermes|OpenClaw|opencode' "$file"
done

Length of output: 38063


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '== Changed files =='
git diff --name-only

printf '%s\n' '== Required documentation diff =='
git diff --check -- \
  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/ru/reference/cli/agents.md \
  docs-site/src/content/docs/zh-cn/reference/cli/agents.md
git diff -- \
  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/ru/reference/cli/agents.md \
  docs-site/src/content/docs/zh-cn/reference/cli/agents.md

printf '%s\n' '== GUI files must remain unchanged =='
git diff --exit-code -- \
  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

printf '%s\n' '== Final Gajae policy references =='
rg -n -i -A2 -B2 'OPENCODEX_GAJAE_API_KEY|gajae|loopback' \
  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/ru/reference/cli/agents.md \
  docs-site/src/content/docs/zh-cn/reference/cli/agents.md

Length of output: 18549


@Wibias, verification is inconclusive because no patch is present on the current branch.

git diff --name-only is empty. The incorrect text remains in:

  • docs-site/src/content/docs/ja/reference/cli/agents.md Line 166
  • docs-site/src/content/docs/ko/reference/cli/agents.md Line 172
  • docs-site/src/content/docs/ru/reference/cli/agents.md Lines 209-211
  • docs-site/src/content/docs/zh-cn/reference/cli/agents.md Line 167

The six GUI translation files have no diff, as required. The documentation correction still needs to remove Gajae from the remote-bind environment-variable instruction and add Gajae to the generated loopback-only group.

src/clients/config-export.ts Lines 1060-1071 remains the authoritative contract: Gajae uses OPENCODEX_GAJAE_API_KEY as an environment reference, but its generated integration is loopback-only.

🐇⚠️

You are interacting with an AI system.

Wibias commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai autofix

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Fixes Applied Successfully

Fixed 4 file(s) based on 3 unresolved review comments.

Files modified:

  • 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/ru/reference/cli/agents.md
  • docs-site/src/content/docs/zh-cn/reference/cli/agents.md

Commit: 6db1c8260fe8903f6729d9e4f2576c11d99790ca

The changes have been pushed to the maintainer/pr-1109-finalize branch.

Time taken: 5m 3s

Fixed 4 file(s) based on 3 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>

Wibias commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

Closing as superseded. #1109 has already merged into dev as 637711b3, and the only remaining maintainer regression coverage is being carried by the focused post-merge follow-up #1323. #1321 still contains the old full pre-merge #1109 tree, so merging it now would be redundant and unsafe.

@Wibias Wibias closed this Aug 9, 2026
@Wibias
Wibias deleted the maintainer/pr-1109-finalize branch August 9, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants