-
Notifications
You must be signed in to change notification settings - Fork 125
Description
Description
When using dynamic-select parameter type in tools or models, the plugin executor attempts to get a trigger event handler even when no trigger is registered for the plugin. This causes an unhandled exception that breaks the dynamic select functionality entirely.
Steps to Reproduce
- Create a plugin with a tool that uses
dynamic-selectparameter type - The plugin does NOT register any trigger providers
- Attempt to use the dynamic select in Dify
Expected Behavior
Dynamic select options should load correctly and allow users to select from the available options.
Actual Behavior
An exception is thrown in TriggerFactory.get_trigger_event_handler_safely() when it tries to find a trigger provider that doesn't exist, causing the dynamic select to fail.
Root Cause
The get_trigger_event_handler_safely() method in trigger_factory.py calls _get_entry() which raises a ValueError when the provider is not found. This exception was not caught, causing the entire dynamic select flow to break.
Solution
Wrap the method body in a try-except block to catch any exceptions and return None gracefully, allowing the dynamic select to function correctly even when triggers are not involved.