refactor(runtime): merge bus context and handled tool delivery

This commit is contained in:
Hoshina
2026-04-07 21:05:53 +08:00
parent 168b75ae21
commit 718a5e7c75
5 changed files with 217 additions and 2 deletions
+4 -1
View File
@@ -2682,7 +2682,10 @@ turnLoop:
allResponsesHandled = false
}
if !toolResult.Silent && toolResult.ForUser != "" && ts.opts.SendResponse {
shouldSendForUser := !toolResult.Silent &&
toolResult.ForUser != "" &&
(ts.opts.SendResponse || toolResult.ResponseHandled)
if shouldSendForUser {
al.bus.PublishOutbound(ctx, outboundMessageForTurn(ts, toolResult.ForUser))
logger.DebugCF("agent", "Sent tool result to user",
map[string]any{