Skip to content

Add non-destructive provider sync and generic multimodal gateway routing - #1387

Open
AlfredQuan wants to merge 1 commit into
BigPizzaV3:mainfrom
AlfredQuan:feat/generic-multimodal-gateway-provider
Open

Add non-destructive provider sync and generic multimodal gateway routing#1387
AlfredQuan wants to merge 1 commit into
BigPizzaV3:mainfrom
AlfredQuan:feat/generic-multimodal-gateway-provider

Conversation

@AlfredQuan

Copy link
Copy Markdown

Summary

This PR makes provider sync non-destructive by default and adds a generic multimodal gateway compatibility route for Chat Completions upstreams.

Changes

  • Default provider sync no longer rewrites historical rollout model_provider values.
  • SQLite provider rows are no longer bulk-rewritten during ordinary sync.
  • Destructive provider rewrite remains available only as an explicit repair mode.
  • Adds routeMode = "multimodalGatewayCompat" for generic multimodal gateway compatibility.
  • Converts Responses requests to Chat Completions while replacing image blocks with injected image analysis text.
  • Optionally calls a configured vision upstream before the main request.
  • Blocks gpt-* models in multimodal gateway mode so OpenAI GPT models stay on official/OpenAI-compatible providers.
  • Adds UI fields for route mode, vision model, vision base URL, and GPT blocking.

Validation

  • git diff --check
  • apps/codex-plus-manager/node_modules/.bin/tsc --noEmit -p apps/codex-plus-manager/tsconfig.json
  • cargo test -p codex-plus-core multimodal_gateway --test protocol_proxy
  • cargo test -p codex-plus-core settings
  • cargo test -p codex-plus-data provider_sync --test provider_sync

@AlfredQuan
AlfredQuan force-pushed the feat/generic-multimodal-gateway-provider branch from 84f9fe9 to 2d18a4f Compare July 9, 2026 04:33
@BigPizzaV3

Copy link
Copy Markdown
Owner

这个 PR 的方向有用,不过我看到一个需要先修的问题:blockGptOnMultimodalGateway 现在像是“假开关”。

前端新增了“在多模态网关中阻止 gpt-* 模型”的勾选项,也会把 blockGptOnMultimodalGateway 存到 profile 里;但后端实际转换路径里 validate_multimodal_gateway_model() 是无条件阻止 gpt-* / openai/gpt-*

  • RelayProfile.block_gpt_on_multimodal_gateway 有字段;
  • UI 也能切换;
  • protocol_proxy.rs 没有读取这个字段;
  • 所以用户关闭开关后仍然会被阻止。

建议二选一:

  1. 让后端按 relay.block_gpt_on_multimodal_gateway 决定是否调用 GPT block;或者
  2. 如果产品上必须永远阻止 GPT,就去掉这个 UI 开关,改成固定说明。

另外这个 PR 没有 GitHub checks,修完后建议跑一下:

  • cargo test -p codex-plus-core multimodal_gateway --test protocol_proxy
  • cargo test -p codex-plus-core settings
  • cargo test -p codex-plus-data provider_sync --test provider_sync
  • manager 的 TS check

@BigPizzaV3

Copy link
Copy Markdown
Owner

Codex++ maintainer review note

当前 main 下这个 PR 仍存在 merge conflict,暂时不能合并。请先 rebase 到最新 main 并解决冲突;更新后我们会重新跑针对性测试再复审。

This PR currently conflicts with main, so it is not mergeable yet. Please rebase onto the latest main and resolve the conflicts, then we can review and test it again.

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.

2 participants