fix(provider): keep video_url content in OpenAI Responses conversion - #1149
Open
3316891527 wants to merge 1 commit into
Open
fix(provider): keep video_url content in OpenAI Responses conversion#11493316891527 wants to merge 1 commit into
3316891527 wants to merge 1 commit into
Conversation
OpenAIProvider already wraps video attachments as Chat Completions
video_url parts when enable_direct_video_processing is on. The Responses
adapter only mapped text/image/audio/file, so those parts fell through
to else and were dropped because they have no text field.
Map video_url and input_video onto Responses input_video, accepting both
nested {url} objects and string URLs. Deepseek is left unchanged.
Fixes AAswordman#1146
3316891527
marked this pull request as ready for review
September 8, 2026 15:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明 / Description
OpenAI Responses 转换漏了
video_url分支,开启视频解析后上传的视频会被静默丢掉,请求体只剩纯文本。这次把 Chat Completions 的video_url和已经是 Responses 形态的input_video都转成input_video。背景与动机 / Context and motivation
Fixes #1146.
OpenAIProvider在enable_direct_video_processing开启时会把视频打成{type:"video_url", video_url:{url:"data:video/...;base64,..."}}。OpenAIResponsesPayloadAdapter.convertMessageContentForResponses只处理了文本/图片/音频/文件,video_url进else后因没有text字段被丢掉。改动范围 / Changes
OpenAIResponsesPayloadAdapter补video_url/input_video分支,输出{type:"input_video", video_url:<url string>}{url}和直接字符串 URL;空 URL 不发空块OpenAIResponsesVideoInputTest覆盖这三种形态和空 URL 丢弃兼容性与风险 / Compatibility and risks
只影响 OpenAI Responses / OpenAI Responses Generic 且开了视频解析的请求体。未开开关时不会生成
video_url。后端若不认input_video,可能从「静默丢视频」变成显式拒绝,这是预期行为。关联 Issue / Related issue
Fixes #1146
验证方式 / Verification
检查清单 / Checklist
dev