fix(formats): ignore Responses ping stream events

This commit is contained in:
Kayphoon
2026-09-01 12:58:21 +00:00
parent 5a69cfe40d
commit 88d2b002be
2 changed files with 12 additions and 1 deletions
@@ -1840,7 +1840,7 @@ impl OpenAIResponsesProviderState {
});
self.finished = true;
}
"keepalive" => {}
"keepalive" | "ping" => {}
event_type if openai_responses_stream_event_is_known_noop(event_type) => {
self.ensure_started(report_context, &mut out);
}
@@ -1367,6 +1367,17 @@ mod tests {
.expect("keepalive should be ignored");
assert!(keepalive.is_empty());
let ping = matrix
.transform_line(
&report_context,
data_line(json!({
"type": "ping",
"cost": "0",
})),
)
.expect("provider ping should be ignored");
assert!(ping.is_empty());
for line in [
data_line(json!({
"type": "response.output_text.delta",