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

## Summary
- add a regression test for
`InterAgentCommunication::to_response_input_item`
- assert replayed inter-agent messages keep `phase:
Some(MessagePhase::Commentary)`

## Test plan
- `cargo test -p codex-protocol`
- `just argument-comment-lint`
This commit is contained in:
friel-openai
2026-04-29 11:24:17 -07:00
committed by GitHub
Unverified
parent 8356806fc9
commit 05fd904572
+22
View File
@@ -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!(