Skip to content

[codex] Add configurable OpenAI-compatible gateway#9

Closed
Neonity2020 wants to merge 8 commits into
PeakCode-AI:mainfrom
Neonity2020:codex/unified-gateway
Closed

[codex] Add configurable OpenAI-compatible gateway#9
Neonity2020 wants to merge 8 commits into
PeakCode-AI:mainfrom
Neonity2020:codex/unified-gateway

Conversation

@Neonity2020

Copy link
Copy Markdown
Contributor

What Changed

Why

UI Changes

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Summary

Adds a PeakCode-hosted OpenAI-compatible gateway so Codex can route selected
third-party models through the app instead of requiring each tool to be
configured independently.

What changed

  • Added gateway contracts, RPC plumbing, server service wiring, and settings
    UI for configuring upstream providers and API keys.
  • Added DeepSeek V4 Flash/Pro defaults and alias handling for legacy DeepSeek
    model names.
  • Routed Codex DeepSeek model selections through a local peakcode-gateway
    Codex provider overlay.
  • Added OpenAI-compatible /models, /chat/completions, and /responses
    gateway endpoints, including Responses-to-Chat translation for Codex.
  • Cleaned up stale Codex overlay provider config so switching back from
    DeepSeek gateway models to GPT-5.5 restores the normal Codex provider path.

Validation

  • vitest run src/http.test.ts --testTimeout=10000
  • vitest run src/codexAppServerManager.test.ts --testTimeout=10000
  • git diff --check
  • npm run dist:desktop:dmg:arm64

Notes

Full workspace bun fmt, bun lint, and bun typecheck were not run in this
session per local AGENTS.md guidance unless explicitly requested.

@github-actions github-actions Bot added size:XXL vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Jun 13, 2026
@jwangkun

Copy link
Copy Markdown
Collaborator

感谢这个 PR 付出的工作 @Neonity2020 👍

很遗憾这个 PR 我们没法合并,主要原因如下:

与现有的 gateway 实现严重冲突。 最近 main 上已经合入了一套 model channel gateway 方案(见 commit e743f72),覆盖了几乎相同的文件集:

  • packages/contracts/src/gateway.ts —— 双方都新增(add/add 冲突),但是两套完全不同的设计:
    • 本 PR: GatewayUpstreamConfig + GatewayFallbackStrategy(retry/skip/fail)+ 模型动态发现,偏通用抽象。
    • 已合入方案: GatewayChannelConfig(openai/mimo/anthropic)+ 预设渠道 + API key 管理 + Codex overlay 注入,偏具体落地。
  • apps/server/src/http.tscodexProcessEnv.tscodexAppServerManager.ts_chat.settings.tsx、contracts(ipc/rpc/ws)均有内容冲突,共 9 个文件。

两套方案在职责上高度重叠,合并意味着推倒重来,因此只能二选一。目前仓库已经采用了落地版本,所以先关闭这个 PR。

如果后续有部分能力(例如 fallback 策略、模型动态发现)想作为补充合进来,欢迎基于最新的 main 重新开一个聚焦的小 PR,避免和现有 gateway 模块冲突。再次感谢贡献 🙏

@jwangkun jwangkun closed this Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants