fix: v0.8.0 修订 — 思考用户意图优先 · 移除元信息硬门控 · 实施清单入库
- DeepSeek/MiMo/Agnes 移除 supportsThinking 元信息硬门控:思考参数完全遵循用户配置 (事故复盘中 vision-exp 元信息标注不支持思考、实际产生了 8189 token 推理内容, 元信息不可靠;预算耗尽由引擎降级重试兜底,元信息不符仅告警不拦截) - Ollama 保留 /api/show 能力探测门控(服务端硬协议约束:向不支持思考的模型发 think 每次请求 400,属协议正确性而非意图覆盖),探测失败 fail-open - LLM 设置提示文案修订:元信息不符仍按用户配置发送,降级重试自动兜底 - 测试契约反向钉住:vision-exp + 用户开启→照发 enabled+reasoning_effort; 关闭/未配置→显式 disabled;Ollama 探测 false→不发 think / null→fail-open - 补录 docs/v0.8.0-迭代实施清单.md(含逐项验证记录与本次修订记录; 首次提交时该文件因故未入库,本次补齐) - 验证:typecheck 0 错误 / lint 0 问题 / 系统 Node 2146 通过 / thinking 矩阵 101 用例全绿
This commit is contained in:
@@ -701,10 +701,13 @@ export class OllamaAdapter extends BaseAdapter {
|
||||
}
|
||||
|
||||
// Thinking 模式
|
||||
// v0.8.0 P0-3: 模型能力门控 —— /api/show capabilities 探测为不支持思考
|
||||
//(cachedThinkingSupport === false)时不发 think 参数(Ollama 服务端默认关闭);
|
||||
// 未探测/探测失败(null)fail-open 放行,与 listModels 能力回退策略一致。
|
||||
// 探测在适配器实例创建时 fire-and-forget 发起(refreshContextWindow)。
|
||||
// v0.8.0 P0-3(v0.8.0 修订后保留的唯一门控): /api/show capabilities 探测为
|
||||
// 不支持思考(cachedThinkingSupport === false)时不发 think 参数 —— 与云端
|
||||
// Provider 不同,这是 Ollama 服务端的**硬协议约束**(向无思考能力的模型发
|
||||
// think 会导致每次请求 400 "does not support thinking",而非静默忽略),
|
||||
// 故此处门控属协议正确性而非用户意图覆盖;探测为服务端实时真值(非静态
|
||||
// 元信息)。未探测/探测失败(null)fail-open 放行,与 listModels 能力回退
|
||||
// 策略一致。探测在适配器实例创建时 fire-and-forget 发起(refreshContextWindow)。
|
||||
if (request.params.thinkingEnabled) {
|
||||
const modelThinkingSupported = this.cachedThinkingSupport !== false;
|
||||
if (modelThinkingSupported) {
|
||||
@@ -724,7 +727,7 @@ export class OllamaAdapter extends BaseAdapter {
|
||||
}
|
||||
} else {
|
||||
log.warn(
|
||||
`[Ollama] model "${this.config.defaultModel}" does not support thinking (per /api/show capabilities) — omitting think parameter (P0-3 capability gate)`,
|
||||
`[Ollama] model "${this.config.defaultModel}" does not support thinking (per /api/show capabilities) — omitting think parameter (server would reject with 400 otherwise)`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user