Skip to content

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

test(agent-harness): invalidate web-chat session after managed capture

Steven Enamakelb90da0c5ce01
diff --git a/tests/agent_harness_e2e.rs b/tests/agent_harness_e2e.rs
index b9ff84245c..ff74cc625f 100644
--- a/tests/agent_harness_e2e.rs
+++ b/tests/agent_harness_e2e.rs
@@ -1114,6 +1114,14 @@ async fn run_managed_capture_turn(
);
drop(events);
stack.shutdown_and_wait().await;
+ // The bare test router dispatches RPC with DispatchCtx::unbound(). Its
+ // cached web-chat agent outlives a router shutdown, so remove that session
+ // from the same process-default slot before the fixture resets its files.
+ openhuman_core::web_chat::invalidate_thread_sessions(
+ &openhuman_core::core::runtime::DispatchCtx::unbound(),
+ "managed-capture-thread",
+ )
+ .await;
with_captured_proxy_requests(|requests| requests.clone())
}