mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-07 03:00:29 +00:00
Fix OpenAI streaming returning no output for reasoning models
The SSE stream terminated prematurely when a network chunk contained only unhandled event types (e.g. response.in_progress, reasoning output_item.added). dispatch_sse_messages returned an empty vec, which the unfold interpreted as stream-end. Now continues reading when dispatch produces no StreamEvents. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
433a7c6247
commit
55b6000374
1 changed files with 6 additions and 1 deletions
|
|
@ -527,7 +527,12 @@ async fn process_next_sse_events(
|
|||
loop {
|
||||
let messages = extract_sse_messages(&mut state.buffer);
|
||||
if !messages.is_empty() {
|
||||
return Ok(dispatch_sse_messages(state, messages));
|
||||
let events = dispatch_sse_messages(state, messages);
|
||||
if !events.is_empty() {
|
||||
return Ok(events);
|
||||
}
|
||||
// All SSE messages were unhandled event types; continue reading.
|
||||
continue;
|
||||
}
|
||||
|
||||
match tokio::time::timeout(state.stream_read_timeout, state.byte_stream.next()).await {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue