mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
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:
committed by
GitHub
Unverified
parent
8356806fc9
commit
05fd904572
@@ -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!(
|
||||
|
||||
Reference in New Issue
Block a user