mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-10 18:14:50 +08:00
Same fix asff416ffbut for the streaming path. Some backends embed an error JSON object in an SSE data: frame: data: {"error":{"message":"context too long","code":400}} parse_sse_frame() was attempting to deserialize this as ChatCompletionChunk and failing with 'missing field' / 'invalid type', hiding the actual backend error message. Fix: check for an 'error' key before full chunk deserialization, same as the non-streaming path inff416ff. Symmetric pair: -ff416ff: non-streaming path (response body) - this: streaming path (SSE data: frame) 115 api + 159 CLI tests pass. Fmt clean.