The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
Merge upstream/main into w5-messages
Steven Enamakel0ba23bc90c3f
diff --cc crates/openhuman-core/src/agent/README.mdindex e459a4f31e,ea4802d947..f484aa43e7--- a/crates/openhuman-core/src/agent/README.md+++ b/crates/openhuman-core/src/agent/README.md@@@ -11,7 -11,7 +11,7 @@@ Multi-agent orchestration domain. Owns- `tinytools_agent::dialect::ToolDialect` / `tinytools_agent::ParsedToolCall` / `tinytools_agent::dialect::ToolOutcome`: canonical tool-call vocabulary; `message_convert.rs` performs only concrete durable/provider conversions.- `pub mod triage` (`run_triage`, `apply_decision`, `TriggerEnvelope`, `TriageDecision`, `TriageAction`, in `triage/mod.rs`): classifies external triggers and escalates to sub-agents.- `pub mod prompts::SystemPromptBuilder` (`prompts/`): system-prompt section composer.- - `messages.rs` (`history_wire`): the `{role, content}` serde adapter for host-owned files that embed message rows (durable sub-agent sessions, pause checkpoints). Rows are `tinyagents_session::transcript::TranscriptMessage`; typed tool-call history is `tinytools_agent::dialect::TranscriptEntry`; `inference/provider/types.rs::ChatRequest` borrows `&[TranscriptMessage]`.-- `pub struct ChatMessage` / `pub enum ConversationMessage` / `pub struct ToolResultMessage` (`messages.rs`): transcript wire types.++- `messages.rs` (`history_wire`): the `{role, content}` serde adapter for host-owned files that embed message rows (durable sub-agent sessions, pause checkpoints). Rows are `tinyagents_session::transcript::TranscriptMessage`; typed tool-call history is `tinytools_agent::dialect::TranscriptEntry`.- `pub fn bus::register_agent_handlers` (`bus.rs`): registers the `agent.run_turn` native request handler (`AgentTurnRequest` -> `AgentTurnResponse`) on `BUS.native()`; called from `channels/runtime/startup/start_channels.rs`.- Built-in archetypes live in `crates/openhuman-core/src/agent/registry/agents/`; this module stays focused on harness/runtime behavior.- RPC `agent.{chat, chat_simple, server_status, list_definitions, get_definition, reload_definitions, triage_evaluate, graph_topologies, registry_snapshot}`: `schemas.rs`.diff --cc crates/openhuman-core/src/agent/multimodal.rsindex bd685e0521,7fe092921c..71791822e9--- a/crates/openhuman-core/src/agent/multimodal.rs+++ b/crates/openhuman-core/src/agent/multimodal.rs@@@ -213,25 -213,15 +213,15 @@@ pub fn count_image_markers(messages: &[.unwrap_or(0)}- /// Whether the latest user message carries any image marker.- pub fn contains_image_markers(messages: &[TranscriptMessage]) -> bool {- count_image_markers(messages) > 0- }-/// Count `[FILE:…]` markers in the **latest** user message only — same/// per-turn semantics as [`count_image_markers`].-pub fn count_file_markers(messages: &[ChatMessage]) -> usize {+pub fn count_file_markers(messages: &[TranscriptMessage]) -> usize {latest_user_message(messages).map(|m| markers::parse_file_markers(&m.content).1.len()).unwrap_or(0)}- /// Whether the latest user message carries any file marker.- pub fn contains_file_markers(messages: &[TranscriptMessage]) -> bool {- count_file_markers(messages) > 0- }--fn latest_user_message(messages: &[ChatMessage]) -> Option<&ChatMessage> {+fn latest_user_message(messages: &[TranscriptMessage]) -> Option<&TranscriptMessage> {messages.iter().rev().find(|m| m.role == "user")}diff --cc crates/openhuman-core/src/agent/multimodal_attachment_handling_tests.rsindex decc1936c3,a6590b2b0f..447cbd9524--- a/crates/openhuman-core/src/agent/multimodal_attachment_handling_tests.rs+++ b/crates/openhuman-core/src/agent/multimodal_attachment_handling_tests.rs@@@ -43,22 -43,20 +43,20 @@@ fn count_markers_only_inspects_latest_u// attached more than 1. Per-turn semantics: count only the latest// user message.let history = vec![- ChatMessage::user(+ TranscriptMessage::user("[FILE:/tmp/a.txt] [FILE:/tmp/b.txt] [FILE:/tmp/c.txt] [FILE:/tmp/d.txt]".to_string(),),- ChatMessage::assistant("ok"),- ChatMessage::user("now just one [FILE:/tmp/e.txt]".to_string()),+ TranscriptMessage::assistant("ok"),+ TranscriptMessage::user("now just one [FILE:/tmp/e.txt]".to_string()),];assert_eq!(count_file_markers(&history), 1);- assert!(contains_file_markers(&history));let history_no_new_files = vec![- ChatMessage::user("[FILE:/tmp/a.txt] [FILE:/tmp/b.txt]".to_string()),- ChatMessage::assistant("ok"),- ChatMessage::user("no attachments this turn".to_string()),+ TranscriptMessage::user("[FILE:/tmp/a.txt] [FILE:/tmp/b.txt]".to_string()),+ TranscriptMessage::assistant("ok"),+ TranscriptMessage::user("no attachments this turn".to_string()),];assert_eq!(count_file_markers(&history_no_new_files), 0);- assert!(!contains_file_markers(&history_no_new_files));// Same semantics for the image counter.let image_history = vec![diff --cc crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_tests.rsindex 2e28751a8f,a71b1f1534..c34b1876f8--- a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_tests.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_tests.rs@@@ -1,9 -1,10 +1,9 @@@use super::{ArchetypeDelegationTool, DelegationTarget, SpawnSubagentTool, SpawnWorkerThreadTool};use crate::agent::harness::definition::AgentDefinitionRegistry;use crate::agent::harness::{with_parent_context, ParentExecutionContext};-use crate::agent::messages::ChatMessage;use crate::agent::prompts::{ConnectedIntegration, ToolCallFormat};use crate::memory::conversations;- use crate::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts};+ use crate::memory::test_support::NoopMemory;use async_trait::async_trait;use parking_lot::Mutex;use serde_json::json;diff --cc crates/openhuman-core/src/agent/session_host/runtime/turn_helpers.rsindex 214d5ea828,ea64a627ee..69c5432442--- a/crates/openhuman-core/src/agent/session_host/runtime/turn_helpers.rs+++ b/crates/openhuman-core/src/agent/session_host/runtime/turn_helpers.rs@@@ -3,10 -3,8 +3,8 @@@use super::super::types::OpenHumanSessionHost;use crate::agent::error::AgentError;-use crate::agent::messages::ConversationMessage;use crate::util::truncate_with_ellipsis;- use tinytools_agent::dialect::NativeToolCall;+use tinytools_agent::dialect::TranscriptEntry;- use tinytools_agent::ParsedToolCall;impl OpenHumanSessionHost {const EVENT_ERROR_MAX_CHARS: usize = 256;diff --cc crates/openhuman-core/src/agent/session_import/live_tests.rsindex 63208373ed,0bbc419b3d..e555c77b8a--- a/crates/openhuman-core/src/agent/session_import/live_tests.rs+++ b/crates/openhuman-core/src/agent/session_import/live_tests.rs@@@ -15,18 -15,17 +15,14 @@@ use tinyagents_harness::store::{AppendSuse super::live::{dual_write_enabled, shadow_reads_enabled};use super::projector::journal_message_from_transcript as project;- use tinyagents_session::transcript::import::convert::{- journal_messages as journal_messages_with, sanitize_store_name, stream_name,-use crate::agent::messages::{- attach_chat_tool_failure_metadata, attach_chat_turn_usage_metadata,- transcript_message_from_chat, ChatMessage,--};+ use tinyagents_session::transcript::import::convert::journal_messages as journal_messages_with;use tinyagents_session::transcript::import::live::{shadow_read_compare as shadow_read_compare_with, write_live_turn as write_live_turn_with,ShadowReadOutcome,};use tinyagents_session::transcript::import::ops::store_root;- use tinyagents_session::transcript::import::types::{- JournalMessage, SessionDescriptor, NS_SESSIONS,- };+ use tinyagents_session::transcript::import::types::JournalMessage;+use tinyagents_session::transcript::TranscriptMessage;use tinyagents_session::transcript::{read_transcript, write_transcript, MessageUsage, SessionTranscript, TranscriptMeta,TranscriptToolCall, TurnUsage,