fix(TASK-044): streaming response.incomplete parity — keep partial output, record usage
Review findings: the streaming arm now mirrors the non-streaming twin (openai_extract_responses): partial text/tool calls are returned rather than discarded by a hard error; only an empty truncated response bails. Billed usage on truncated turns is recorded before either outcome. Also: CHANGELOG notes the streaming-incomplete surfacing and corrects the include/strict phrasing (sent on every responses-wire body).
This commit is contained in:
3 files changed
+69
-1
No files matched your search
@@ -215,6 +215,14 @@ impl SseHandler {
|
||||
!self.buffer.is_empty() || !self.tool_calls.is_empty() || !self.thinking.is_empty()
|
||||
}
|
||||
|
||||
/// Whether visible output (text or tool calls) has been accumulated.
|
||||
/// Unlike [`Self::has_received_content`], thinking blocks do not count:
|
||||
/// a stream truncated before any visible output is still an empty
|
||||
/// response to the caller.
|
||||
pub fn has_received_visible_output(&self) -> bool {
|
||||
!self.buffer.is_empty() || !self.tool_calls.is_empty()
|
||||
}
|
||||
|
||||
pub fn abort(&self) -> AbortSignal {
|
||||
self.abort_signal.clone()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user