Skip to content

feat: add retry logic for empty LLM responses (CLI-49)#565

Merged
dwash96 merged 4 commits into
cecli-dev:v0.100.6from
szmania:cli-49-add-empty-llm-responses-to-retries
Jun 8, 2026
Merged

feat: add retry logic for empty LLM responses (CLI-49)#565
dwash96 merged 4 commits into
cecli-dev:v0.100.6from
szmania:cli-49-add-empty-llm-responses-to-retries

Conversation

@szmania

@szmania szmania commented Jun 7, 2026

Copy link
Copy Markdown

This PR implements retry logic for scenarios where the LLM returns an empty response.

Previously, an empty response would result in an error and immediate termination of the cecli execution. Now, users can enable retries for these cases via a new configuration option.

Changes:

  • Added --retry-on-empty argument to cecli/args.py (default: False).
  • Introduced EmptyResponseError in cecli/coders/base_coder.py to specifically handle empty LLM responses.
  • Updated send_message in cecli/coders/base_coder.py to catch EmptyResponseError and perform retries if --retry-on-empty is enabled, using the existing exponential backoff strategy.
  • Modified response handling in cecli/coders/base_coder.py to detect empty responses and raise EmptyResponseError.

This ensures better resilience when dealing with flaky LLM providers or local models (like Ollama) that might occasionally time out or return empty content.

Fixes CLI-49

Your Name added 2 commits June 6, 2026 13:22
Co-authored-by: cecli (openai/gemini_cli_local/gemini-2.5-pro)
@szmania szmania marked this pull request as draft June 7, 2026 20:43
@szmania

szmania commented Jun 7, 2026

Copy link
Copy Markdown
Author

drafted, need one more update

Your Name added 2 commits June 7, 2026 14:14
Co-authored-by: cecli (openai/gemini_cli_local/gemini-2.5-pro)
Co-authored-by: cecli (openai/gemini_cli_local/gemini-2.5-pro)
@szmania szmania marked this pull request as ready for review June 7, 2026 21:26
@szmania

szmania commented Jun 7, 2026

Copy link
Copy Markdown
Author

this is ready

@dwash96 dwash96 merged commit 67bfa6f into cecli-dev:v0.100.6 Jun 8, 2026
1 check passed
@dwash96 dwash96 mentioned this pull request Jun 8, 2026
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.

2 participants