[WRONG BRANCH] Dev - #2197
Conversation
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
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. Its title has been prefixed with |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (13)
📝 WalkthroughWalkthroughThe change documents Codex ChangesCodex integration documentation
OpenCode runtime metadata and authentication
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
inputModalitiesfrom management model rows into exported OpenCode provider config asmodalities.input(only when non-empty). - Update
ocx opencodeto 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; |
Summary
Verification
Checklist
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
catalog-onlyCodex integration mode that preserves external provider settings while updating the model picker and cache.Bug Fixes
Documentation