Repository navigation
fix(openai): 思考关闭档位按模型夹取(Responses 路径) - #192
Merged
Merged
Conversation
…on the Responses path Official OpenAI's off tier is "none", chosen by endpoint and never checked against the model. A model declaring only low..max (gpt-6-astra) rejects it with HTTP 400, so every compaction died on the parameter rather than its size. Port ThinkingRuleResolver.clampOffEffort from OpenMinis 1.14: the lowest declared tier, never a higher one. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01PV4ECd3Yzu9k81sw7vHjS3
Merged
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.
问题
Responses 路径下思考关闭时,请求带
reasoning.effort: "none"。只声明了 low…max 的模型(如 GPT-6 Astra)不接受 "none",直接 400;上下文压缩用的就是"关闭思考",所以每次压缩(包括减半重试)都死在这个参数上,而不是死在长度上。原因
"关闭"的取值按端点决定(官方 OpenAI →
none),从来没有对照模型自己声明的档位检查。OpenMinis 1.14(上游 #377)已修,我们缺这一处。改动
ThinkingRuleResolver.clampOffEffort(取自上游):模型声明了档位且不含请求值时,取声明里最低的一档;模型没有声明档位,或声明里已经有该值,则原样返回。刻意不用现有的clampEffort,它会先往下再往上取档,["high","max"]的模型会把"关闭"变成high。OpenAIProviderResponses.kt的"关闭"分支改用它。Chat Completions 路径本来就只在声明里含有该值时才发,不用改。测试
OffEffortClampTest(7 个,取自上游):报告的场景、含 none 的模型保持 none、无声明保持原样、不会升到高档、声明顺序无关、Ark 的 minimal、无法识别的声明不乱猜。ResponsesOffEffortWireTest(3 个):真实 Responses 请求体中,只声明 low…max 的模型得到low;声明含 none 的得到none(否定);没有声明档位的仍是none(否定)。未验证
没有用真实的 GPT-6 Astra 账号复现原来的 400。
🤖 Generated with Claude Code
https://claude.ai/code/session_01PV4ECd3Yzu9k81sw7vHjS3
Generated by Claude Code