diff --git a/internal/core/plugin_daemon/backwards_invocation/transaction/aws_event_handler.go b/internal/core/plugin_daemon/backwards_invocation/transaction/aws_event_handler.go index 83edf00..831cb82 100644 --- a/internal/core/plugin_daemon/backwards_invocation/transaction/aws_event_handler.go +++ b/internal/core/plugin_daemon/backwards_invocation/transaction/aws_event_handler.go @@ -8,6 +8,7 @@ import ( "github.com/gin-gonic/gin" "github.com/langgenius/dify-plugin-daemon/internal/core/plugin_daemon/backwards_invocation" + "github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager" "github.com/langgenius/dify-plugin-daemon/internal/core/session_manager" "github.com/langgenius/dify-plugin-daemon/internal/types/entities/plugin_entities" "github.com/langgenius/dify-plugin-daemon/internal/utils/log" @@ -92,6 +93,10 @@ func (h *AWSTransactionHandler) Handle( return } + // bind the backwards invocation + plugin_manager := plugin_manager.Manager() + session.BindBackwardsInvocation(plugin_manager.BackwardsInvocation()) + awsResponseWriter := NewAWSTransactionWriter(session, writer) if err := backwards_invocation.InvokeDify( diff --git a/internal/core/session_manager/session.go b/internal/core/session_manager/session.go index 8e453c1..a7adac0 100644 --- a/internal/core/session_manager/session.go +++ b/internal/core/session_manager/session.go @@ -150,6 +150,10 @@ func (s *Session) Runtime() plugin_entities.PluginLifetime { return s.runtime } +func (s *Session) BindBackwardsInvocation(backwardsInvocation dify_invocation.BackwardsInvocation) { + s.backwardsInvocation = backwardsInvocation +} + func (s *Session) BackwardsInvocation() dify_invocation.BackwardsInvocation { return s.backwardsInvocation }