You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tools.visible: selective deferred-tool visibility at startup #6368
A new tools.visible setting in settings.json that allows users to specify which deferred tools should be visible to the LLM from the very first turn, without needing to call tool_search.
Currently, deferred tools (those with shouldDefer=true) are hidden from the initial function declaration list. The model can only discover them on-demand via tool_search. This setting would let users override that on a per-tool basis — a selected set of deferred tools would be included in the initial declaration list at session start, just like non-deferred tools.
Why is this needed?
Frequently-used tools should be immediately available. Tools like web_fetch, monitor, task_stop, and cron_create/list/delete are used routinely. Forcing the model to call tool_search before each first use adds latency, wastes tokens on the search round-trip, and the discovery schemas embedded in <functions> blocks.
Reducing tool_search calls improves KV-cache stability. Every tool_search call that reveals a deferred tool changes the prompt prefix (the deferred-tools reminder in the system prompt), which invalidates the LLM server's KV cache and forces full recomputation (~500–2000ms penalty). Making commonly-used tools visible from startup eliminates the need to discover them mid-session.
Existing workarounds are too coarse. Disabling ToolSearch globally (tools.toolSearch.enabled: false) makes all deferred tools visible at once, which defeats the purpose of deferred loading. Per-MCP-server alwaysLoadTools: true only works for whole MCP servers, not individual tools. There is no way to selectively promote a handful of deferred tools to visible-at-startup.
The existing mcpServers.<NAME>.alwaysLoadTools option (per-server) shows the pattern already exists in the system, but there is no per-tool equivalent
The existing tools.disabled setting (in ConfigParameters, mapped from settings.tools.disabled) proves the settings.tools.* namespace is established; tools.visible would be a sibling key
No existing issues found for this specific proposal
What would you like to be added?
A new
tools.visiblesetting insettings.jsonthat allows users to specify which deferred tools should be visible to the LLM from the very first turn, without needing to calltool_search.Example:
{ "tools": { "visible": ["web_fetch", "monitor", "task_stop"] } }Currently, deferred tools (those with
shouldDefer=true) are hidden from the initial function declaration list. The model can only discover them on-demand viatool_search. This setting would let users override that on a per-tool basis — a selected set of deferred tools would be included in the initial declaration list at session start, just like non-deferred tools.Why is this needed?
Frequently-used tools should be immediately available. Tools like
web_fetch,monitor,task_stop, andcron_create/list/deleteare used routinely. Forcing the model to calltool_searchbefore each first use adds latency, wastes tokens on the search round-trip, and the discovery schemas embedded in<functions>blocks.Reducing
tool_searchcalls improves KV-cache stability. Everytool_searchcall that reveals a deferred tool changes the prompt prefix (the deferred-tools reminder in the system prompt), which invalidates the LLM server's KV cache and forces full recomputation (~500–2000ms penalty). Making commonly-used tools visible from startup eliminates the need to discover them mid-session.Existing workarounds are too coarse. Disabling ToolSearch globally (
tools.toolSearch.enabled: false) makes all deferred tools visible at once, which defeats the purpose of deferred loading. Per-MCP-serveralwaysLoadTools: trueonly works for whole MCP servers, not individual tools. There is no way to selectively promote a handful of deferred tools to visible-at-startup.Additional context
tool_searchinvalidates LLM server KV-cache on every deferred-tool load #6265 — KV-cache invalidation on tool_search (this feature would reduce the number of cases where tool_search is needed)mcpServers.<NAME>.alwaysLoadToolsoption (per-server) shows the pattern already exists in the system, but there is no per-tool equivalenttools.disabledsetting (in ConfigParameters, mapped fromsettings.tools.disabled) proves thesettings.tools.*namespace is established;tools.visiblewould be a sibling keyQwenCode QwenLLM
中文
希望添加什么功能?
在
settings.json中新增tools.visible配置项,允许用户指定哪些 deferred 工具在会话开始时立即可见,无需调用tool_search。示例:
{ "tools": { "visible": ["web_fetch", "monitor", "task_stop"] } }目前,deferred 工具(
shouldDefer=true)在初始函数声明列表中不可见,模型只能通过tool_search按需发现。这个配置让用户按工具粒度覆盖默认行为——被选中的 deferred 工具会在会话开始时直接出现在声明列表中,就像非 deferred 工具一样。为什么需要这个功能?
常用工具应当立即可用。
web_fetch、monitor、task_stop、cron_create/list/delete等工具是高频使用的。每次首次使用前都强制模型调用tool_search会增加延迟、浪费搜索往返的 token,以及在<functions>代码块中嵌入的发现 schema。减少
tool_search调用能提升 KV-cache 稳定性。 每次tool_search发现 deferred 工具都会改变 prompt prefix(系统提示中的 deferred-tools 提醒部分),从而使 LLM 服务器的 KV-cache 失效,需要完全重新计算(约 500-2000ms 延迟)。让常用工具在启动时就可见,可以消除在会话中期发现它们的需求。现有的变通方案太粗糙了。 全局关闭 ToolSearch(
tools.toolSearch.enabled: false)会让所有 deferred 工具同时可见,违背了延迟加载的初衷。每个 MCP 服务器的alwaysLoadTools: true只对整个服务器生效,不能选择单个工具。没有任何机制可以只让少数几个 deferred 工具在启动时可见。附加上下文
tool_searchinvalidates LLM server KV-cache on every deferred-tool load #6265 —— tool_search 导致的 KV-cache 失效(此功能会减少 tool_search 的调用次数)mcpServers.<NAME>.alwaysLoadTools(按服务器粒度)说明系统已有类似模式,但缺少按工具粒度的等价物tools.disabled配置(从settings.tools.disabled映射到 ConfigParameters)证明settings.tools.*命名空间已经建立;tools.visible可作为同级键