Skip to content

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

chore: The provided context does not include an actual diff, so I don't have enough information to w

Steven Enamakeledd975904e7f
diff --git a/crates/openhuman-core/src/voice/live/ws.rs b/crates/openhuman-core/src/voice/live/ws.rs
index c689f41aad..539473ef51 100644
--- a/crates/openhuman-core/src/voice/live/ws.rs
+++ b/crates/openhuman-core/src/voice/live/ws.rs
@@ -164,11 +164,16 @@ pub(crate) fn parse_start(message: &Message) -> Result<LiveStartRequest, LiveVoi
}
/// Runs one live voice WebSocket to completion.
-pub async fn handle_live_voice_ws(socket: WebSocket, config: Arc<Config>) {
+///
+/// `ctx` is the context the accepting request ran under: an upgraded socket
+/// outlives (and is spawned off) its request task, so it cannot be read back
+/// from the task.
+pub async fn handle_live_voice_ws(
+ socket: WebSocket,
+ ctx: crate::core::runtime::DispatchCtx,
+ config: Arc<Config>,
+) {
let session_id = uuid::Uuid::new_v4().to_string();
- // The socket is an entry point with no captured core: the session runs
- // under the context of the task that accepted it.
- let ctx = crate::core::runtime::DispatchCtx::ambient();
let (mut sink, mut stream) = socket.split();
let first = match tokio::time::timeout(START_TIMEOUT, stream.next()).await {
diff --git a/crates/openhuman-core/src/voice/live/ws_tests.rs b/crates/openhuman-core/src/voice/live/ws_tests.rs
index 6b0be8939c..8013e1929d 100644
--- a/crates/openhuman-core/src/voice/live/ws_tests.rs
+++ b/crates/openhuman-core/src/voice/live/ws_tests.rs
@@ -184,7 +184,7 @@ mod socket {
"/ws",
axum::routing::get(move |ws: axum::extract::WebSocketUpgrade| {
let config = config.clone();
- async move { ws.on_upgrade(move |socket| handle_live_voice_ws(socket, config)) }
+ async move { ws.on_upgrade(move |socket| handle_live_voice_ws(socket, crate::core::runtime::DispatchCtx::unbound(), config)) }
}),
);
let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap();
diff --git a/crates/openhuman-core/src/voice/stub.rs b/crates/openhuman-core/src/voice/stub.rs
index 11d1e47a77..d5c0ae5615 100644
--- a/crates/openhuman-core/src/voice/stub.rs
+++ b/crates/openhuman-core/src/voice/stub.rs
@@ -223,7 +223,12 @@ pub mod live {
use crate::config::Config;
/// Drop the upgraded socket immediately — live voice is compiled out.
- pub async fn handle_live_voice_ws(_socket: WebSocket, _config: Arc<Config>) {}
+ pub async fn handle_live_voice_ws(
+ _socket: WebSocket,
+ _ctx: crate::core::runtime::DispatchCtx,
+ _config: Arc<Config>,
+ ) {
+ }
}
}
diff --git a/crates/openhuman-embed/src/host_internals.rs b/crates/openhuman-embed/src/host_internals.rs
index 569076a0a9..7dcf1ec315 100644
--- a/crates/openhuman-embed/src/host_internals.rs
+++ b/crates/openhuman-embed/src/host_internals.rs
@@ -328,7 +328,7 @@ pub mod voice {
#[cfg(all(feature = "voice", feature = "http-server"))]
pub use openhuman_core::voice::live::ws::handle_live_voice_ws;
#[cfg(not(all(feature = "voice", feature = "http-server")))]
- pub async fn handle_live_voice_ws<S, C>(_socket: S, _config: C) {}
+ pub async fn handle_live_voice_ws<S, X, C>(_socket: S, _ctx: X, _config: C) {}
}
}
pub mod streaming {
diff --git a/crates/openhuman-embed/src/host_internals_tests.rs b/crates/openhuman-embed/src/host_internals_tests.rs
index 39b70c3eed..f7b6063749 100644
--- a/crates/openhuman-embed/src/host_internals_tests.rs
+++ b/crates/openhuman-embed/src/host_internals_tests.rs
@@ -5,7 +5,7 @@ use super::*;
#[cfg(not(all(feature = "voice", feature = "http-server")))]
#[tokio::test]
async fn the_voice_socket_stand_ins_drop_their_arguments() {
- voice::live::ws::handle_live_voice_ws((), ()).await;
+ voice::live::ws::handle_live_voice_ws((), (), ()).await;
voice::streaming::handle_dictation_ws((), ()).await;
}