fix(streaming): guard streamer for non-sendable messages, add streaming config
Skip streamer acquisition for heartbeat (NoHistory=true), preventing HEARTBEAT_OK from leaking to Telegram via streamer.Finalize(). Add streaming.enabled to Telegram defaults and example config.
This commit is contained in:
parent
2d5f320168
commit
55e2466a68
3 changed files with 6 additions and 2 deletions
|
|
@ -56,7 +56,10 @@
|
||||||
"allow_from": [
|
"allow_from": [
|
||||||
"YOUR_USER_ID"
|
"YOUR_USER_ID"
|
||||||
],
|
],
|
||||||
"reasoning_channel_id": ""
|
"reasoning_channel_id": "",
|
||||||
|
"streaming": {
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"discord": {
|
"discord": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
|
|
|
||||||
|
|
@ -740,7 +740,7 @@ func (al *AgentLoop) runLLMIteration(
|
||||||
// Check if both the provider and channel support streaming
|
// Check if both the provider and channel support streaming
|
||||||
streamProvider, providerCanStream := agent.Provider.(providers.StreamingProvider)
|
streamProvider, providerCanStream := agent.Provider.(providers.StreamingProvider)
|
||||||
var streamer bus.Streamer
|
var streamer bus.Streamer
|
||||||
if providerCanStream && opts.SendResponse && !constants.IsInternalChannel(opts.Channel) {
|
if providerCanStream && !opts.NoHistory && !constants.IsInternalChannel(opts.Channel) {
|
||||||
streamer, _ = al.bus.GetStreamer(ctx, opts.Channel, opts.ChatID)
|
streamer, _ = al.bus.GetStreamer(ctx, opts.Channel, opts.ChatID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,7 @@ func DefaultConfig() *Config {
|
||||||
Enabled: true,
|
Enabled: true,
|
||||||
Text: "Thinking... 💭",
|
Text: "Thinking... 💭",
|
||||||
},
|
},
|
||||||
|
Streaming: StreamingConfig{Enabled: true},
|
||||||
},
|
},
|
||||||
Feishu: FeishuConfig{
|
Feishu: FeishuConfig{
|
||||||
Enabled: false,
|
Enabled: false,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue