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
feat(agent): add live tool and voice error handling
Steven Enamakel994a6f1cd360
diff --git a/crates/openhuman-core/src/agent/session_host/live_tools.rs b/crates/openhuman-core/src/agent/session_host/live_tools.rsindex 7a6588e23d..f6803c6a38 100644--- a/crates/openhuman-core/src/agent/session_host/live_tools.rs+++ b/crates/openhuman-core/src/agent/session_host/live_tools.rs@@ -43,6 +43,3 @@ impl OpenHumanSessionHost {}}-#[cfg(test)]-#[path = "live_tools_tests.rs"]-mod tests;diff --git a/crates/openhuman-core/src/agent/tinyagents/live_harness.rs b/crates/openhuman-core/src/agent/tinyagents/live_harness.rsindex d4d15a9228..1db4d9ee98 100644--- a/crates/openhuman-core/src/agent/tinyagents/live_harness.rs+++ b/crates/openhuman-core/src/agent/tinyagents/live_harness.rs@@ -129,6 +129,3 @@ pub(crate) fn assemble_live_tool_harness(harness}-#[cfg(test)]-#[path = "live_harness_tests.rs"]-mod tests;diff --git a/crates/openhuman-core/src/voice/live/error.rs b/crates/openhuman-core/src/voice/live/error.rsnew file mode 100644index 0000000000..b09da4c456--- /dev/null+++ b/crates/openhuman-core/src/voice/live/error.rs@@ -0,0 +1,66 @@+//! Errors a live voice session reports to its client.++use tinyagents_live::tinyliveagents::Error as LiveError;++/// A failure with a stable, content-free `code` the UI can switch on.+#[derive(Debug, Clone, PartialEq, Eq)]+pub(crate) struct LiveVoiceError {+ pub(crate) code: &'static str,+ pub(crate) message: String,+}++impl LiveVoiceError {+ pub(crate) fn new(code: &'static str, message: impl Into<String>) -> Self {+ Self {+ code,+ message: message.into(),+ }+ }++ /// The provider needs a key or sign-in it does not have.+ pub(crate) fn not_configured(message: impl Into<String>) -> Self {+ Self::new("not_configured", message)+ }++ /// The request named something that does not exist.+ pub(crate) fn invalid(message: impl Into<String>) -> Self {+ Self::new("invalid_request", message)+ }++ /// The TinyHumans backend refused or failed.+ pub(crate) fn backend(message: impl Into<String>) -> Self {+ Self::new("backend", message)+ }++ /// Something inside the core failed (agent build, config).+ pub(crate) fn internal(message: impl Into<String>) -> Self {+ Self::new("internal", message)+ }+}++impl From<LiveError> for LiveVoiceError {+ fn from(error: LiveError) -> Self {+ let code = match &error {+ LiveError::Unauthorized => "unauthorized",+ LiveError::InsufficientCredits => "insufficient_credits",+ LiveError::RateLimited => "rate_limited",+ LiveError::Timeout => "timeout",+ LiveError::InvalidConfig(_) => "invalid_request",+ LiveError::Connect(_) => "connect",+ _ => "provider",+ };+ Self::new(code, error.to_string())+ }+}++impl std::fmt::Display for LiveVoiceError {+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {+ write!(f, "{}: {}", self.code, self.message)+ }+}++impl std::error::Error for LiveVoiceError {}++#[cfg(test)]+#[path = "error_tests.rs"]+mod tests;