Skip to content

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

feat(web_chat): add acceptance tests for queued message handling

Steven Enamakele3a9caa8c51d
diff --git a/crates/openhuman-core/src/web_chat/ops/state_tests.rs b/crates/openhuman-core/src/web_chat/ops/state_tests.rs
index 3f381a4aaa..0827b6f0b9 100644
--- a/crates/openhuman-core/src/web_chat/ops/state_tests.rs
+++ b/crates/openhuman-core/src/web_chat/ops/state_tests.rs
@@ -111,5 +111,7 @@ async fn a_user_cancel_under_the_fence_placeholder_id_keeps_the_callers_client()
.await
.expect("the cancelled turn announces itself");
assert_eq!(seen, "profile-fence");
- assert!(token.is_cancelled());
+ tokio::time::timeout(std::time::Duration::from_secs(5), token.cancelled())
+ .await
+ .expect("tearing the turn down reaches its watcher");
}
diff --git a/crates/openhuman-core/src/web_chat/web_tests_queue_acceptance_tests.rs b/crates/openhuman-core/src/web_chat/web_tests_queue_acceptance_tests.rs
index fcb51760cc..af7f6e45e9 100644
--- a/crates/openhuman-core/src/web_chat/web_tests_queue_acceptance_tests.rs
+++ b/crates/openhuman-core/src/web_chat/web_tests_queue_acceptance_tests.rs
@@ -146,16 +146,19 @@ async fn interrupt_and_parallel_bypass_the_active_turn_queue() {
#[tokio::test]
async fn terminal_turn_dispatches_followup_as_a_fresh_host_turn() {
let _serial = FORCED_ERROR_TEST_LOCK.lock().await;
- let block = make_block();
+ let workspace = tempfile::tempdir().expect("workspace");
+ let block = TestRunChatTaskBlock {
+ succeed_in: Some(workspace.path().to_path_buf()),
+ ..make_block()
+ };
set_test_run_chat_task_block(Some(block.clone())).await;
let thread_id = "queue-followup-terminal";
let primary_request_id = start_parked_turn(thread_id, &block).await;
let accepted = queue_message(thread_id, "start after terminal", "followup").await;
assert_eq!(accepted["queued"], true);
- // End the primary normally from the host test seam. The queue's follow-up
- // lane is drained only after terminal handling, then `dispatch_followups`
- // must route it back through `start_chat` as a fresh in-flight turn.
+ // End the primary normally from the host test seam. The runner hands the
+ // queue's follow-up lane back as a fresh turn once the primary completed.
block.release.notify_one();
let entries = wait_for_in_flight(|entries| {
entries