Skip to content

Commit dd4ce53

Browse files
committed
[core] avoid metadata field in rollout history tests
1 parent 8a1326d commit dd4ce53

1 file changed

Lines changed: 13 additions & 14 deletions

File tree

codex-rs/core/src/rollout_history_tests.rs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ use codex_protocol::models::ResponseItem;
55
use codex_protocol::protocol::InterAgentCommunication;
66

77
fn message(role: &str, content: ContentItem) -> ResponseItem {
8-
ResponseItem::Message {
9-
id: None,
10-
role: role.to_string(),
11-
content: vec![content],
12-
phase: None,
13-
metadata: None,
14-
}
8+
serde_json::from_value(serde_json::json!({
9+
"type": "message",
10+
"role": role,
11+
"content": [content],
12+
}))
13+
.expect("message response item should deserialize")
1514
}
1615

1716
#[test]
@@ -22,13 +21,13 @@ fn classifies_user_directed_turn_boundaries() {
2221
text: "hello".to_string(),
2322
},
2423
);
25-
let agent_message = ResponseItem::AgentMessage {
26-
id: None,
27-
author: "/root".to_string(),
28-
recipient: "/root/worker".to_string(),
29-
content: Vec::new(),
30-
metadata: None,
31-
};
24+
let agent_message = serde_json::from_value(serde_json::json!({
25+
"type": "agent_message",
26+
"author": "/root",
27+
"recipient": "/root/worker",
28+
"content": [],
29+
}))
30+
.expect("agent message response item should deserialize");
3231
let instruction = InterAgentCommunication::new(
3332
AgentPath::root(),
3433
AgentPath::root().join("worker").expect("valid agent path"),

0 commit comments

Comments
 (0)