mirror of
https://github.com/openai/codex.git
synced 2026-09-09 15:58:47 +00:00
codex: avoid duplicate realtime audio transcript done
This commit is contained in:
@@ -731,6 +731,10 @@ async fn realtime_text_output_modality_requests_text_output_and_final_transcript
|
||||
"type": "response.output_text.delta",
|
||||
"delta": "world"
|
||||
}),
|
||||
json!({
|
||||
"type": "response.output_audio_transcript.done",
|
||||
"transcript": "hello world"
|
||||
}),
|
||||
json!({
|
||||
"type": "conversation.item.done",
|
||||
"item": {
|
||||
@@ -829,6 +833,15 @@ async fn realtime_text_output_modality_requests_text_output_and_final_transcript
|
||||
text: "hello world".to_string(),
|
||||
}
|
||||
);
|
||||
assert!(
|
||||
timeout(
|
||||
Duration::from_millis(200),
|
||||
mcp.read_stream_until_notification_message("thread/realtime/transcript/done"),
|
||||
)
|
||||
.await
|
||||
.is_err(),
|
||||
"should not emit duplicate transcript done from audio transcript done"
|
||||
);
|
||||
|
||||
realtime_server.shutdown().await;
|
||||
Ok(())
|
||||
|
||||
@@ -38,10 +38,6 @@ pub(super) fn parse_realtime_event_v2(payload: &str) -> Option<RealtimeEvent> {
|
||||
"response.output_text.delta" | "response.output_audio_transcript.delta" => {
|
||||
parse_transcript_delta_event(&parsed, "delta").map(RealtimeEvent::OutputTranscriptDelta)
|
||||
}
|
||||
"response.output_audio_transcript.done" => {
|
||||
parse_transcript_done_event(&parsed, "transcript")
|
||||
.map(RealtimeEvent::OutputTranscriptDone)
|
||||
}
|
||||
"input_audio_buffer.speech_started" => Some(RealtimeEvent::InputAudioSpeechStarted(
|
||||
RealtimeInputAudioSpeechStarted {
|
||||
item_id: parsed
|
||||
|
||||
Reference in New Issue
Block a user