Skip to content

fix(loop): retry empty final LLM responses before fallback#120

Merged
alexk-dev merged 4 commits intomainfrom
fix/empty-llm-response-retries
Feb 25, 2026
Merged

fix(loop): retry empty final LLM responses before fallback#120
alexk-dev merged 4 commits intomainfrom
fix/empty-llm-response-retries

Conversation

@alexk-dev
Copy link
Owner

Summary

  • add retry logic in DefaultToolLoopSystem for empty final LLM responses (null/blank without tool calls): up to 2 retries (3 attempts total)
  • classify persistent empty final responses as structured LLM validation failures and set LLM_ERROR with detailed diagnostics
  • keep voice-only responses (voiceRequested / voiceText) out of empty-response retries to avoid false positives
  • keep response preparation strict for final-ready empty responses and emit system.error.llm instead of generic fallback
  • add fallback reason classification in FeedbackGuaranteeSystem logs for easier production triage
  • extend tests in DefaultToolLoopSystemTest and OutgoingResponsePreparationSystemTest to cover retries, recovery, and failure classification

@sonarqubecloud
Copy link

@alexk-dev alexk-dev merged commit b52646a into main Feb 25, 2026
17 checks passed
@alexk-dev alexk-dev deleted the fix/empty-llm-response-retries branch February 25, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant