From 66e6fb6c79e6f3d1bbc6f714ba89c8c070f83096 Mon Sep 17 00:00:00 2001 From: Hua Audio Date: Sat, 7 Mar 2026 14:17:33 +0100 Subject: [PATCH] feat(agent) fallback to reasoning content (#992) --- pkg/agent/loop.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/agent/loop.go b/pkg/agent/loop.go index e5d9c757b..9a54f5077 100644 --- a/pkg/agent/loop.go +++ b/pkg/agent/loop.go @@ -1055,9 +1055,12 @@ func (al *AgentLoop) runLLMIteration( "target_channel": al.targetReasoningChannelID(opts.Channel), "channel": opts.Channel, }) - // Check if no tool calls - we're done + // Check if no tool calls - then check reasoning content if any if len(response.ToolCalls) == 0 { finalContent = response.Content + if finalContent == "" && response.ReasoningContent != "" { + finalContent = response.ReasoningContent + } logger.InfoCF("agent", "LLM response without tool calls (direct answer)", map[string]any{ "agent_id": agent.ID,