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
fix(ops): handle model resolution for truncated subagent responses
Steven Enamakelaac4084e5bf7
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/mod.rs b/crates/openhuman-core/src/agent/subagent_host/ops/mod.rsindex 551ecd7e31..d0bd445c7d 100644--- a/crates/openhuman-core/src/agent/subagent_host/ops/mod.rs+++ b/crates/openhuman-core/src/agent/subagent_host/ops/mod.rs@@ -76,7 +76,3 @@ mod tests;#[cfg(test)]#[path = "../ops_dedup_tests.rs"]mod dedup_tests;--#[cfg(test)]-#[path = "../ops_truncation_tests.rs"]-mod truncation_tests;diff --git a/crates/openhuman-core/src/agent/subagent_host/ops_tests_model_resolution_tests.rs b/crates/openhuman-core/src/agent/subagent_host/ops_tests_model_resolution_tests.rsindex 6f815d977a..45a89c181f 100644--- a/crates/openhuman-core/src/agent/subagent_host/ops_tests_model_resolution_tests.rs+++ b/crates/openhuman-core/src/agent/subagent_host/ops_tests_model_resolution_tests.rs@@ -241,9 +241,6 @@ async fn typed_mode_progress_emission_is_a_noop_without_sink() {assert_eq!(outcome.iterations, 1);}-// Truncation tests live in ops_truncation_tests.rs to keep this file-// under the ~500-line guideline.-// ── resolve_subagent_source ───────────────────────────────────────────#[test]diff --git a/crates/openhuman-core/src/agent/subagent_host/ops_truncation_tests.rs b/crates/openhuman-core/src/agent/subagent_host/ops_truncation_tests.rsdeleted file mode 100644index e8141c07c7..0000000000--- a/crates/openhuman-core/src/agent/subagent_host/ops_truncation_tests.rs+++ /dev/null@@ -1,67 +0,0 @@-/// Tests for the `max_result_chars` truncation logic in `ops.rs`.-///-/// Kept in a dedicated file so `ops_tests.rs` stays under ~500 lines.-/// The logic under test lives in `run_subagent` — tests here cover the-/// char-safe truncation path directly without spinning up a provider.--#[test]-fn max_result_chars_cap_is_enforced() {- // Verify that max_result_chars truncation uses char count (not bytes)- // and produces a truncated result ending with "[...truncated]".- let cap = 10usize;- let input = "hello world this is long".to_string();- let original_chars = input.chars().count();- let mut output = input.clone();- if original_chars > cap {- let byte_offset = output- .char_indices()- .nth(cap)- .map(|(i, _)| i)- .unwrap_or(output.len());- output.truncate(byte_offset);- output.push_str("\n[...truncated]");- }- assert_eq!(&output[..10], "hello worl");- assert!(output.ends_with("[...truncated]"));-}--#[test]-fn max_result_chars_cap_is_char_safe_for_multibyte() {- // A cap landing in the middle of a multi-byte UTF-8 sequence must- // not panic. "café" has 4 chars but 'é' is 2 bytes — truncating at- // byte offset 4 with a raw String::truncate() would panic.- let cap = 3usize; // keep "caf", drop "é"- let input = "café latte".to_string();- let original_chars = input.chars().count();- let mut output = input.clone();- if original_chars > cap {- let byte_offset = output- .char_indices()- .nth(cap)- .map(|(i, _)| i)- .unwrap_or(output.len());- output.truncate(byte_offset);- output.push_str("\n[...truncated]");- }- assert_eq!(output, "caf\n[...truncated]");-}--#[test]-fn max_result_chars_not_applied_when_none() {- let cap: Option<usize> = None;- let original = "short output".to_string();- let mut output = original.clone();- if let Some(c) = cap {- let char_len = output.chars().count();- if char_len > c {- let byte_offset = output- .char_indices()- .nth(c)- .map(|(i, _)| i)- .unwrap_or(output.len());- output.truncate(byte_offset);- output.push_str("\n[...truncated]");- }- }- assert_eq!(output, original);-}