mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-08 09:07:28 +08:00
agent: add non-empty fallback when model returns empty final content
This commit is contained in:
@@ -690,8 +690,12 @@ func (al *AgentLoop) processMessage(ctx context.Context, msg bus.InboundMessage)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if finalContent == "" {
|
if strings.TrimSpace(finalContent) == "" {
|
||||||
finalContent = ""
|
fallback := strings.TrimSpace(al.noResponseFallback)
|
||||||
|
if fallback == "" {
|
||||||
|
fallback = "在的,我刚刚这条回复丢了。请再说一次,我马上处理。"
|
||||||
|
}
|
||||||
|
finalContent = fallback
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filter out <think>...</think> content from user-facing response
|
// Filter out <think>...</think> content from user-facing response
|
||||||
|
|||||||
Reference in New Issue
Block a user