Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

chore: files changed crates/openhuman-core/src/agent/context_breakdown.rs,crates/openhuman-core/src/

Steven Enamakel0ab9aae1f36f
diff --git a/crates/openhuman-core/src/agent/context_breakdown.rs b/crates/openhuman-core/src/agent/context_breakdown.rs
index 8f26cbf736..036ae188f9 100644
--- a/crates/openhuman-core/src/agent/context_breakdown.rs
+++ b/crates/openhuman-core/src/agent/context_breakdown.rs
@@ -204,10 +204,9 @@ pub async fn context_breakdown(
let total_est_tokens: usize = sections.iter().map(|s| s.est_tokens).sum();
let provider = crate::inference::provider::provider_for_role("chat", &config);
- let context_window = crate::inference::model_context::context_window_for_route(
- &provider,
- &report.model,
- ).unwrap_or(0);
+ let context_window =
+ crate::inference::model_context::context_window_for_route(&provider, &report.model)
+ .unwrap_or(0);
let response = ContextBreakdownResponse {
agent_id: report.agent.clone(),
diff --git a/crates/openhuman-core/src/inference/context_window.rs b/crates/openhuman-core/src/inference/context_window.rs
index ea11f8e9c4..695826ea6f 100644
--- a/crates/openhuman-core/src/inference/context_window.rs
+++ b/crates/openhuman-core/src/inference/context_window.rs
@@ -86,7 +86,10 @@ pub(crate) fn remembered_window(provider: &str, model: &str) -> Option<u64> {
remembered()
.lock()
.unwrap_or_else(std::sync::PoisonError::into_inner)
- .get(&(provider.trim().to_ascii_lowercase(), model.trim().to_ascii_lowercase()))
+ .get(&(
+ provider.trim().to_ascii_lowercase(),
+ model.trim().to_ascii_lowercase(),
+ ))
.copied()
}
@@ -94,7 +97,13 @@ fn remember_window(provider: &str, model: &str, window: u64) {
remembered()
.lock()
.unwrap_or_else(std::sync::PoisonError::into_inner)
- .insert((provider.trim().to_ascii_lowercase(), model.trim().to_ascii_lowercase()), window);
+ .insert(
+ (
+ provider.trim().to_ascii_lowercase(),
+ model.trim().to_ascii_lowercase(),
+ ),
+ window,
+ );
}
/// Logs a static guess at `warn` the first time per model, `debug` after.