Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(json_rpc): gate forced completion on cron prompt

Steven Enamakelce28fdc0a424
diff --git a/tests/json_rpc_e2e.rs b/tests/json_rpc_e2e.rs
index 2d11374551..568901a203 100644
--- a/tests/json_rpc_e2e.rs
+++ b/tests/json_rpc_e2e.rs
@@ -2273,7 +2273,13 @@ async fn json_rpc_cron_origin_delivery_lands_in_the_asking_thread_inner() {
let mut delivered_ids: Vec<String> = Vec::new();
for round in 0..2i64 {
- push_forced_chat_completion(forced_text_completion(&format!("Drink water! #{round}")));
+ // Gate on the cron prompt: an unconditional FIFO entry can be taken by
+ // any other chat request in the process (a background call after the
+ // first turn), which delivered the mock default instead of this reply.
+ push_forced_chat_completion_when(
+ "Remind the user to drink water.",
+ forced_text_completion(&format!("Drink water! #{round}")),
+ );
let run = post_json_rpc(
&rpc_base,
10 + round,