mirror of
https://github.com/langgenius/dify-plugin-sdks.git
synced 2026-07-21 18:05:30 -04:00
[PR #281] fix: handle exception in dynamic select options when trigger is not registered #281
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?
📋 Pull Request Information
Original PR: https://github.com/langgenius/dify-plugin-sdks/pull/281
Author: @Mairuis
Created: 1/12/2026
Status: 🔄 Open
Base:
main← Head:fix/dynamic-select-trigger-exception📝 Commits (1)
284878efix: handle exception in dynamic select options when trigger is not registered📊 Changes
1 file changed (+8 additions, -4 deletions)
View changed files
📝
python/dify_plugin/core/trigger_factory.py(+8 -4)📄 Description
Summary
get_trigger_event_handler_safely()that broke dynamic select optionsProblem
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. The_get_entry()method raises aValueErrorwhen the provider is not found, and this exception was not caught, breaking the entire dynamic select functionality.Solution
Wrapped the method body in a try-except block to catch any exceptions and return
Nonegracefully. This allows dynamic select to function correctly even when triggers are not involved.Closes #280
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.