dify - ✅(Solved) Fix feat: add tool plugin param dynamic-tree-select support tree param [2 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
langgenius/dify#35837Fetched 2026-05-07 03:54:33
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
1
Author
Participants
Timeline (top)
cross-referenced ×2labeled ×1

Fix Action

Fixed

PR fix notes

PR #35839: feat: add tool plugin param dynamic tree select

Description (problem / solution / changelog)

Summary

Fixes #35837

The tool plugin parameter system currently lacks support for dynamic tree-select parameters with hierarchical data structures. Users need the ability to filter and select from tree-like data (e.g., nested categories, organizational hierarchies) with support for multiple selection.

This PR adds a new parameter type dynamic-tree-select that supports dynamic loading of hierarchical options with multi-select capability.

Changes

  1. api/core/plugin/entities/tool.py — Add dynamic-tree-select to ToolParameterType enum and add children field to ToolParameterOption model for hierarchical data support
  2. api/core/plugin/manager/tool.py — Add fetch_dynamic_tree_options method to fetch dynamic tree options from plugin daemon
  3. api/controllers/console/workspace/tool.py — New API endpoint GET /workspaces/current/tool-provider/dynamic-tree-options for fetching dynamic tree options
  4. web/app/components/workflow/nodes/tool/components/form-input-dynamic-tree-select.tsx — New React component for tree-select UI with multi-select support
  5. web/app/components/workflow/nodes/tool/components/form-input-item.tsx — Integrate FormInputDynamicTreeSelect component, add isDynamicTreeSelect type check, implement normalizeDynamicTreeSelectValue and filterVisibleTreeOptions helpers
  6. web/service/use-plugins.ts — Add useFetchDynamicTreeOptions hook for fetching dynamic tree options
  7. web/i18n/en-US/common.ts & web/i18n/zh-CN/common.ts — Add i18n translations for tree-select placeholder and loading states

Key constraint

The new dynamic-tree-select parameter type is designed to work with the existing plugin system. It extends the current dynamic-select pattern by adding hierarchical children support in options. The parameter supports:

  • Dynamic loading of tree data from plugin endpoints
  • Multiple selection mode (configurable via isMultipleSelect)
  • Visibility control via show_on conditions for each node
  • Cascading selection behavior consistent with standard tree-select UX

Test plan

  • make lint passes
  • Frontend type check passes (tsc --noEmit)
  • Unit tests for filterVisibleTreeOptions helper function
  • Manual verification: create a tool with dynamic-tree-select parameter, verify options load dynamically, confirm multi-select works correctly
  • Verify backward compatibility with existing dynamic-select parameters

Changed files

  • api/controllers/console/workspace/plugin.py (modified, +38/-0)
  • api/core/entities/parameter_entities.py (modified, +1/-0)
  • api/core/plugin/entities/parameters.py (modified, +9/-0)
  • api/core/tools/entities/tool_entities.py (modified, +1/-0)
  • api/services/plugin/plugin_parameter_service.py (modified, +45/-44)
  • api/services/tools/builtin_tools_manage_service.py (modified, +55/-0)
  • api/tests/test_containers_integration_tests/services/plugin/test_plugin_parameter_service.py (modified, +35/-53)
  • api/tests/unit_tests/controllers/console/workspace/test_plugin.py (modified, +19/-0)
  • api/tests/unit_tests/core/entities/test_entities_parameter_entities.py (modified, +1/-0)
  • web/app/components/header/account-setting/model-provider-page/declarations.ts (modified, +2/-0)
  • web/app/components/tools/utils/to-form-schema.ts (modified, +9/-10)
  • web/app/components/workflow/nodes/_base/components/__tests__/form-input-dynamic-tree-select.spec.tsx (added, +100/-0)
  • web/app/components/workflow/nodes/_base/components/__tests__/form-input-item.helpers.spec.ts (modified, +20/-0)
  • web/app/components/workflow/nodes/_base/components/form-input-dynamic-tree-select.tsx (added, +266/-0)
  • web/app/components/workflow/nodes/_base/components/form-input-item.helpers.ts (modified, +19/-3)
  • web/app/components/workflow/nodes/_base/components/form-input-item.tsx (modified, +81/-3)
  • web/app/components/workflow/nodes/tool/default.ts (modified, +2/-1)
  • web/service/use-plugins.ts (modified, +48/-12)

PR #725: Feat/add param dynamic tree select

Description (problem / solution / changelog)

Description

Add dynamic-tree-select parameter type support to the plugin daemon, enabling tool/trigger/agent-strategy parameters to render hierarchical tree-structured options with dynamic loading. This is the plugin-daemon counterpart of the Dify main repo change in #35837.

Fixes langgenius/dify#35837

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Performance improvement
  • Other

Essential Checklist

Testing

  • I have tested the changes locally and confirmed they work as expected
  • I have added unit tests where necessary and they pass successfully

Bug Fix (if applicable)

  • I have used GitHub syntax to close the related issue (e.g., Fixes #123 or Closes #123)

Additional Information

Changes

  1. pkg/entities/plugin_entities/constant.go — Add DYNAMIC_TREE_SELECT = "dynamic-tree-select" constant and Children []ParameterOption field to ParameterOption struct for hierarchical data support
  2. pkg/entities/plugin_entities/tool_declaration.go — Add TOOL_PARAMETER_TYPE_DYNAMIC_TREE_SELECT constant and register it in isToolParameterType validator
  3. pkg/entities/plugin_entities/trigger_declaration.go — Add EVENT_PARAMETER_TYPE_DYNAMIC_TREE_SELECT constant and register it in isEventParameterType validator
  4. pkg/entities/plugin_entities/agent_declaration.go — Add AGENT_STRATEGY_PARAMETER_TYPE_DYNAMIC_TREE_SELECT constant and register it in isAgentStrategyParameterType validator
  5. pkg/entities/requests/dynamic_select.go — Add Parent *string field to RequestDynamicParameterSelect for lazy-loading child nodes

Key design

  • The new dynamic-tree-select type extends the existing dynamic-select pattern by adding a children field to ParameterOption, enabling recursive tree structures
  • The optional parent field in the request allows plugins to implement lazy-loading of child nodes on demand
  • The parameter type is registered across tool, trigger, and agent-strategy parameter systems for consistency

Changed files

  • pkg/entities/plugin_entities/agent_declaration.go (modified, +5/-3)
  • pkg/entities/plugin_entities/constant.go (modified, +7/-5)
  • pkg/entities/plugin_entities/tool_declaration.go (modified, +5/-3)
  • pkg/entities/plugin_entities/trigger_declaration.go (modified, +4/-2)
  • pkg/entities/requests/dynamic_select.go (modified, +1/-0)
RAW_BUFFERClick to expand / collapse

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.

I tried to use tree menu param on the configuration page to filter precise matches, but I couldn't find any existing parameter support, also i want the param support multiple selection.

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING