From af6bdca14f492565bfe88aa2e46575bd40f664d4 Mon Sep 17 00:00:00 2001 From: Luis Pater Date: Fri, 9 Jan 2026 23:41:50 +0800 Subject: [PATCH] Fixed: #942 fix(executor): ignore non-SSE lines in OpenAI-compatible streams --- internal/runtime/executor/openai_compat_executor.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/runtime/executor/openai_compat_executor.go b/internal/runtime/executor/openai_compat_executor.go index 60c80f9d..78b787dd 100644 --- a/internal/runtime/executor/openai_compat_executor.go +++ b/internal/runtime/executor/openai_compat_executor.go @@ -241,6 +241,11 @@ func (e *OpenAICompatExecutor) ExecuteStream(ctx context.Context, auth *cliproxy if len(line) == 0 { continue } + + if !bytes.HasPrefix(line, []byte("data:")) { + continue + } + // OpenAI-compatible streams are SSE: lines typically prefixed with "data: ". // Pass through translator; it yields one or more chunks for the target schema. chunks := sdktranslator.TranslateStream(ctx, to, from, req.Model, bytes.Clone(opts.OriginalRequest), translated, bytes.Clone(line), ¶m)