Repository navigation
Conversation
…的 400 目录一旦把声明了 off 的模型(deepseek/deepseek-v4.1-flash 等)标成支持 /provider/v1/messages,标题调用因 purpose 强制 off,会把 output_config.effort:"off" 发到该端点;上游只接受 low|medium|high|xhigh|max,回 HTTP 400 invalid_request_error。 off 是两条 reasoning_effort 传输的真实档位,不能全局丢弃:本端点在 off 时改为不发送 output_config,thinking.type:adaptive 保持不变。
Contributor
Author
|
撤回本 PR,改为一个更完整的设计。 这里的诊断结论保留:Messages 端点的 effort 取值集合不含 off,而判断只查了模型快照(KNOWN_EFFORTS),没有查端点。原改动只是在组包处绕开该取值,没有触及判断本身。 后续 PR 会把「意图(这次想用哪一档)」与「合法性(这条端点收哪些值)」拆成两个显式步骤,并允许配置标题等辅助调用的档位;届时会引用本 PR 的复现数据(同一模型:默认档 200、off 400)。分支 fix/messages-effort-off 保留,便于对照。 |
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.
现象
使用
deepseek/deepseek-v4.1-flash的会话在 DSH 中执行/retitle失败:同一会话的普通对话正常,只有标题辅助调用返回 400。
复现(真实账号,2026-11-25)
同一会话、同一模型,仅改变推理强度:
off)invalid_request_error默认档通过,说明端点接受该模型,
thinking: { type: 'adaptive' }与max_tokens: 4096都不是问题;差异只在output_config.effort的取值。原因
标题请求带
purpose: 'session-title'。按 #88 的约定,适配器在模型快照声明off时强制使用该档位:KNOWN_EFFORTS['deepseek/deepseek-v4.1-flash']含off,标题请求因此必然以off发出。同时目录现已把该模型标记为:routesToMessages()据此把该模型路由到/provider/v1/messages,buildMessagesBody()又把 effort 原样写入output_config:而该端点的取值集合(同函数的文档注释记录于 2026-09-29 测量)为
low | medium | high | xhigh | max,没有off,也没有none。问题出在判断只取了模型快照这一维,没有区分传输:
off在/provider/v1/chat/completions与/alpha/generate上是有效档位,在 Messages 端点上不是。目录为 DeepSeek V4 开放/messages之后,这两个事实第一次冲突。关于上游语义
仅凭这一次 400,无法区分两种上游实现:
off(本 PR 的假设,依据是源码中已记录的端点测量);两者对适配器的影响相同:
off不应出现在 Messages 请求里。区别在于若属第二种,则「关闭思考」在非 CLI 路径上本身不可达,这一点需要上游确认,本 PR 不做断言。改动
src/adapter.ts:Messages 传输在 effort 为off时不发送output_config,thinking.type保持adaptive。docs/agent-reference/adapter-protocol.md:将「Messages 模型没有声明关闭思考能力」改为「本通道没有off这个取值」。off在两条聊天传输上是关闭思考的唯一手段(《决策记录》2026-10-03 的实测:off为 0 个推理 token,省略字段为 156 个),全局丢弃会让 会话标题自动生成必定失败:辅助调用(purpose: 'session-title')未下发reasoning_effort,64 token 预算被推理全额吃光 #88 的修复失效。测试
新增用例
Messages 传输丢弃模型已声明的 off:目录将deepseek/deepseek-v4.1-flash标记为支持/messages,断言请求确实落在该端点、标题调用(purpose 强制off)与普通调用(调用者手选关闭)均不含output_config、thinking仍为adaptive。本地结果:
tests/adapter.test.ts381/381;npm test1248/1248;npm run typecheck退出码 0;npm run build通过,lib/已重建并随 PR 提交。未验证
off」,本通道无法表达关闭思考,off只能退化为不发送 effort,标题预算仍由调用方的max_tokens决定。若更希望先有 issue 记录,可据此另开;「把 effort 策略配置化」(
titleEffort/unsupportedEffort,默认值保持现状)适合单独一个 PR,不与本修复混在一起。