Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

chore(agent): log natural-stop candidate when no tool calls

wizardchen1d3bd8bb1391
diff --git a/internal/agent/think.go b/internal/agent/think.go
index 1b1f1a441..8c4f899da 100644
--- a/internal/agent/think.go
+++ b/internal/agent/think.go
@@ -358,8 +358,14 @@ func (e *AgentEngine) callLLMWithRetry(
logger.Infof(ctx, "[Agent][Round-%d] LLM responded: finish=%s, content=%d chars, tools=%v",
round, response.FinishReason, len(response.Content), tcNames)
} else {
- logger.Infof(ctx, "[Agent][Round-%d] LLM responded: finish=%s, content=%d chars",
+ logger.Infof(ctx, "[Agent][Round-%d] LLM responded: finish=%s, content=%d chars, tool_calls=0",
round, response.FinishReason, len(response.Content))
+ // Early signal for natural-stop path: this round will be analyzed as a
+ // likely final answer (no tool call branch).
+ if response.FinishReason == "stop" {
+ logger.Infof(ctx, "[Agent][Round-%d] Natural-stop candidate detected (finish=stop, tool_calls=0, content=%d chars)",
+ round, len(response.Content))
+ }
}
if response.Content != "" {
preview := response.Content