Repository navigation
[Bug/Docs] 官方 Messages API 以 422 拒绝 toolUpdate: in-history 生成的 tool_removal #9911
kazari-qwp
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
问题
在独立的原生 Harness SDK 最小测试中,显式为
deepseek-flash声明toolUpdate: in-history后,SDK 会按文档发送tool_removal,但官方 Messages 端点返回 HTTP 422,明确表示不认识该内容块。我理解默认 Flash 模型条目采用
addition-only,也理解“允许在 SDK 中声明能力”不一定代表每个服务端已经支持。本反馈希望确认官方服务的实际支持范围,并建议在文档中明确说明这个限制,避免插件开发者启用该模式后直接遇到服务端协议错误。环境
@deepseek-ai/dsh-llm、dsh-llm-deepseek、dsh-session版本均为0.2.0-rc.2。deepseek-account,正常的官方账户登录通道。https://api.deepseek.com/anthropic/v1/messages。deepseek-flash;thinking off;每请求max_tokens: 64;禁用 SDK 自动重试。LlmRuntime+DeepSeekAdapter+Session.toolHistory()独立测试,不经过第三方应用的工具保留、权限拦截或消息队列逻辑。文档依据
toolUpdate: addition-only / in-history,以及原生工具更新内容块和 beta 请求头。模型目录中启用的相关配置:
resolveModelInfo()确实返回了toolUpdate: "in-history"。线协议请求也确实包含 removal,排除了配置没有生效的情况。最小复现
retained_probe和removed_probe,发送一个要求回复READY的普通请求,得到 HTTP 200 / READY。retained_probe,在 Session 中记录移除removed_probe的 tool-registry developer 更新。Session.toolHistory()发起下一次原生 SDK 请求。SDK 自动附带的相关请求头为:
使用官方账户鉴权头,鉴权值不公开。下面是捕获到的实际请求正文(只有测试用文本与空参数工具,不含账户数据):
{ "model": "deepseek-flash", "stream": true, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Reply exactly READY." } ] }, { "role": "assistant", "content": [ { "type": "text", "text": "READY" } ] }, { "role": "user", "content": [ { "type": "text", "text": "The temporary tool is removed. Reply exactly REMOVAL_ACK." } ] }, { "role": "system", "content": [ { "type": "tool_removal", "tool": { "type": "tool_reference", "name": "removed_probe" } } ] } ], "max_tokens": 64, "thinking": { "type": "disabled" }, "system": "Reply with the exact requested acknowledgment. Do not call tools.", "tools": [ { "name": "retained_probe", "description": "Control tool; do not call it.", "input_schema": { "type": "object", "properties": {}, "additionalProperties": false } }, { "name": "removed_probe", "description": "Temporary tool; do not call it.", "input_schema": { "type": "object", "properties": {}, "additionalProperties": false } } ] }保留两个工具声明、再用历史 removal 表示其中一个失效,是 in-history 模式的原生投影行为;这里并不是忘记从当前有效工具清单中移除它。
实际结果
HTTP 422。原生 SDK 归类为
INVALID_REQUEST:错误列出的允许类型包含
tool_addition,但不包含tool_removal。对照结果:
最后一项仅用原生 Session replacement 模拟摘要提交后的投影边界,没有额外执行摘要模型。它表明同一鉴权与端点正常工作,失败集中在 removal 协议块。
希望确认
deepseek-account/ Flash Messages 端点目前是否支持 in-history 工具移除?是否还需要其他开关、版本或不同 beta 头?暂时可以保留定义并禁用执行,再在新的声明系列中清理停用工具;但这与真正的历史内 removal 是不同的能力。感谢帮忙确认。
All reactions