From 8803e283e0d505d9b60e3d529d90473721e81004 Mon Sep 17 00:00:00 2001 From: shikihane Date: Mon, 2 Mar 2026 11:20:02 +0800 Subject: [PATCH] fix(agent): publish outbound media regardless of SendResponse flag The SendResponse flag controls whether the agent loop publishes the final text response (callers that publish it themselves set this to false). However, the media publish path was also gated behind this flag, which meant tool-produced media was silently dropped for normal channel messages. Media should be published immediately when a tool returns media refs, independent of how the text response is delivered. Co-Authored-By: Claude Opus 4.6 --- pkg/agent/loop.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/agent/loop.go b/pkg/agent/loop.go index b15445c6a..40c1d411e 100644 --- a/pkg/agent/loop.go +++ b/pkg/agent/loop.go @@ -1145,7 +1145,7 @@ func (al *AgentLoop) runLLMIteration( } // If tool returned media refs, publish them as outbound media - if len(r.result.Media) > 0 && opts.SendResponse { + if len(r.result.Media) > 0 { parts := make([]bus.MediaPart, 0, len(r.result.Media)) for _, ref := range r.result.Media { part := bus.MediaPart{Ref: ref}