`tool_choice: "none"` drops the tools from the prompt, so the prompt cache misses
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- zig
- 领域
- backend, performance
调研方向
Start with zig/src/server/tool_specs.zig and zig/src/server/server.zig, then trace how the DeepSeek-V4.1 template in tools/dsv41-hip/assets/chat_template.jinja renders offered tools and handles DSML calls. Compare the none, named-function, and required paths, and read the “Keeping the prompt cache” section in docs/api.md for current behavior. Done means the chosen behavior preserves the prior prompt while preventing disallowed tool calls; the issue leaves open whether this should be DeepSeek-V4.1-specific or behind a server flag.
由索引模型根据 Issue 内容生成。
描述
What happens
With tool_choice: "none", tool_specs.active (zig/src/server/tool_specs.zig) returns no tools, so the DeepSeek-V4.1
chat template renders no tools block. The template writes that block right after the system text
(tools/dsv41-hip/assets/chat_template.jinja), so the prompt changes near its start, and the kept prompt state from
the turn before can't be resumed: the whole conversation is read again.
With thinking on it changes more: the template keeps earlier turns' thinking only while tools are offered (eff_drop),
so without tools every earlier assistant turn is rendered differently too.
A tool_choice that names one function has the same effect: tool_specs.active returns only that tool, so the tools
block changes.
Why it matters
Agent harnesses send tool_choice: "none" (or leave the tools out) to get a final answer at a step or time limit,
which is when the conversation is longest. Prompt reading runs at about 1,100–1,250 tok/s, so a 131K-token conversation
takes about 108 s on a Ryzen AI Halo pair, and while it reads, every other request on the pair waits (see the issue on
cold reads stalling the pair).
The workaround today is in docs/api.md ("Keeping the prompt cache"): keep the tools offered with tool_choice: "auto"
and say in a message that no more tools will run. That relies on the model following the message.
Ask
"none": keep the offered tools in the rendered prompt and forbid calls while decoding. For"required"on
DeepSeek-V4.1,checkFeaturesinzig/src/server/server.zigalready gives the engine a.callsstructure that holds
the reply to a DSML block."none"would need the reverse: after the think end, never allow the DSML calls opener.- A named function: render every offered tool, as for
"auto", and hold the.callsstructure to the named one.
Both keep the prompt identical to the turn before, so the cache resumes it.
docs/api.md documents the current behaviour ("none hides tools from the template", on every backend), so this
may be better as a DeepSeek-V4.1 change, or behind a server flag, than a change for every family.
- 主要语言
- Zig
- 星标
- 76
- 派生
- 9
- 平均合并
- 21 小时 59 分钟
- 30 天内合并 PR
- 34
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Shoestring-dev/StrixFold 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
Shoestring-dev/StrixFold#70 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 18/100
Shoestring-dev/StrixFold#57 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 42/100
Shoestring-dev/StrixFold#39 · 8 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 54/100
Shoestring-dev/StrixFold#7 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
Shoestring-dev/StrixFold#3 · 1 条评论 ·
维护者通常 1 天内回复
查看 Shoestring-dev/StrixFold 的全部 Issue
相似的 Issue
-
bug done
难度 2/5 1-3 小时 新手友好度 65/100
neavo/LinguaGacha#1124 ·
维护者通常 1 天内回复
-
module/http Type/Bug
难度 2/5 1-3 小时 新手友好度 72/100
ballerina-platform/ballerina-library#9868 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
symgraph/GhidrAssistMCP#84 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
open-astro/AlpacaBridge#2606 · 1 条评论 ·
维护者通常 1 天内回复
-
reasons-gate
难度 2/5 1-3 小时 新手友好度 62/100
benthomasson/reasonsforge#100 ·
维护者通常 1 天内回复