mirror of
https://github.com/openai/codex.git
synced 2026-11-11 14:32:25 +00:00
Revert "[core] Support interleaved response items" (#31261)
Reverts openai/codex#30876
This commit is contained in:
1 parent
7094fa467e
commit
7b4e70d567
9 files changed
+81
-246
No files matched your search
@@ -351,11 +351,8 @@ pub fn process_responses_event(
|
||||
}
|
||||
}
|
||||
"response.reasoning_summary_text.delta" => {
|
||||
if let (Some(item_id), Some(delta), Some(summary_index)) =
|
||||
(event.item_id, event.delta, event.summary_index)
|
||||
{
|
||||
if let (Some(delta), Some(summary_index)) = (event.delta, event.summary_index) {
|
||||
return Ok(Some(ResponseEvent::ReasoningSummaryDelta {
|
||||
item_id,
|
||||
delta,
|
||||
summary_index,
|
||||
}));
|
||||
@@ -447,9 +444,8 @@ pub fn process_responses_event(
|
||||
}
|
||||
}
|
||||
"response.reasoning_summary_part.added" => {
|
||||
if let (Some(item_id), Some(summary_index)) = (event.item_id, event.summary_index) {
|
||||
if let Some(summary_index) = event.summary_index {
|
||||
return Ok(Some(ResponseEvent::ReasoningSummaryPartAdded {
|
||||
item_id,
|
||||
summary_index,
|
||||
}));
|
||||
}
|
||||
@@ -800,44 +796,6 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn preserves_reasoning_summary_item_ids() {
|
||||
let events = run_sse(vec![
|
||||
json!({
|
||||
"type": "response.reasoning_summary_part.added",
|
||||
"item_id": "reasoning-1",
|
||||
"summary_index": 0
|
||||
}),
|
||||
json!({
|
||||
"type": "response.reasoning_summary_text.delta",
|
||||
"item_id": "reasoning-1",
|
||||
"summary_index": 0,
|
||||
"delta": "Checking"
|
||||
}),
|
||||
json!({
|
||||
"type": "response.completed",
|
||||
"response": { "id": "resp1" }
|
||||
}),
|
||||
])
|
||||
.await;
|
||||
|
||||
assert_matches!(
|
||||
&events[0],
|
||||
ResponseEvent::ReasoningSummaryPartAdded {
|
||||
item_id,
|
||||
summary_index: 0,
|
||||
} if item_id == "reasoning-1"
|
||||
);
|
||||
assert_matches!(
|
||||
&events[1],
|
||||
ResponseEvent::ReasoningSummaryDelta {
|
||||
item_id,
|
||||
delta,
|
||||
summary_index: 0,
|
||||
} if item_id == "reasoning-1" && delta == "Checking"
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn error_when_missing_completed() {
|
||||
let item1 = json!({
|
||||
|
||||
Reference in new issue
Block a user