feat:接入纯标准 OpenAI 协议开关,防止因为参数问题导致模型报错 - #1770
Open
Story19240 wants to merge 1 commit into
Open
Conversation
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.
背景
部分第三方网关(如 NVIDIA 等)只用标准 OpenAI 协议,会拒绝厂商私有的 reasoning 参数(如
reasoning_split、thinking、enable_thinking、reasoning等)。配合当前默认会按模型注入厂商reasoning 方言的行为,这些网关会直接拒绝请求或忽略 reasoning。需要能在一个 Relay Profile 上
强制只走标准 OpenAI 协议。closes 之前标准模式下厂商方言导致的兼容问题。
改动
standardOpenaiProtocol(默认关闭,保持现有行为不变)。responses_to_chat_completions_with_options(standard=true):Default,不按模型推断厂商方言。reasoning_split/thinking/enable_thinking/ openrouterreasoning等私有参数。
reasoning_effort的模型(deepseek-reasoner、gpt-5.x系列),reasoning_effort仍按reasoning.effort正常下发。protocol_proxy转发ChatCompletions时按relay.standard_openai_protocol选择
standard=true/ false 的转换路径;Responses协议不受影响。settings.rs/ccs_import.rs/provider_import.rs/App.tsx/i18n-en.ts等处补齐新字段与默认值,UI 新增勾选项到 Relay Profile 编辑器。
responses_request_standard_protocol_strips_vendor_reasoning_dialects,覆盖 MiniMax / GLM / Qwen / OpenRouter / DeepSeek / GPT-5 多场景,并保留默认路径回归守护。
测试
风险与回归
false,既不改变任何现有 Relay 行为时表现;用户自行在 Relay Profile 勾选才会走标准协议。