Skip to content

Fix empty Anthropic SSE data frames - #680

Open
karatarassul4-max wants to merge 2 commits into
huggingface:mainfrom
karatarassul4-max:fix/anthropic-empty-sse
Open

Fix empty Anthropic SSE data frames#680
karatarassul4-max wants to merge 2 commits into
huggingface:mainfrom
karatarassul4-max:fix/anthropic-empty-sse

Conversation

@karatarassul4-max

Copy link
Copy Markdown

Motivation

GitHub Copilot can emit empty SSE data: frames on the Anthropic Messages API path. Tau currently turns those frames into an empty string and passes them to the JSON decoder, which surfaces Provider returned invalid JSON chunk.

Partially addresses #679.

Changes

  • ignore blank SSE lines and empty data: payloads in tau_ai.anthropic._parse_sse_line
  • add a focused regression test using httpx.MockTransport that keeps streaming successfully across an empty data: frame

This keeps the change limited to the provider streaming layer, consistent with Tau's architecture.

The separate empty tool_use.name error reported in #679 is not addressed by this patch.

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