Fix: remove agent from pool immediately on completion and add Matrix bot user allowlist

This commit is contained in:
Dave
2026-02-25 14:59:20 +00:00
parent 93eaac3ab9
commit ebcd627a45
5 changed files with 140 additions and 296 deletions

View File

@@ -127,20 +127,6 @@ async fn main() -> Result<(), std::io::Error> {
let app = build_routes(ctx);
// Background reaper: periodically remove completed/failed agent entries
// that have exceeded the TTL.
{
let reaper_agents = Arc::clone(&startup_agents);
let ttl = std::time::Duration::from_secs(agents::DEFAULT_AGENT_TTL_SECS);
tokio::spawn(async move {
// Check every 5 minutes.
let interval = std::time::Duration::from_secs(300);
loop {
tokio::time::sleep(interval).await;
reaper_agents.reap_expired_agents(ttl);
}
});
}
// Optional Matrix bot: connect to the homeserver and start listening for
// messages if `.story_kit/bot.toml` is present and enabled.