Skip to content

tools.visible: selective deferred-tool visibility at startup #6368

Description

@Aleks-0

What would you like to be added?

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.

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 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?

  1. 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.

  2. 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.

  3. 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.

Additional context

  • Related to tool_search invalidates 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)
  • 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

QwenCode QwenLLM

中文

希望添加什么功能?

在 settings.json 中新增 tools.visible 配置项,允许用户指定哪些 deferred 工具在会话开始时立即可见,无需调用 tool_search。

示例:

{
  "tools": {
    "visible": ["web_fetch", "monitor", "task_stop"]
  }
}

目前,deferred 工具(shouldDefer=true)在初始函数声明列表中不可见,模型只能通过 tool_search 按需发现。这个配置让用户按工具粒度覆盖默认行为——被选中的 deferred 工具会在会话开始时直接出现在声明列表中,就像非 deferred 工具一样。

为什么需要这个功能?

  1. 常用工具应当立即可用。 web_fetch、monitor、task_stop、cron_create/list/delete 等工具是高频使用的。每次首次使用前都强制模型调用 tool_search 会增加延迟、浪费搜索往返的 token,以及在 <functions> 代码块中嵌入的发现 schema。

  2. 减少 tool_search 调用能提升 KV-cache 稳定性。 每次 tool_search 发现 deferred 工具都会改变 prompt prefix(系统提示中的 deferred-tools 提醒部分),从而使 LLM 服务器的 KV-cache 失效,需要完全重新计算(约 500-2000ms 延迟)。让常用工具在启动时就可见,可以消除在会话中期发现它们的需求。

  3. 现有的变通方案太粗糙了。 全局关闭 ToolSearch(tools.toolSearch.enabled: false)会让所有 deferred 工具同时可见,违背了延迟加载的初衷。每个 MCP 服务器的 alwaysLoadTools: true 只对整个服务器生效,不能选择单个工具。没有任何机制可以只让少数几个 deferred 工具在启动时可见。

附加上下文

  • 关联 tool_search invalidates 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 可作为同级键
  • 未发现针对此提议的现有 issue

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions