From 7123be251a2192b239ee54b1b94355f2189a15e2 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 f0f207d3c..2beacc127 100644 --- a/pkg/agent/loop.go +++ b/pkg/agent/loop.go @@ -1149,7 +1149,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}