mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Make submission operations move-only (#37901)
## What changed - Remove `Clone` from `Submission` and remove `Clone` and `PartialEq` from `Op`. - Consume operations directly in the submission loop instead of cloning them. - Limit thread-manager test capture to the operation variants under test and update assertions to compare their relevant fields. GitOrigin-RevId: 781cc631391b8583d94dad5ca45f589856c0b21a
This commit is contained in:
1 parent
1549756b78
commit
ab3b4d26d4
7 files changed
+155
-70
No files matched your search
@@ -2621,27 +2621,31 @@ async fn send_input_accepts_structured_items() {
|
||||
.await
|
||||
.expect("send_input should succeed");
|
||||
|
||||
let expected = Op::UserInput {
|
||||
items: vec![
|
||||
UserInput::Mention {
|
||||
name: "drive".to_string(),
|
||||
path: "app://google_drive".to_string(),
|
||||
},
|
||||
UserInput::Text {
|
||||
text: "read the folder".to_string(),
|
||||
text_elements: Vec::new(),
|
||||
},
|
||||
],
|
||||
final_output_json_schema: None,
|
||||
responsesapi_client_metadata: None,
|
||||
additional_context: Default::default(),
|
||||
thread_settings: Default::default(),
|
||||
};
|
||||
let captured = manager
|
||||
.captured_ops()
|
||||
.into_iter()
|
||||
.find(|(id, op)| *id == agent_id && *op == expected);
|
||||
assert_eq!(captured, Some((agent_id, expected)));
|
||||
let expected_items = vec![
|
||||
UserInput::Mention {
|
||||
name: "drive".to_string(),
|
||||
path: "app://google_drive".to_string(),
|
||||
},
|
||||
UserInput::Text {
|
||||
text: "read the folder".to_string(),
|
||||
text_elements: Vec::new(),
|
||||
},
|
||||
];
|
||||
assert!(manager.captured_ops().iter().any(|(id, op)| {
|
||||
*id == agent_id
|
||||
&& matches!(
|
||||
op,
|
||||
Op::UserInput {
|
||||
items,
|
||||
final_output_json_schema: None,
|
||||
responsesapi_client_metadata: None,
|
||||
additional_context,
|
||||
thread_settings,
|
||||
} if items == &expected_items
|
||||
&& additional_context.is_empty()
|
||||
&& thread_settings == &Default::default()
|
||||
)
|
||||
}));
|
||||
|
||||
let _ = thread
|
||||
.thread
|
||||
|
||||
Reference in new issue
Block a user