Repository navigation
Conversation
上游模型元数据只由“同步上游支持的模型”落库,但编辑弹窗保存时提交的是 打开时的 extra 快照,UpdateAccount 又整体替换 extra,导致同一弹窗内 先同步再保存会覆盖(或删除)刚同步的元数据。现将其列为服务端受管字段, 保存时始终以库中值为准。
此前能否保留 max 完全由写死的模型白名单决定,新模型需要改代码发版才能 支持。现在优先读取账号同步的上游模型元数据:列出了推理档位时以其为准, 未同步或未列档位时回退到原白名单。 覆盖 Anthropic Messages 转 Responses / Chat Completions 的出站请求, 以及 HTTP、WebSocket、Grok 等路径的使用记录,保证记录的推理强度与实际 出站一致。
SavitarC
force-pushed
the
feat/reasoning-effort-max-upstream-metadata
branch
from
September 23, 2026 07:45
d040cd3 to
1da11fd
Compare
8 of 12 tasks
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.
背景
客户端请求
max推理强度时,能否原样发给上游、还是降为xhigh,此前完全由代码里写死的模型白名单(supportsOpenAIReasoningEffortMax)决定:GPT-5.6、GPT-6 Astra、DeepSeek V4、GLM、Kimi、K3。新模型支持max时只能改代码发版。而账号同步上游模型时,系统已经把每个模型支持的推理档位存进了账号的上游模型元数据(
supported_reasoning_levels),只是请求转发时没有用到。改动
1.
max支持判定优先读账号元数据新增
accountSupportsOpenAIReasoningEffortMax:max就保留,没有就降为xhigh应用范围:
/v1/messages转 OpenAI Responses / Chat Completions 时的推理强度有了支持新模型,管理员对账号重新“同步上游支持的模型”即可,无需发版。
2. 编辑账号时保留已同步的上游模型元数据
元数据只在同步时写库,但编辑弹窗保存时提交的是打开时的
extra快照,UpdateAccount又会整体替换extra,导致在同一弹窗内先同步再保存会覆盖(或删除)刚同步的元数据。现将upstream_model_metadata列为服务端受管字段,保存时始终以库中值为准。批量编辑本来就按字段合并,不受影响。行为变化
/models漏报了max,即使模型在白名单里也会降为xhigh。可在账号同步结果里核对档位。未改动
max→xhigh降级(端点限制,与模型无关)测试
max的新模型保留max、元数据未列max时覆盖白名单);WebSocket 透传使用记录;编辑账号保留元数据(提交旧快照 / 未携带元数据两种情况)go test -tags=unit ./internal/service/全部通过