Aias00 opened a new issue, #6647:
URL: https://github.com/apache/shenyu/issues/6647

   - severity: High
   - files: 
`shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-proxy/src/main/java/org/apache/shenyu/plugin/ai/proxy/enhanced/service/AiProxyExecutorService.java:88-115`;
 consumption at `AiProxyPlugin.java:171-182`
   - description: `executeStream` wraps `doChatStream` in `Retry.max(1)` then 
`.onErrorResume(NonTransientAiException.class, handleFallbackStream)`. When the 
upstream stream errors AFTER emitting some chunks, Reactor `retryWhen` 
re-subscribes, issuing a brand-new upstream call emitting from the beginning. 
Those first-attempt chunks were already written to the client SSE response, so 
the client receives `[partial attempt-1][full attempt-2]`.
   - impact: Corrupted/duplicated AI completions for streaming calls that hit a 
mid-stream error; non-idempotent streaming calls are replayed.
   - suggested_fix: For streaming, do not blanket-retry mid-stream; retry only 
before any emission (buffer-first) or fail and let the client reconnect.
   - confidence: High
   - related_existing: none — #6575/#6583 concern the generic retry plugin, not 
the AI-proxy `executeStream` Flux replay.
   
   ---
   _Identified during the 2026-08-02 deep re-scan; full list in 
[`docs/scan2-2026-08-02/00-consolidated-critical-high.md`](docs/scan2-2026-08-02/00-consolidated-critical-high.md)._


-- 
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