-
Notifications
You must be signed in to change notification settings - Fork 331
fix(codex-proxy): enable image_url by default in Chat Completions bridge #3368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
e987871
8ad38d0
4d257aa
e8d102b
1ea10c4
4d7ddae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -715,6 +715,7 @@ const CHAT_BRIDGE_DEFAULT_CAPABILITIES: ChatBridgeCapabilities = { | |
| maxTokensField: 'max_tokens', | ||
| reasoningField: 'none', | ||
| streamUsage: true, | ||
| imageInput: 'image_url', | ||
|
Battleplus marked this conversation as resolved.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Acknowledged — this is a real limitation of fail-open. The bridge intentionally enables image_url for all routes (upstream is the authority on capability), so a rejected image in replayed history is not filtered by isImagePartTranslatable. The coordinator already strips queued-message images on retry (stripQueuedMessageImages), but Codex replays the failed input as history, which is translated with imageInput=enabled. A complete fix needs a per-session provider-confirmed-no-image signal threaded from coordinator to the host bridge capabilities (vendorOptions to chatBridgeCapabilitiesForRoute), which is a cross-layer change beyond this PR scope. Noted as follow-up. The P1 (plain-text rejection classification) is fixed in 4d257aa. |
||
| // Responses fields with direct Chat equivalents. Provider-specific unsupported fields can | ||
| // be removed later when the model capability catalog becomes more granular. | ||
| passthroughFields: [ | ||
|
|
@@ -788,14 +789,11 @@ function rewriteChatBridgeModel(model: string, stripPrefix: string | undefined): | |
| /** | ||
| * 在模型级多模态能力元数据接入路由前,图片桥接先按已验证的上游能力显式开启。 | ||
| * | ||
| * 当前覆盖: | ||
| * - Moonshot Kimi K3 | ||
| * - Volcengine Doubao Seed 系列 | ||
| * - Alibaba Cloud Bailian Coding Plan Qwen 3.7 Plus | ||
| * 默认已启用 `imageInput: 'image_url'`(fail-open)。此函数仅在已验证路由上 | ||
| * 显式覆盖,确保白名单路由的 `imageInput` 始终为 `'image_url'`。 | ||
| * | ||
| * 这里认官方 DNS 边界 + 上游 model,不认 provider id(预设创建后会生成用户自定义 | ||
| * id),也不对所有 openai-chat 供应商放开。未命中继续沿用 fail-closed 默认—— | ||
| * 无图片能力的上游(如 DeepSeek)保持发送前显式报错,不静默吞图。 | ||
| * 非白名单路由同样走 fail-open:桥接层转换格式,上游不支持时返回错误, | ||
| * 客户端通过 `isUnsupportedResponsesImageErrorPayload` 检测并提示用户。 | ||
| */ | ||
| export function chatBridgeCapabilitiesForRoute( | ||
| upstream: string, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.