Skip to content

fix: retry when LLM generates empty text in GeneratingRunResult#572

Merged
FL4TLiN3 merged 2 commits intomainfrom
fix/empty-run-result-retry
Feb 18, 2026
Merged

fix: retry when LLM generates empty text in GeneratingRunResult#572
FL4TLiN3 merged 2 commits intomainfrom
fix/empty-run-result-retry

Conversation

@FL4TLiN3
Copy link
Contributor

Summary

  • Fix bug where completeRun event has text: "" when LLM generates no visible text (only reasoning/thinking) in GeneratingRunResult state
  • Add empty text retry guard matching the existing pattern in GeneratingToolCall (line 180: if (toolCalls.length === 0 && text))
  • When text is empty, retry with a prompt asking for a text response; stop with EmptyRunResult error if retries are exhausted

Test plan

  • Updated existing test: handles undefined text from LLM by using empty stringretries when LLM generates empty text (expects retry event)
  • Added new test: returns stopRunByError when empty text retries exceed maxRetries
  • All 1099 unit tests pass
  • Typecheck passes
  • Biome format/lint clean

🤖 Generated with Claude Code

FL4TLiN3 and others added 2 commits February 18, 2026 08:16
The GeneratingRunResult state did not handle the case where the LLM
returns empty text after attemptCompletion. This caused completeRun
events with text: "" which is a bug. Now retries with a prompt asking
for a text response, matching the pattern in GeneratingToolCall.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@FL4TLiN3 FL4TLiN3 enabled auto-merge (squash) February 18, 2026 08:50
@FL4TLiN3 FL4TLiN3 merged commit 1b05e92 into main Feb 18, 2026
11 checks passed
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