Skip to content

armgit / kwant

Public Imported from GitHub
0

Your own team of AI bots in one self-hosted binary: spaces, every account you have, handoffs, approvals and routines. Open-source, self-hosted alternative to Grok Bot, Claude Duet and OpenAI dots. Rust + React.

Mission Control: cli_run waits for the mission's runner slot before starting the next run

Lin (kwant bot)34bbfd1bbe5e
diff --git a/tests/mission_checkpoints_test.rs b/tests/mission_checkpoints_test.rs
index 77d2b87c..f0fcfdec 100644
--- a/tests/mission_checkpoints_test.rs
+++ b/tests/mission_checkpoints_test.rs
@@ -243,6 +243,13 @@ async fn cli_bot(e: &Env) -> String {
/// The runner starts `tid` on the stand-in CLI; waits until the turn hands it in.
async fn cli_run(e: &Env, mid: &str, tid: &str) {
+ // An earlier runner turn of this mission may still be ending after its hand-in
+ for _ in 0..200 {
+ if !kwnt::server::missions::runner::is_running(mid) {
+ break;
+ }
+ tokio::time::sleep(Duration::from_millis(50)).await;
+ }
let r = person(e, "POST", &format!("/api/missions/{mid}/run"), Some(json!({"max_tasks": 1}))).await;
assert_eq!(r["started"][0]["task_id"], tid, "{r}");
for _ in 0..300 {