Skip to content

Ignore Anthropic SSE [DONE] sentinel - #692

Open
karatarassul4-max wants to merge 1 commit into
huggingface:mainfrom
karatarassul4-max:fix/anthropic-done-sse
Open

karatarassul4-max wants to merge 1 commit into
huggingface:mainfrom
karatarassul4-max:fix/anthropic-done-sse

Conversation

@karatarassul4-max

Copy link
Copy Markdown
Contributor

Follow-up to #679 and #680.

GitHub Copilot's Anthropic-compatible proxy can terminate a stream with data: [DONE] instead of an Anthropic message_stop event. The Anthropic SSE parser currently forwards that sentinel to the JSON decoder, which turns it into Provider returned invalid JSON chunk.

This change:

  • ignores the [DONE] SSE sentinel in the Anthropic parser, alongside blank data: frames
  • adds a focused regression test using httpx.MockTransport that completes successfully when the stream ends with data: [DONE]

The change is intentionally scoped to the Anthropic-compatible path reported in #679.

@lmstud

lmstud commented Sep 8, 2026 •

Copy link
Copy Markdown

I can confirm this fixes the error and allows the use of claude-sonnet-5 model via github-copilot including tool calls.

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.

2 participants