Skip to content

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

Merge remote-tracking branch 'upstream/main' into tinywallet-release-0192

Steven Enamakel64f9e58fef47
diff --cc crates/openhuman-core/src/channels/routes_tests.rs
index 75963cffac,eddaf7e7b4..84ff481b1d
--- a/crates/openhuman-core/src/channels/routes_tests.rs
+++ b/crates/openhuman-core/src/channels/routes_tests.rs
@@@ -503,48 -514,130 +514,176 @@@ async fn handle_runtime_command_telegra
assert_eq!(sent[0].thread_ts.as_deref(), Some("42"));
}
+ #[tokio::test]
+ #[ignore = "blocked on the linked tinychannels-module fixture (tinybus epic, #7739)"]
+ async fn handle_runtime_command_telegram_new_status_and_sessions_round_trip() {
+ let tempdir = tempfile::tempdir().unwrap();
+ let ctx = runtime_context(tempdir.path().to_path_buf());
+ let channel_impl = Arc::new(RecordingChannel::default());
+ let channel: Arc<dyn Channel> = channel_impl.clone();
+ let sender_key = "telegram_alice_chat-remote";
+
+ ctx.conversation_histories.lock().unwrap().insert(
+ sender_key.to_string(),
+ vec![ChatMessage::user("old history")],
+ );
+
+ let new_msg = ChannelMessage {
+ id: "1".into(),
+ sender: "alice".into(),
+ reply_target: "chat-remote".into(),
+ content: "/new".into(),
+ channel: "telegram".into(),
+ timestamp: 0,
+ thread_ts: Some("42".into()),
+ sender_name: None,
+ };
+ assert!(
+ handle_runtime_command_if_needed(
+ &ctx,
+ &new_msg,
+ Some(&channel),
+ &conversation_history_key(&new_msg)
+ )
+ .await
+ );
+ assert!(ctx
+ .conversation_histories
+ .lock()
+ .unwrap()
+ .get(sender_key)
+ .is_none());
+
+ ctx.conversation_histories
+ .lock()
+ .unwrap()
+ .insert(sender_key.to_string(), vec![ChatMessage::user("after new")]);
+ set_route_selection(
+ &ctx,
+ sender_key,
+ ChannelRouteSelection {
+ provider: "anthropic".into(),
+ model: "claude-3".into(),
+ },
+ );
+
+ let subscriber = ChannelTurnStateSubscriber::new(tempdir.path().to_path_buf());
+ subscriber
+ .handle(&DomainEvent::ChannelMessageReceived {
+ channel: "telegram".into(),
+ message_id: "2".into(),
+ sender: "alice".into(),
+ reply_target: "chat-remote".into(),
+ content: "work".into(),
+ thread_ts: Some("42".into()),
+ inbound_envelope: None,
+ workspace_dir: tempdir.path().to_path_buf(),
+ })
+ .await;
+
+ let status_msg = ChannelMessage {
+ id: "3".into(),
+ sender: "alice".into(),
+ reply_target: "chat-remote".into(),
+ content: "/status".into(),
+ channel: "telegram".into(),
+ timestamp: 0,
+ thread_ts: Some("42".into()),
+ sender_name: None,
+ };
+ assert!(
+ handle_runtime_command_if_needed(
+ &ctx,
+ &status_msg,
+ Some(&channel),
+ &conversation_history_key(&status_msg)
+ )
+ .await
+ );
+
+ let sessions_msg = ChannelMessage {
+ id: "4".into(),
+ sender: "alice".into(),
+ reply_target: "chat-remote".into(),
+ content: "/sessions".into(),
+ channel: "telegram".into(),
+ timestamp: 0,
+ thread_ts: Some("42".into()),
+ sender_name: None,
+ };
+ assert!(
+ handle_runtime_command_if_needed(
+ &ctx,
+ &sessions_msg,
+ Some(&channel),
+ &conversation_history_key(&sessions_msg)
+ )
+ .await
+ );
+
+ let sent = channel_impl.sent.lock().unwrap();
+ assert_eq!(sent.len(), 3);
+ assert!(sent[0].content.contains("Started new session"));
+ assert!(sent[0]
+ .content
+ .contains("In-memory channel history cleared for this chat."));
+
+ assert!(sent[1].content.contains("**Status**"));
+ assert!(sent[1].content.contains("Thread: `Telegram"));
+ assert!(sent[1].content.contains("Provider: `anthropic`"));
+ assert!(sent[1].content.contains("Model: `claude-3`"));
+ assert!(sent[1].content.contains("In-memory turns: 1"));
+ assert!(sent[1].content.contains("Turn: in progress"));
+
+ assert!(sent[2].content.contains("**Recent sessions**"));
+ assert!(sent[2].content.contains("→ `Telegram"));
+ assert!(sent
+ .iter()
+ .all(|message| message.thread_ts.as_deref() == Some("42")));
+ }
++
+#[tokio::test]
+async fn handle_runtime_command_telegram_new_reports_unavailable_storage() {
+ let tempdir = tempfile::tempdir().unwrap();
+ let ctx = runtime_context(tempdir.path().to_path_buf());
+ let channel_impl = Arc::new(RecordingChannel::default());
+ let channel: Arc<dyn Channel> = channel_impl.clone();
+ let sender_key = "telegram_alice_chat-remote";
+
+ ctx.conversation_histories.lock().unwrap().insert(
+ sender_key.to_string(),
+ vec![ChatMessage::user("old history")],
+ );
+
+ let msg = ChannelMessage {
+ id: "1".into(),
+ sender: "alice".into(),
+ reply_target: "chat-remote".into(),
+ content: "/new".into(),
+ channel: "telegram".into(),
+ timestamp: 0,
+ thread_ts: Some("42".into()),
+ sender_name: None,
+ };
+ assert!(
+ handle_runtime_command_if_needed(
+ &ctx,
+ &msg,
+ Some(&channel),
+ &conversation_history_key(&msg)
+ )
+ .await
+ );
+ let sent = channel_impl.sent.lock().unwrap();
+ assert_eq!(sent.len(), 1);
+ assert!(
+ sent[0].content.contains("Created thread"),
+ "{}",
+ sent[0].content
+ );
+ assert!(sent[0]
+ .content
+ .contains("failed to persist the chat binding"));
+ assert!(sent[0].content.contains("host storage is unavailable"));
+ assert_eq!(sent[0].thread_ts.as_deref(), Some("42"));
+}
diff --cc scripts/ci/self-hosted/lanes-plan.mjs
index 1544b7a9be,97a7b78740..2f81cec451
--- a/scripts/ci/self-hosted/lanes-plan.mjs
+++ b/scripts/ci/self-hosted/lanes-plan.mjs
@@@ -476,10 -479,9 +479,10 @@@ export function buildPlan({ profile, ar
when: gateSmoke,
run:
"cargo test --manifest-path Cargo.toml -p openhuman --no-default-features" +
- " --features modules,mcp,e2e-test-support,flows,storage-sqlite,web3,hosting --lib --" +
- " modules::host:: modules::registry:: modules::ops::components_tests::" +
- " mcp::server::resources:: storage::import::tinyflows::" +
- " tools::implementations::network::tests:: test_support::introspect::",
+ " --features modules,mcp,e2e-test-support --lib --" +
+ " modules::host:: modules::registry:: modules::storage_grant_tinywallet::" +
++ " modules::storage_grant_tinyconnectors::" +
+ " mcp::server::resources:: test_support::introspect::",
},
{
name: "kernel-floor",