File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,13 +5,12 @@ use codex_protocol::models::ResponseItem;
55use codex_protocol:: protocol:: InterAgentCommunication ;
66
77fn 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" ) ,
You can’t perform that action at this time.
0 commit comments