mirror of
https://github.com/openai/codex.git
synced 2026-11-05 20:10:33 +00:00
Merge branch 'main' into jif/stabilize-generated-image-rollback
This commit is contained in:
@@ -941,6 +941,19 @@ fn normalize_string(value: &str) -> String {
|
||||
normalize_tmp_prefix_before_marker(&mut text, "/skills/");
|
||||
normalize_tmp_prefix_before_marker(&mut text, "\\skills\\");
|
||||
|
||||
let skills_open_tag = "<skills_instructions>";
|
||||
let skills_close_tag = "</skills_instructions>";
|
||||
let mut search_start = 0;
|
||||
while let Some(relative_start) = text[search_start..].find(skills_open_tag) {
|
||||
let body_start = search_start + relative_start + skills_open_tag.len();
|
||||
let Some(relative_end) = text[body_start..].find(skills_close_tag) else {
|
||||
break;
|
||||
};
|
||||
let body_end = body_start + relative_end;
|
||||
text.replace_range(body_start..body_end, "\n...\n");
|
||||
search_start = body_start + "\n...\n".len() + skills_close_tag.len();
|
||||
}
|
||||
|
||||
let mut search_start = 0;
|
||||
let wall_time_prefix = "Wall time: ";
|
||||
let wall_time_suffix = " seconds";
|
||||
@@ -964,6 +977,19 @@ fn normalize_string(value: &str) -> String {
|
||||
text
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn normalize_string_rewrites_dynamic_skill_instructions() {
|
||||
let text = normalize_string(
|
||||
"before\n<skills_instructions>\n## Skills\n- demo: Dynamic description\n\
|
||||
</skills_instructions>\nafter",
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
text,
|
||||
"before\n<skills_instructions>\n...\n</skills_instructions>\nafter"
|
||||
);
|
||||
}
|
||||
|
||||
fn is_uuid_like(value: &str) -> bool {
|
||||
let bytes = value.as_bytes();
|
||||
bytes.len() == 36
|
||||
|
||||
@@ -1120,10 +1120,22 @@ async fn encrypted_multi_agent_v2_spawn_sends_agent_message_to_child() -> Result
|
||||
|
||||
test.submit_turn(TURN_1_PROMPT).await?;
|
||||
|
||||
let child_request = wait_for_requests(&child_request_log)
|
||||
.await?
|
||||
.pop()
|
||||
.expect("child request");
|
||||
// The response mock records candidate requests before its request matcher runs, so wait for
|
||||
// the child request instead of assuming the latest recorded request is already it.
|
||||
let deadline = Instant::now() + Duration::from_secs(2);
|
||||
let child_request = loop {
|
||||
if let Some(request) = child_request_log
|
||||
.requests()
|
||||
.into_iter()
|
||||
.find(|request| !request.inputs_of_type("agent_message").is_empty())
|
||||
{
|
||||
break request;
|
||||
}
|
||||
if Instant::now() >= deadline {
|
||||
anyhow::bail!("timed out waiting for child agent message request");
|
||||
}
|
||||
sleep(Duration::from_millis(10)).await;
|
||||
};
|
||||
assert_eq!(
|
||||
strip_metadata_from_json(Value::Array(child_request.inputs_of_type("agent_message"))),
|
||||
Value::Array(vec![json!({
|
||||
|
||||
Reference in New Issue
Block a user