mirror of
https://github.com/langgenius/dify-plugin-sdks.git
synced 2026-07-22 02:15:22 -04:00
Dynamic select options broken when trigger throws exception #71
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Mairuis on GitHub (Jan 12, 2026).
Description
When using
dynamic-selectparameter 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
dynamic-selectparameter typeExpected 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 intrigger_factory.pycalls_get_entry()which raises aValueErrorwhen 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
Nonegracefully, allowing the dynamic select to function correctly even when triggers are not involved.@vhly commented on GitHub (Jan 20, 2026):
me too.
And I want to know "why a tool plugin 's dynamic-select parameter need query trigger"
When I add a trigger provider in tool plugin yaml, "python -m main" will down:
"An error occurred while parsing the data: b'register failed, invalid manifest detected: trigger and tool, model, endpoint, or agent_strategy cannot be provided at the same time'"