Skip to content

[WRONG BRANCH] Dev - #2197

Closed
vectorstone wants to merge 8 commits into
lidge-jun:mainfrom
vectorstone:dev
Closed

[WRONG BRANCH] Dev#2197
vectorstone wants to merge 8 commits into
lidge-jun:mainfrom
vectorstone:dev

Conversation

@vectorstone

@vectorstone vectorstone commented Aug 20, 2026

Copy link
Copy Markdown

Summary

  • Explain the user-visible or maintainer-facing change.

Verification

  • List the commands or checks you ran.
  • If this PR changes the GUI, include a screenshot of the UI change in the description.

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.

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 a catalog-only Codex integration mode that preserves external provider settings while updating the model picker and cache.
    • Added configuration guidance for Codex integration modes.
    • Preserved supported input modalities in generated OpenCode model entries.
    • Improved authenticated model-catalog requests with management-token validation.
  • Bug Fixes

    • Improved request identity-header forwarding while protecting credentials and account information.
  • Documentation

    • Updated Codex integration guidance across supported languages.

Copilot AI and others added 8 commits August 20, 2026 08:27
Part A (UA forwarding from codex/catalog-only-integration):
- Add 'user-agent' to FORWARD_HEADERS allowlist in openai-responses adapter
- Forward FORWARD_HEADERS (minus auth) in the API key branch of buildRequest(),
  mirroring the existing forward-mode behavior
- Explicitly exclude authorization and chatgpt-account-id to prevent
  credential leaks in API key mode
- Add regression tests: UA forwarded, authorization not forwarded,
  chatgpt-account-id not forwarded

Part B (catalog-only docs from codex/catalog-only-integration):
- EN guide: expand External provider managers section with catalog-only
  mode description and full TOML example
- EN reference/configuration: add Codex integration mode table
  (full / catalog-only / off)
- zh-cn guide + reference: add matching zh-cn catalog-only content
- ja / ko / ru guides: update external-provider section prefix and
  add catalog-only summary paragraph

Skipped (already in upstream/main since branch diverged):
  src/codex/sync.ts, src/codex/desired-state.ts, src/types.ts,
  src/server/management/context.ts, src/server/management/native-integration-routes.ts,
  src/cli/config-command.ts, src/config.ts, all GUI/i18n files,
  structure/ files, and the bulk runtime tests.

Co-authored-by: vectorstone <39456045+vectorstone@users.noreply.github.com>
…headers in API key forwarding

Co-authored-by: vectorstone <39456045+vectorstone@users.noreply.github.com>
…gration

[WRONG BRANCH] feat(codex): forward User-Agent in API key mode; document catalog-only integration
…utModalities

Co-authored-by: vectorstone <39456045+vectorstone@users.noreply.github.com>
Co-authored-by: vectorstone <39456045+vectorstone@users.noreply.github.com>
Co-authored-by: vectorstone <39456045+vectorstone@users.noreply.github.com>
Co-authored-by: vectorstone <39456045+vectorstone@users.noreply.github.com>
…bility

fix(opencode): admin token for model catalog fetch; thread inputModalities into provider block
Copilot AI lite review requested due to automatic review settings August 20, 2026 12:05
@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot changed the title Dev [WRONG BRANCH] Dev Aug 20, 2026
@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • wrong target branch (main); retarget to dev.

What to do

  • Retarget this PR to dev — all contributions go to dev.
  • Tick all four boxes in the PR description once you're done (currently 0/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.

0/4 boxes ticked.

Its title has been prefixed with [WRONG BRANCH].
This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.
@vectorstone Tick the boxes once your local CI is green, your branch is on the latest dev commit, and every correct Codex and CodeRabbit finding is resolved.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 22e72913-c7c6-405c-8263-2cd896af781f

📥 Commits

Reviewing files that changed from the base of the PR and between 5840591 and 3e15db3.

📒 Files selected for processing (13)
  • docs-site/src/content/docs/guides/codex-integration.md
  • docs-site/src/content/docs/ja/guides/codex-integration.md
  • docs-site/src/content/docs/ko/guides/codex-integration.md
  • docs-site/src/content/docs/reference/configuration.md
  • docs-site/src/content/docs/ru/guides/codex-integration.md
  • docs-site/src/content/docs/zh-cn/guides/codex-integration.md
  • docs-site/src/content/docs/zh-cn/reference/configuration.md
  • src/adapters/openai-responses.ts
  • src/cli/opencode.ts
  • src/clients/config-export.ts
  • tests/client-config-export.test.ts
  • tests/codex-metadata-integrity.test.ts
  • tests/opencode-cli.test.ts

📝 Walkthrough

Walkthrough

The change documents Codex catalog-only integration behavior across supported languages. It also updates OpenCode model modality serialization, management-token handling for catalog requests, and API-key request header forwarding.

Changes

Codex integration documentation

Layer / File(s) Summary
Codex integration modes
docs-site/src/content/docs/reference/configuration.md, docs-site/src/content/docs/*/guides/codex-integration.md
The documentation defines full, catalog-only, and off modes. It describes catalog and cache updates, external provider preservation, and unchanged history and configuration files.

OpenCode runtime metadata and authentication

Layer / File(s) Summary
Model modality metadata
src/cli/opencode.ts, src/clients/config-export.ts, tests/client-config-export.test.ts, tests/opencode-cli.test.ts
Catalog rows preserve non-empty inputModalities values. Generated OpenCode entries emit modalities.input only when values exist.
Management-token authentication and header forwarding
src/cli/opencode.ts, src/adapters/openai-responses.ts
Model-catalog requests use a trimmed configured management token. API-key requests forward selected identity headers while excluding authorization, account, and credential-like headers. Tests cover both behaviors.

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

Possibly related PRs

Suggested labels: enhancement, intake: hygiene-blocked

Suggested reviewers: ingwannu

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 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.

Copilot AI 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.

Pull request overview

This PR extends OpenCodex’s Codex/OpenCode integration by (1) carrying model input-modality metadata through the /api/models → exporter pipeline, (2) tightening ocx opencode to use the management/admin token for management API access, and (3) forwarding User-Agent (and other identity headers) to upstreams in API-key adapter mode, with corresponding test and docs updates.

Changes:

  • Propagate inputModalities from management model rows into exported OpenCode provider config as modalities.input (only when non-empty).
  • Update ocx opencode to require a configured admin/management token when calling the proxy management endpoint /api/models.
  • Forward user-agent (and other allowed metadata headers) in the OpenAI Responses passthrough adapter (API-key mode), and document Codex integration modes across locales.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/opencode-cli.test.ts Adds coverage for inputModalities propagation and management token behavior.
tests/codex-metadata-integrity.test.ts Expands header integrity tests to include forwarding user-agent and guarding sensitive headers in API-key mode.
tests/client-config-export.test.ts Verifies modalities.input emission rules in exported client config.
src/clients/config-export.ts Adds inputModalities to catalog models and emits OpenCode modalities.input when present.
src/cli/opencode.ts Introduces requireOpencodeManagementToken() and uses it for authenticated /api/models access.
src/adapters/openai-responses.ts Adds user-agent to forwarded headers and forwards identity headers in API-key mode.
docs-site/src/content/docs/reference/configuration.md Documents clientIntegrations.codex modes in the main reference.
docs-site/src/content/docs/zh-cn/reference/configuration.md Adds the same Codex integration mode documentation for zh-cn reference.
docs-site/src/content/docs/guides/codex-integration.md Documents catalog-only mode behavior and workflow for external provider managers.
docs-site/src/content/docs/zh-cn/guides/codex-integration.md Mirrors catalog-only guidance for zh-cn guide.
docs-site/src/content/docs/ru/guides/codex-integration.md Mirrors catalog-only guidance for ru guide.
docs-site/src/content/docs/ko/guides/codex-integration.md Mirrors catalog-only guidance for ko guide.
docs-site/src/content/docs/ja/guides/codex-integration.md Mirrors catalog-only guidance for ja guide.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

if (h === "authorization" || h === "chatgpt-account-id") continue;
if (/key|token|secret/i.test(h)) continue;
const v = incoming?.headers.get(h);
if (v) headers[h] = v;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants