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(cron): account for join newlines in bounded tail budget
Steven Enamakel231affc7daca
diff --git a/crates/openhuman-core/src/cron/scheduler/origin_context.rs b/crates/openhuman-core/src/cron/scheduler/origin_context.rsindex beccdac1d5..6a45c7e295 100644--- a/crates/openhuman-core/src/cron/scheduler/origin_context.rs+++ b/crates/openhuman-core/src/cron/scheduler/origin_context.rs@@ -30,13 +30,17 @@ pub(crate) fn bounded_tail(}let line = format!("{role}: {text}");let len = line.chars().count();- if len <= remaining {- remaining -= len;+ // The `\n` that joins this line to the ones already picked counts too.+ let sep = usize::from(!picked.is_empty());+ if len + sep <= remaining {+ remaining -= len + sep;picked.push(line);continue;}- if remaining >= 80 {- let cut: String = line.chars().skip(len - (remaining - 1)).collect::<String>();+ if remaining >= 80 + sep {+ // One char for the `…` prefix and `sep` for the join newline.+ let keep = remaining - 1 - sep;+ let cut: String = line.chars().skip(len - keep).collect::<String>();picked.push(format!("…{cut}"));}break;