From 337dfe960a8c75df9906a5b85ed21643b47c1d4c Mon Sep 17 00:00:00 2001 From: stevef Date: Mon, 20 Apr 2026 11:55:28 +0200 Subject: [PATCH] Fix potential infinite loop in reaction tool by marking results as handled. --- pkg/tools/integration/reaction.go | 5 +++-- pkg/tools/shell.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/tools/integration/reaction.go b/pkg/tools/integration/reaction.go index 5a8dc87be..c87e020be 100644 --- a/pkg/tools/integration/reaction.go +++ b/pkg/tools/integration/reaction.go @@ -81,7 +81,8 @@ func (t *ReactionTool) Execute(ctx context.Context, args map[string]any) *ToolRe } return &ToolResult{ - ForLLM: fmt.Sprintf("Reaction added to %s:%s message %s", channel, chatID, messageID), - Silent: true, + ForLLM: fmt.Sprintf("Reaction added to %s:%s message %s", channel, chatID, messageID), + Silent: true, + ResponseHandled: true, } } diff --git a/pkg/tools/shell.go b/pkg/tools/shell.go index 7a5770145..866828099 100644 --- a/pkg/tools/shell.go +++ b/pkg/tools/shell.go @@ -41,7 +41,7 @@ type ExecTool struct { allowPatterns []*regexp.Regexp customAllowPatterns []*regexp.Regexp allowedPathPatterns []*regexp.Regexp - denyWritePaths []*regexp.Regexp + denyWritePaths []*regexp.Regexp restrictToWorkspace bool allowRemote bool sessionManager *SessionManager