Skip to content

Fix #237: handle empty and failed streaming responses - #316

Open
joei4cm wants to merge 1 commit into
CopilotKit:mainfrom
joei4cm:fix/237-stream-empty-and-errors
Open

joei4cm wants to merge 1 commit into
CopilotKit:mainfrom
joei4cm:fix/237-stream-empty-and-errors

Conversation

@joei4cm

@joei4cm joei4cm commented Dec 2, 2026

Copy link
Copy Markdown

Closes #237.

generateStream now tracks non-blank text deltas: empty or whitespace-only streams throw EmptyModelResponseError, provider failures rethrow instead of being yielded as content, and the pipeline converts only the empty-response case into the suppressed handoff while provider/transport failures still propagate for worker retry. Partial drafts stay buffered, so a mid-stream failure cannot publish half an answer.

Tests:

  • AI targeted Vitest — 215/215 passed
  • AI typecheck, ESLint, Prettier, git diff --check passed
  • Built-in medium code-review, two rounds, no remaining findings

🤖 Generated with Claude Code

Co-Authored-By: Claude Code <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

generateStream: no empty-response guard, no fallback, and a raw provider error yielded as content

1 participant