[Enhancement] Expose omitted tool identifiers when workflow tool catalogue falls back or is truncated

未关闭
#42,591 0 条评论 1 个 reaction 已指派 1 人 在 GitHub 查看

@liuns-yang 已经在做这个了。

开始于 2026年9月20日。

评估

这个 Issue 还没有评估数据。

描述

💪 enhancement
Self Checks
  • I have read the Contributing Guide and Language Policy.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • Please do not modify this template :) and fill in all the required fields.
1. Is this request related to a challenge you're experiencing? Tell me about your story.

When a workflow has more than 80 installed tools, the workflow generator uses tool routing to select the tools rendered into the planner prompt. If the router returns unmatched queries or raises an exception, the code falls back to select_legacy_fallback_tools() and keeps only up to 80 entries.

The current fallback logs are useful, but they mainly expose selected counts such as total, candidates, and in the unmatched-query branch pinned. They do not expose which tools were omitted from the prompt. Also, select_legacy_fallback_tools() currently returns only the selected list, so callers cannot recover the omitted entries.

This makes production troubleshooting difficult when an installed tool appears to be unavailable to the agent. It is hard to distinguish between “the tool was not installed”, “the router did not select it”, and “the tool was silently removed by fallback truncation”.

2. Additional context or comments

I would like to propose a small observability enhancement without changing tool-selection semantics:

  1. Return a structured fallback selection result containing entries, omitted_entries, pinned_count, and limit.
  2. Keep select_legacy_fallback_tools() compatible, either through a new function or a compatibility wrapper.
  3. In the fallback warning, add omitted, limit, overflow, and a capped preview such as omitted_tools, limited to 20 provider/tool identifiers to avoid log bloat.
  4. Preserve the existing fallback order, pinned-tool behavior, and rendered prompt output.
  5. Add tests for the non-truncated case, exactly 80 tools, 81 tools, pinned overflow, and successful router selection.

I checked the current main branch and found that the fallback path still does not expose omitted tool identities.

3. Can you help us with this feature?
  • I am interested in contributing to this feature.
主要语言
TypeScript
星标
157k
派生
24.7k
平均合并
22 小时 32 分钟
30 天内合并 PR
611

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

langgenius/dify 的其他 Issue

查看 langgenius/dify 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。