Repository navigation
Conversation
Owner
|
Superseded by #150, which ports the fix onto the current main base. This PR is based on an inaccessible fork branch and is now conflicting, so it cannot be updated or merged safely. |
Owner
|
Closing as superseded by #150. |
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.
问题与修复
客户端明确关闭思考后,跨协议转换曾把关闭值归一化为缺省值,导致关闭字段丢失;后续默认强度注入还可能把思考重新开启。例如 Anthropic
thinking.type=disabled转成 Chat 后,原先会丢掉关闭参数,配置默认high时还会发出reasoning_effort=high。这次保留“未设置”与“明确关闭”的区别:桥接层保留
none,跨协议转换分别输出 Chatreasoning_effort=none、Responsesreasoning.effort=none、Anthropicthinking.type=disabled。应用默认强度前检查显式关闭,同协议透传的原生关闭字段也受到保护。reasoning_effort=none/reasoning.effort=none范围仅限关闭参数丢失与默认强度覆盖。未新增模型能力列表、上游专用参数映射或“不支持关闭”的拒绝/重试策略;配置中的
reasoning.effort=none继续保留原有语义。Fixes #114
已纳入代码的回归测试
Gateway.Handler、路由、协议转换和默认强度注入,再由本地 HTTP 上游捕获出站 JSON。覆盖 4 种关闭输入、3 种目标协议、关闭/未设置、stream true/false,以及未配置、全局 high、按模型 high 覆盖全局 low、none、auto 学到 high 共 5 种配置。修复前可复现关闭丢失/被覆盖,修复后全部通过。开启思考与默认配置的额外对照验证
以
83d623d541c47a17cd832ee4f53bd7c95f3a18fa为修复前基线,使用同一批输入比较基线与修复版的完整出站 JSON:max_tokens等非思考字段。验证边界
HTTP 上游是本地
httptest服务,固定返回用于捕获请求的 400;测试验证路由与出站参数,以及该错误的透传,没有调用真实模型,也没有验证 SSE 响应内容或模型实际停止思考。模型本身不支持/忽略关闭,与中转丢参数是不同问题;本 PR 只修复后者及默认强度覆盖。未上线;提交供项目作者审查、合并。