Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Stabilize thread resume and memory dual-write tests (#47817)

jif16b20547f6b1
diff --git a/codex-rs/app-server/tests/suite/v2/thread_resume.rs b/codex-rs/app-server/tests/suite/v2/thread_resume.rs
index c6ea68f725..12beecc087 100644
--- a/codex-rs/app-server/tests/suite/v2/thread_resume.rs
+++ b/codex-rs/app-server/tests/suite/v2/thread_resume.rs
@@ -5147,14 +5147,22 @@ async fn thread_resume_rejoins_running_paginated_thread_with_initial_page() -> R
responses::ev_completed("resp-1"),
]),
}],
- vec![StreamingSseChunk {
- gate: Some(running_turn_gate),
- body: responses::sse(vec![
- responses::ev_response_created("resp-2"),
- responses::ev_assistant_message("msg-2", "Done"),
- responses::ev_completed("resp-2"),
- ]),
- }],
+ vec![
+ StreamingSseChunk {
+ gate: None,
+ body: responses::sse(vec![
+ responses::ev_response_created("resp-2"),
+ responses::ev_message_item_added("msg-2", ""),
+ ]),
+ },
+ StreamingSseChunk {
+ gate: Some(running_turn_gate),
+ body: responses::sse(vec![
+ responses::ev_assistant_message("msg-2", "Done"),
+ responses::ev_completed("resp-2"),
+ ]),
+ },
+ ],
])
.await;
let codex_home = TempDir::new()?;
@@ -5218,12 +5226,14 @@ async fn thread_resume_rejoins_running_paginated_thread_with_initial_page() -> R
primary.read_stream_until_notification_message("turn/started"),
)
.await??;
+ // An assistant item starts after the user message has reached live history.
+ // The gated remainder of the response keeps the turn running during resume.
timeout(DEFAULT_READ_TIMEOUT, async {
loop {
let started: ItemStartedNotification =
primary.read_notification("item/started").await?;
if started.turn_id == running_turn.id
- && matches!(started.item, ThreadItem::UserMessage { .. })
+ && matches!(started.item, ThreadItem::AgentMessage { .. })
{
return Ok::<(), anyhow::Error>(());
}
diff --git a/codex-rs/memories/write/src/startup_dual_write_tests.rs b/codex-rs/memories/write/src/startup_dual_write_tests.rs
index 8d25d03977..430fca52c3 100644
--- a/codex-rs/memories/write/src/startup_dual_write_tests.rs
+++ b/codex-rs/memories/write/src/startup_dual_write_tests.rs
@@ -61,7 +61,9 @@ async fn dual_write_extracts_and_consolidates_into_independent_stores() -> anyho
(MemoryVersion::V2, &v2_root, "", "v2 rollout"),
] {
let store = db.memories_for_version(version).await?;
- let deadline = Instant::now() + Duration::from_secs(10);
+ // Both pipelines initialize Git workspaces and run consolidation agents.
+ // Allow for process startup under contention on Windows CI runners.
+ let deadline = Instant::now() + Duration::from_secs(60);
while store.max_consolidated_thread_count().await? == 0 {
anyhow::ensure!(
Instant::now() < deadline,