Skip to content

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

refactor(channels): simplify scope handling and test setup

Steven Enamakel1e524108617e
diff --git a/crates/openhuman-core/src/channels/routes.rs b/crates/openhuman-core/src/channels/routes.rs
index a384744da8..7c96a4e704 100644
--- a/crates/openhuman-core/src/channels/routes.rs
+++ b/crates/openhuman-core/src/channels/routes.rs
@@ -301,9 +301,7 @@ fn configured_control_channel(
ctx: &ChannelRuntimeContext,
scope: Option<&tinychannels_bus::module_remote::RemoteSessionScope>,
) -> Option<Box<tinychannels_bus::module_control::ConfiguredControlChannel>> {
- let Some(scope) = scope else {
- return None;
- };
+ let scope = scope?;
let account = scope.channel.account_id.as_deref()?;
let channel = ctx.channels_by_name.get(account)?;
if tinychannels_bus::provider_id(channel.name()) != scope.channel.id {
diff --git a/crates/openhuman-core/src/channels/tests/runtime_dispatch.rs b/crates/openhuman-core/src/channels/tests/runtime_dispatch.rs
index 52e2eff0b8..cecec8db11 100644
--- a/crates/openhuman-core/src/channels/tests/runtime_dispatch.rs
+++ b/crates/openhuman-core/src/channels/tests/runtime_dispatch.rs
@@ -130,9 +130,8 @@ async fn message_dispatch_processes_messages_in_parallel() {
async fn process_channel_message_sends_typing_before_the_provider_reply() {
let _bus_guard = use_real_agent_handler().await;
crate::core::bus::init().await.expect("bus init");
- let _builtins =
- crate::agent::harness::host_definition::AgentDefinitionRegistry::init_global_builtins()
- .expect("built-in host agent definitions should load");
+ crate::agent::harness::host_definition::AgentDefinitionRegistry::init_global_builtins()
+ .expect("built-in host agent definitions should load");
let linked = linked_telegram_runtime().await;
let channels_by_name = linked.channels();