zhang-arvin opened a new pull request, #7022:
URL: https://github.com/apache/shenyu/pull/7022

   Fixes #7021
   
   ## Problem
   When the main AI provider emits partial SSE content and then fails 
mid-stream, the `executeStream` method uses `retryWhen(Retry.max(1))` to retry 
the main provider. This causes:
   1. The main provider re-starts streaming from the beginning, emitting new 
content
   2. After retries are exhausted, the fallback provider also emits content
   3. Result: the client receives mixed content from multiple providers
   
   ## Fix
   Remove the `retryWhen` from the streaming path. For streaming, retrying 
after partial content has already been emitted to the client is always 
problematic. Instead, immediately fall back to the fallback provider on any 
error.
   
   ## Changes
   - 
`shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-proxy/src/main/java/org/apache/shenyu/plugin/ai/proxy/enhanced/service/AiProxyExecutorService.java`:
 Removed `retryWhen` from `executeStream` method, replaced with direct 
`onErrorResume` to fallback provider


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to