Skip to content

test(mlx-stream): cover degraded-emission recovery in the streaming path - #323

Merged
dahai80 merged 1 commit into
mainfrom
test/textemit-recover-streaming
Nov 24, 2026
Merged

dahai80 merged 1 commit into
mainfrom
test/textemit-recover-streaming

Conversation

@dahai80

@dahai80 dahai80 commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #321. That PR's tests exercised only transformMLXResponseToAnthropic (non-streaming). The streaming generator transformMLXStreamToAnthropic runs the same extractToolCallsFromText pass after the SSE loop ends, so a degraded call_<hex>{...} slip split across two content chunks must recover identically.

Test

SSE-simulation: stream the slip id and JSON body as separate delta.content chunks, assert the emitted tool_use block (name Read) and input_json_delta payload. 28 pass / 0 fail in the file; no source change.

🤖 Generated with Claude Code

PR #321 added call_<hex> recovery to extractToolCallsFromText but only
exercised the non-streaming transform. The streaming generator applies
the same extraction after the SSE loop ends, so a slip split across two
content chunks must also recover. Adds an SSE-simulation test streaming
the slip id and JSON body in separate deltas, asserting the emitted
tool_use block and input_json_delta payload.

Co-Authored-By: Claude Code <[email protected]>
@dahai80
dahai80 merged commit f6fd9fa into main Nov 24, 2026
1 check passed
@dahai80
dahai80 deleted the test/textemit-recover-streaming branch November 24, 2026 03:02
@dahai80 dahai80 mentioned this pull request Nov 24, 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.

1 participant