fix(stream): use io.EOF instead of errors.New("EOF") in SSEReader
errors.New("EOF") creates a distinct error instance that doesn't match
io.EOF, causing processRawHTTPStream to silently ignore normal stream
termination without sending a done response.
- SSEReader: return io.EOF instead of errors.New("EOF")
- processRawHTTPStream: handle io.EOF as normal completion, send done
response with usage/toolCalls (aligned with processStream behavior)
Fixes #860
This commit is contained in:
@@ -2,7 +2,6 @@ package chat
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"errors"
|
||||
"io"
|
||||
"strings"
|
||||
)
|
||||
@@ -55,5 +54,5 @@ func (r *SSEReader) ReadEvent() (*SSEEvent, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return nil, errors.New("EOF")
|
||||
return nil, io.EOF
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user