fix: handle empty and non-JSON SSE chunks safely

This commit is contained in:
hkfires
2025-11-22 13:49:23 +08:00
parent 46b4110ff3
commit 1061354b2f
3 changed files with 6 additions and 9 deletions

View File

@@ -45,10 +45,6 @@ func ConvertAntigravityResponseToOpenAI(_ context.Context, _ string, originalReq
}
}
if len(bytes.TrimSpace(rawJSON)) == 0 {
return []string{}
}
if bytes.Equal(rawJSON, []byte("[DONE]")) {
return []string{}
}