swarm: a soft context limit per agent, as a percent of the window, applied at turn end
This commit is contained in:
parent
c56faf9dff
commit
1e03979836
1 changed files with 214 additions and 35 deletions
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue