mirror of
https://git.openapi.site/https://github.com/desirecore/config-center.git
synced 2026-10-21 05:24:25 +08:00
feat(compute): 官方 Anthropic 模型声明接受不含 thinking 的工具轮 (#99)
新增 extra.thinkingToolTurnValidation(requires-thinking / accepts-thinkless),与 thinkingRoundTrip 并列(后者 additionalProperties:false,不能往里加字段)。 anthropic.json 与 anthropic-claude.json 的 Fable 5.1 / Opus 5 / Sonnet 5 声明 accepts-thinkless:官方 adaptive thinking 不要求工具轮以 thinking 开头,模型跳过思考的 工具轮原样回放即合法(mini 真机六轮验证全部 200)。客户端据此不再对这类响应重试、 不再降级为关闭思考。旧客户端忽略该字段,行为不变。 model-spec schema 的 spec.extra 同步禁止 thinkingRoundTrip 与 thinkingToolTurnValidation, 与客户端 Schema 一致,避免写错后新客户端整份拒收规格。 presetDataVersion 113 → 114。
This commit is contained in:
@@ -777,6 +777,28 @@ describe('provider schema 反例(防 PR #1 重演)', () => {
|
||||
}
|
||||
})
|
||||
|
||||
it('校验 Provider model 的工具轮 thinking 校验口径', () => {
|
||||
for (const value of ['requires-thinking', 'accepts-thinkless']) {
|
||||
const valid = makeValidProvider()
|
||||
valid.models[0].extra = {
|
||||
thinkingRoundTrip: {
|
||||
enabled: true,
|
||||
protocol: 'anthropic-messages',
|
||||
allowEmptySignature: false,
|
||||
scope: 'active-tool-turn',
|
||||
},
|
||||
thinkingToolTurnValidation: value,
|
||||
}
|
||||
assert.equal(validate(valid), true, JSON.stringify(validate.errors))
|
||||
}
|
||||
|
||||
for (const broken of ['accept', true, null]) {
|
||||
const invalid = makeValidProvider()
|
||||
invalid.models[0].extra = { thinkingToolTurnValidation: broken }
|
||||
assert.equal(validate(invalid), false)
|
||||
}
|
||||
})
|
||||
|
||||
it('拒绝 Ultra 与重复 reasoning effort', () => {
|
||||
const ultra = makeValidProvider()
|
||||
ultra.models[0].extra = {
|
||||
@@ -868,6 +890,22 @@ describe('model-spec schema 接入面边界', () => {
|
||||
assert.equal(validate(data), false)
|
||||
})
|
||||
|
||||
it('拒绝在模型内在规格中声明接入面的 thinking 回放能力与工具轮校验口径', () => {
|
||||
for (const extra of [
|
||||
{
|
||||
thinkingRoundTrip: {
|
||||
enabled: true,
|
||||
protocol: 'anthropic-messages',
|
||||
allowEmptySignature: false,
|
||||
scope: 'active-tool-turn',
|
||||
},
|
||||
},
|
||||
{ thinkingToolTurnValidation: 'accepts-thinkless' },
|
||||
]) {
|
||||
assert.equal(validate({ specs: [{ id: 'claude-test', spec: { extra } }] }), false)
|
||||
}
|
||||
})
|
||||
|
||||
it('仍允许模型内在扩展参数', () => {
|
||||
const data = {
|
||||
specs: [{ id: 'gpt-test', spec: { extra: { intrinsicBudgetHint: 8192 } } }],
|
||||
|
||||
Reference in New Issue
Block a user