Watch
0
0
Fork
You've already forked hyperhive
0

swarm: a soft context limit per agent, as a percent of the window, applied at turn end

This commit is contained in:
damocles 2026-11-15 15:13:50 +01:00 • committed by mara
commit 1e03979836

View file

@ -20,7 +20,8 @@
//! A failed read changes nothing. Until the first successful read after a
//! start, the agent runs on its local values.
//!
//! `subagent_models` and `max_subagents` are not read here.
//! `subagent_models` and `max_subagents` are not read here. `soft_context_percent`
//! is handed to the Bus, which the compaction policy reads at turn end.
use std::time::Duration;
@ -143,6 +144,7 @@ pub async fn run(bus: Bus) {
loop {
if let Some(read) = read(&client, &agent).await {
overridden.apply(&read, &target);
target.bus.set_soft_context_percent(read.soft_context_percent);
}
tokio::time::sleep(POLL_INTERVAL).await;
}
@ -229,6 +231,7 @@ mod tests {
effort,
subagent_models: None,
max_subagents: None,
soft_context_percent: None,
}
}