Skip to content

🐛 Bugfix: Enhance ToolTestPanel to support dynamic KB selection based on tool type#2868

Merged
Dallas98 merged 1 commit intodevelopfrom
develop_fix_datamate_test
Apr 27, 2026
Merged

🐛 Bugfix: Enhance ToolTestPanel to support dynamic KB selection based on tool type#2868
Dallas98 merged 1 commit intodevelopfrom
develop_fix_datamate_test

Conversation

@Zhi-a
Copy link
Copy Markdown
Contributor

@Zhi-a Zhi-a commented Apr 27, 2026

Enhance ToolTestPanel to support dynamic KB selection based on tool type

  • Introduced kbSelectionConfig to manage knowledge base selection parameters.
  • Updated logic to determine parameter names for different tool types.
  • Merged KB selection configuration into final tool parameters to streamline processing.
image

* Introduced kbSelectionConfig to manage knowledge base selection parameters.
* Updated logic to determine parameter names for different tool types.
* Merged KB selection configuration into final tool parameters to streamline processing.
Copilot AI review requested due to automatic review settings April 27, 2026 01:31
@Zhi-a Zhi-a requested review from Dallas98 and WMC001 as code owners April 27, 2026 01:31
@Zhi-a Zhi-a changed the title Enhance ToolTestPanel to support dynamic KB selection based on tool type 🐛 Bugfix: Enhance ToolTestPanel to support dynamic KB selection based on tool type Apr 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates ToolTestPanel so knowledge base (KB) selection is passed as an init-time tool configuration parameter, with the KB parameter name chosen dynamically based on tool type (e.g., dataset_ids for Dify vs index_names for other KB-backed tools). This aligns the test/validation flow with how backend tools are instantiated during /tool/validate.

Changes:

  • Added kbSelectionConfig to represent KB selection as tool init params rather than forward inputs.
  • Selected KB parameter key dynamically (dataset_ids for dify_search, otherwise index_names).
  • Merged KB selection config into the final configs payload sent to validateTool.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +324 to +330
// Determine the correct parameter name based on tool type
if (tool?.name === "dify_search") {
kbSelectionConfig = { dataset_ids: JSON.stringify(selectedKbIds) };
} else {
// knowledge_base_search, datamate_search, idata_search use index_names
kbSelectionConfig = { index_names: selectedKbIds };
}
@Dallas98 Dallas98 merged commit 6a6d288 into develop Apr 27, 2026
12 checks passed
@Zhi-a Zhi-a deleted the develop_fix_datamate_test branch April 28, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants