Skip to content

Commit a09552a

Browse files
committed
fix: only check content
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
1 parent 1952b0d commit a09552a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tools.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,9 @@ func decisionWithStreaming(ctx context.Context, llm LLM, conversation []openai.C
324324
xlog.Debug("[decisionWithStreaming] processed", "message", content, "reasoning", reasoning)
325325

326326
if len(toolCalls) == 0 {
327-
if content == "" && reasoning != "" {
328-
// Model produced only reasoning with no visible content — retry
329-
xlog.Warn("Streaming decision produced only reasoning with no content, retrying", "attempt", attempts+1)
327+
if content == "" {
328+
// Model produced no visible content (empty response or only reasoning) — retry
329+
xlog.Warn("Streaming decision produced no content, retrying", "attempt", attempts+1)
330330
time.Sleep(time.Duration(attempts+1) * time.Second)
331331
continue
332332
}

0 commit comments

Comments
 (0)