fix(config,webui): make show_tool_calls one cross-channel setting
show_tool_calls gated Telegram's tool-activity narration only; the web dashboard's SSE chat stream narrated every completed tool call unconditionally with no way to turn it off, leaking tool names and parameter shapes to anyone with dashboard access even when an operator had already opted out for Telegram. Moved ShowToolCalls from TelegramConfig to ChatConfig so it is one setting for every channel, and wired the webui stream to it: chatStreamSink now carries a showToolCalls flag (snapshotted once per turn, mirroring how Telegram's liveReply snapshots it) and ToolCall no-ops when it's off. BREAKING: an existing [chat.telegram] show_tool_calls = true in config.toml now parses as an unrecognized key under [chat.telegram] and is silently ignored (TOML decoding is non-strict) rather than erroring -- move it to the top-level [chat] table.
This commit is contained in:
1 parent
15556a8a1c
commit
a60dea926f
5 files changed
+120
-28
No files matched your search
@@ -86,7 +86,7 @@ func setupTelegramGateway(ctx context.Context, s telegramSetup) (start func(), o
|
||||
configureTelegramUpdates(tg, s)
|
||||
}
|
||||
tg.Dangerous = s.Dangerous
|
||||
tg.SetShowToolCalls(cfg.Chat.Telegram.ShowToolCalls)
|
||||
tg.SetShowToolCalls(cfg.Chat.ShowToolCalls)
|
||||
tg.ReleaseAnnouncements = &releaseannounce.Announcer{
|
||||
StatePath: releaseAnnouncementStatePath(cfg.WorkDir, cfg.BotUser),
|
||||
Components: []releaseannounce.Component{
|
||||
@@ -156,7 +156,7 @@ func makeTelegramReload(s telegramSetup) func(*telegram.Gateway) error {
|
||||
}
|
||||
g.Token = token
|
||||
g.AllowedUserIDs = newCfg.Chat.Telegram.AllowedUserIDs
|
||||
g.SetShowToolCalls(newCfg.Chat.Telegram.ShowToolCalls)
|
||||
g.SetShowToolCalls(newCfg.Chat.ShowToolCalls)
|
||||
s.Log.Info("chat gateway config reloaded",
|
||||
"allowed_user_ids", len(g.AllowedUserIDs),
|
||||
"show_tool_calls", g.ShowToolCalls())
|
||||
|
||||
Reference in new issue
Block a user