patch-tools

This commit is contained in:
Ahmed Ibrahim
2025-09-12 11:48:01 -04:00
parent 4fee2ca3fd
commit 1e5a613c55

View File

@@ -912,6 +912,11 @@ async fn history_dedupes_streamed_and_final_messages_across_turns() {
// Assert on the last five messages of the input history for request 3.
// We expect the conversation tail to be [U1, A, U2, A, U3], skipping earlier context and developer messages.
let r3_tail_expected = serde_json::json!([
{
"type": "message",
"role": "user",
"content": [{"type":"input_text","text":"<environment_context>\n <cwd>/Users/aibrahim/code/codex/codex-rs/core</cwd>\n <approval_policy>on-request</approval_policy>\n <sandbox_mode>read-only</sandbox_mode>\n <network_access>restricted</network_access>\n <shell>zsh</shell>\n</environment_context>"}]
},
{
"type": "message",
"role": "user",
@@ -922,6 +927,11 @@ async fn history_dedupes_streamed_and_final_messages_across_turns() {
"role": "assistant",
"content": [{"type":"output_text","text":"Hey there!\n"}]
},
{
"type": "message",
"role": "user",
"content": [{"type":"input_text","text":"<environment_context>\n <cwd>/Users/aibrahim/code/codex/codex-rs/core</cwd>\n <approval_policy>on-request</approval_policy>\n <sandbox_mode>read-only</sandbox_mode>\n <network_access>restricted</network_access>\n <shell>zsh</shell>\n</environment_context>"}]
},
{
"type": "message",
"role": "user",
@@ -932,6 +942,11 @@ async fn history_dedupes_streamed_and_final_messages_across_turns() {
"role": "assistant",
"content": [{"type":"output_text","text":"Hey there!\n"}]
},
{
"type": "message",
"role": "user",
"content": [{"type":"input_text","text":"<environment_context>\n <cwd>/Users/aibrahim/code/codex/codex-rs/core</cwd>\n <approval_policy>on-request</approval_policy>\n <sandbox_mode>read-only</sandbox_mode>\n <network_access>restricted</network_access>\n <shell>zsh</shell>\n</environment_context>"}]
},
{
"type": "message",
"role": "user",
@@ -939,8 +954,5 @@ async fn history_dedupes_streamed_and_final_messages_across_turns() {
}
]);
// skipping earlier context and developer messages
let tail_len = r3_tail_expected.as_array().unwrap().len();
let actual_tail = &r3_input_array[r3_input_array.len() - tail_len..];
assert_eq!(serde_json::json!(actual_tail), r3_tail_expected);
assert_eq!(serde_json::json!(r3_input_array), r3_tail_expected);
}