mirror of
https://github.com/ultraworkers/claw-code-parity.git
synced 2026-04-22 20:56:16 +02:00
fix(api): return final stream events directly from finish
Resolves clippy::unnecessary_wraps on StreamState::finish in openai_compat.rs. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -251,7 +251,7 @@ impl MessageStream {
|
||||
}
|
||||
|
||||
if self.done {
|
||||
self.pending.extend(self.state.finish()?);
|
||||
self.pending.extend(self.state.finish());
|
||||
if let Some(event) = self.pending.pop_front() {
|
||||
return Ok(Some(event));
|
||||
}
|
||||
@@ -421,9 +421,9 @@ impl StreamState {
|
||||
events
|
||||
}
|
||||
|
||||
fn finish(&mut self) -> Result<Vec<StreamEvent>, ApiError> {
|
||||
fn finish(&mut self) -> Vec<StreamEvent> {
|
||||
if self.message.finished {
|
||||
return Ok(Vec::new());
|
||||
return Vec::new();
|
||||
}
|
||||
self.message.finished = true;
|
||||
|
||||
@@ -472,7 +472,7 @@ impl StreamState {
|
||||
}));
|
||||
events.push(StreamEvent::MessageStop(MessageStopEvent {}));
|
||||
}
|
||||
Ok(events)
|
||||
events
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user