Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

test protocol: lock inter-agent commentary phase (#20046)

friel-openai05fd90457263
diff --git a/codex-rs/protocol/src/protocol.rs b/codex-rs/protocol/src/protocol.rs
index c9ff684f7c..f8c830184c 100644
--- a/codex-rs/protocol/src/protocol.rs
+++ b/codex-rs/protocol/src/protocol.rs
@@ -4019,6 +4019,28 @@ mod tests {
);
}
+ #[test]
+ fn inter_agent_communication_response_input_item_preserves_commentary_phase() {
+ let communication = InterAgentCommunication {
+ author: AgentPath::root(),
+ recipient: AgentPath::root().join("reviewer").expect("recipient path"),
+ other_recipients: vec![AgentPath::root().join("worker").expect("recipient path")],
+ content: "review the diff".to_string(),
+ trigger_turn: true,
+ };
+
+ assert_eq!(
+ communication.to_response_input_item(),
+ ResponseInputItem::Message {
+ role: "assistant".to_string(),
+ content: vec![ContentItem::OutputText {
+ text: serde_json::to_string(&communication).expect("serialize communication"),
+ }],
+ phase: Some(MessagePhase::Commentary),
+ }
+ );
+ }
+
#[test]
fn session_source_from_startup_arg_normalizes_custom_values() {
assert_eq!(