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
chore: files changed crates/openhuman-core/src/agent/tinyagents/harness_context_ladder.rs,crates/ope
Steven Enamakel435ae1f35d7b
diff --git a/crates/openhuman-core/src/agent/tinyagents/harness_context_ladder.rs b/crates/openhuman-core/src/agent/tinyagents/harness_context_ladder.rsindex e56df30109..5832899150 100644--- a/crates/openhuman-core/src/agent/tinyagents/harness_context_ladder.rs+++ b/crates/openhuman-core/src/agent/tinyagents/harness_context_ladder.rs@@ -261,10 +261,12 @@ pub(super) fn compression_policy(context_window = ?window,"[context_compression] compaction trigger override active");- let base = window.map(summarization_policy).unwrap_or(SummarizationPolicy {- keep_last: DEFAULT_SUMMARIZE_KEEP_LAST,- ..SummarizationPolicy::default()- });+ let base = window+ .map(summarization_policy)+ .unwrap_or(SummarizationPolicy {+ keep_last: DEFAULT_SUMMARIZE_KEEP_LAST,+ ..SummarizationPolicy::default()+ });Some(base.with_trigger_override(tokens))}None => window.map(summarization_policy),diff --git a/crates/openhuman-core/src/agent/tinyagents/mod.rs b/crates/openhuman-core/src/agent/tinyagents/mod.rsindex 4ba9a69379..fb745ecb57 100644--- a/crates/openhuman-core/src/agent/tinyagents/mod.rs+++ b/crates/openhuman-core/src/agent/tinyagents/mod.rs@@ -19,9 +19,9 @@//! `ask_user_clarification` early-exit pause are all re-wired onto the//! tinyagents harness.+mod compaction_carry;pub mod config;pub mod discovery;-mod compaction_carry;mod embeddings;mod harness_assembly;mod harness_context_ladder;@@ -68,6 +68,7 @@ pub(crate) use crate::agent::message_convert::chat_message_to_message;#[cfg(feature = "flows")]pub(crate) use crate::agent::message_convert::{reasoning_from_content, ta_call_to_oh_call};+pub(crate) use compaction_carry::{last_user_message, CompactionCarry};#[allow(unused_imports)] // Wired into the recall/retrieval facade in workstream 09.2.pub(crate) use embeddings::ProviderEmbeddingModel;pub(crate) use middleware::{@@ -78,7 +79,6 @@ pub(crate) use reasoning::{apply_requested_effort, parse_reasoning_effort};pub(crate) use topology::all_graph_topologies;pub use turn_models::TurnModelSource;pub(crate) use turn_models::TurnModels;-pub(crate) use compaction_carry::{last_user_message, CompactionCarry};pub(crate) use turn_outcome::{HaltSummarySlot, TinyagentsTurnOutcome, ToolCallOutcome, ToolOutcomeSink,};diff --git a/crates/openhuman-core/src/config/schema/load_env_overlay_context_tests.rs b/crates/openhuman-core/src/config/schema/load_env_overlay_context_tests.rsindex 046b8a5466..4ecf4f11d5 100644--- a/crates/openhuman-core/src/config/schema/load_env_overlay_context_tests.rs+++ b/crates/openhuman-core/src/config/schema/load_env_overlay_context_tests.rs@@ -81,3 +81,26 @@ fn env_overlay_context_tool_result_budget_env_wins_over_legacy_migration() {"env value wins; legacy migration suppressed");}++#[test]+fn env_overlay_compaction_trigger_tokens_sets_and_clears_the_override() {+ assert_eq!(Config::default().context.compaction_trigger_tokens, None);++ let mut cfg = Config::default();+ cfg.apply_env_overlay_with(+ &HashMapEnv::new().with("OPENHUMAN_COMPACTION_TRIGGER_TOKENS", " 64000 "),+ );+ assert_eq!(cfg.context.compaction_trigger_tokens, Some(64_000));++ // `0` clears an override set in config.toml.+ cfg.apply_env_overlay_with(&HashMapEnv::new().with("OPENHUMAN_COMPACTION_TRIGGER_TOKENS", "0"));+ assert_eq!(cfg.context.compaction_trigger_tokens, None);++ // Garbage is ignored (leaves the prior value untouched).+ let mut cfg = Config::default();+ cfg.context.compaction_trigger_tokens = Some(10);+ cfg.apply_env_overlay_with(+ &HashMapEnv::new().with("OPENHUMAN_COMPACTION_TRIGGER_TOKENS", "lots"),+ );+ assert_eq!(cfg.context.compaction_trigger_tokens, Some(10));+}diff --git a/crates/openhuman-core/src/inference/context_window.rs b/crates/openhuman-core/src/inference/context_window.rsindex be9c0e5a2d..ea473dac09 100644--- a/crates/openhuman-core/src/inference/context_window.rs+++ b/crates/openhuman-core/src/inference/context_window.rs@@ -131,9 +131,15 @@ fn default_fetcher() -> Box<dyn ModelListingFetcher> {}#[cfg(not(test))]{- Box::new(tinyinference_llm::model::discover::ReqwestListingFetcher::new(- crate::config::build_runtime_proxy_client_with_timeouts("inference.model_limits", 5, 3),- ))+ Box::new(+ tinyinference_llm::model::discover::ReqwestListingFetcher::new(+ crate::config::build_runtime_proxy_client_with_timeouts(+ "inference.model_limits",+ 5,+ 3,+ ),+ ),+ )}}diff --git a/crates/openhuman-core/src/inference/context_window_tests.rs b/crates/openhuman-core/src/inference/context_window_tests.rsindex 0aae582374..9d204768cf 100644--- a/crates/openhuman-core/src/inference/context_window_tests.rs+++ b/crates/openhuman-core/src/inference/context_window_tests.rs@@ -78,7 +78,12 @@ fn openrouter_config(tmp: &TempDir) -> Config {config}-async fn resolve(fetcher: &FakeFetcher, cache: &ModelLimitsCache, config: &Config, model: &str) -> ResolvedWindow {+async fn resolve(+ fetcher: &FakeFetcher,+ cache: &ModelLimitsCache,+ config: &Config,+ model: &str,+) -> ResolvedWindow {resolve_context_window_with(fetcher,cache,@@ -94,7 +99,8 @@ async fn resolve(fetcher: &FakeFetcher, cache: &ModelLimitsCache, config: &Confiasync fn deepseek_v41_flash_uses_provider_window_not_static_128k() {let tmp = TempDir::new().unwrap();let config = openrouter_config(&tmp);- let fetcher = FakeFetcher::default().with(&format!("{OPENROUTER}/models"), openrouter_listing());+ let fetcher =+ FakeFetcher::default().with(&format!("{OPENROUTER}/models"), openrouter_listing());let cache = ModelLimitsCache::default();// The static tables guess 128k for any `deepseek` id ...@@ -118,7 +124,8 @@ async fn deepseek_v41_flash_uses_provider_window_not_static_128k() {async fn second_resolution_is_served_from_cache() {let tmp = TempDir::new().unwrap();let config = openrouter_config(&tmp);- let fetcher = FakeFetcher::default().with(&format!("{OPENROUTER}/models"), openrouter_listing());+ let fetcher =+ FakeFetcher::default().with(&format!("{OPENROUTER}/models"), openrouter_listing());let cache = ModelLimitsCache::default();resolve(&fetcher, &cache, &config, V41_FLASH).await;resolve(&fetcher, &cache, &config, V41_FLASH).await;@@ -189,7 +196,13 @@ async fn unknown_model_without_provider_data_is_unknown() {"vendor/totally-unknown-xyz",).await;- assert_eq!(resolved, ResolvedWindow { window: None, source: WindowSource::Unknown });+ assert_eq!(+ resolved,+ ResolvedWindow {+ window: None,+ source: WindowSource::Unknown+ }+ );}#[tokio::test]diff --git a/crates/openhuman-core/src/inference/provider/factory.rs b/crates/openhuman-core/src/inference/provider/factory.rsindex 5b4d86b8ee..2a0dc7d137 100644--- a/crates/openhuman-core/src/inference/provider/factory.rs+++ b/crates/openhuman-core/src/inference/provider/factory.rs@@ -57,8 +57,8 @@ pub use chat_model::{create_chat_model_with_model_id, probe_inference_readiness,};pub(crate) use credentials::openai_bearer_is_oauth;-pub(crate) use discovery::model_limits_request;pub use credentials::{auth_key_for_slug, lookup_key_for_slug, redact_endpoint};+pub(crate) use discovery::model_limits_request;pub(crate) use local_runtime::create_local_chat_model_from_string;pub(crate) use managed_backend::make_openhuman_backend_model;pub(crate) use routing::role_uses_implicit_cloud_fallback;