fix(streaming): skip streamer acquisition when SendResponse is false

Heartbeat messages set SendResponse=false but the streaming path
was unconditionally acquiring a streamer, causing HEARTBEAT_OK to
leak to Telegram via streamer.Finalize().
This commit is contained in:
Amir Mamaghani 2026-03-04 19:25:19 +01:00
parent 9792df6fda
commit 2d5f320168

View file

@ -740,7 +740,7 @@ func (al *AgentLoop) runLLMIteration(
// Check if both the provider and channel support streaming
streamProvider, providerCanStream := agent.Provider.(providers.StreamingProvider)
var streamer bus.Streamer
if providerCanStream && !constants.IsInternalChannel(opts.Channel) {
if providerCanStream && opts.SendResponse && !constants.IsInternalChannel(opts.Channel) {
streamer, _ = al.bus.GetStreamer(ctx, opts.Channel, opts.ChatID)
}