Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

test(host): wait for a routine run to finish before messaging its bot

leepokai7eb57b9d9c84
diff --git a/host/tests/routines_e2e.rs b/host/tests/routines_e2e.rs
index 7417111e..eac13c3e 100644
--- a/host/tests/routines_e2e.rs
+++ b/host/tests/routines_e2e.rs
@@ -329,7 +329,9 @@ async fn an_agent_started_for_a_run_stops_when_the_run_ends() {
let bot = host.stable_bot("only-runs").await;
let id = host.save(&bot, "one-off", "ONE_OFF", json!([{"type":"webhook"}]), 30).await;
host.call("runRoutine", json!({"botId":bot,"id":id})).await;
- host.wait_event("only-runs", "finished", "ONE_OFF").await;
+ // The run's outcome, not the agent's own "finished": a message sent before the host took the reply would wait in
+ // the queue and keep the agent running.
+ host.wait_status(&bot, &id, "succeeded").await;
host.send(&bot, "LATER").await;
host.wait_event("only-runs", "finished", "LATER").await;
let events = host.agent_events("only-runs");