mirror of
https://github.com/openai/codex.git
synced 2026-10-28 18:58:46 +00:00
codex: address PR review feedback (#15106)
This commit is contained in:
@@ -134,16 +134,9 @@ impl EventProcessorWithJsonOutput {
|
||||
ThreadItem::AgentMessage { text, .. } => {
|
||||
ThreadItemDetails::AgentMessage(AgentMessageItem { text })
|
||||
}
|
||||
ThreadItem::Reasoning {
|
||||
summary, content, ..
|
||||
} => {
|
||||
let text = if content.is_empty() {
|
||||
summary.join("\n")
|
||||
} else {
|
||||
content.join("\n")
|
||||
};
|
||||
ThreadItemDetails::Reasoning(ReasoningItem { text })
|
||||
}
|
||||
ThreadItem::Reasoning { summary, .. } => ThreadItemDetails::Reasoning(ReasoningItem {
|
||||
text: summary.join("\n"),
|
||||
}),
|
||||
ThreadItem::CommandExecution {
|
||||
command,
|
||||
aggregated_output,
|
||||
|
||||
@@ -194,6 +194,37 @@ fn command_execution_started_and_completed_translate_to_thread_events() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn reasoning_items_emit_summary_not_raw_content() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
|
||||
let collected =
|
||||
processor.collect_thread_events(TypedExecEvent::ItemCompleted(ItemCompletedNotification {
|
||||
item: ThreadItem::Reasoning {
|
||||
id: "reasoning-1".to_string(),
|
||||
summary: vec!["safe summary".to_string()],
|
||||
content: vec!["raw reasoning".to_string()],
|
||||
},
|
||||
thread_id: "thread-1".to_string(),
|
||||
turn_id: "turn-1".to_string(),
|
||||
}));
|
||||
|
||||
assert_eq!(
|
||||
collected,
|
||||
CollectedThreadEvents {
|
||||
events: vec![ThreadEvent::ItemCompleted(ItemCompletedEvent {
|
||||
item: ExecThreadItem {
|
||||
id: "reasoning-1".to_string(),
|
||||
details: ThreadItemDetails::Reasoning(crate::exec_events::ReasoningItem {
|
||||
text: "safe summary".to_string(),
|
||||
}),
|
||||
},
|
||||
})],
|
||||
status: CodexStatus::Running,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn web_search_completion_preserves_query_and_action() {
|
||||
let mut processor = EventProcessorWithJsonOutput::new(None);
|
||||
|
||||
Reference in New Issue
Block a user