mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-13 04:27: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 == "" {
|
||||
finalContent = ""
|
||||
if strings.TrimSpace(finalContent) == "" {
|
||||
fallback := strings.TrimSpace(al.noResponseFallback)
|
||||
if fallback == "" {
|
||||
fallback = "在的,我刚刚这条回复丢了。请再说一次,我马上处理。"
|
||||
}
|
||||
finalContent = fallback
|
||||
}
|
||||
|
||||
// Filter out <think>...</think> content from user-facing response
|
||||
|
||||
Reference in New Issue
Block a user