Add /agent/stop endpoint, make max active agents configurable (#5826)

This commit is contained in:
tlongwell-block
2025-11-21 09:24:19 -05:00
committed by GitHub
parent 0f8d9a7878
commit 7b787f926b
3 changed files with 40 additions and 1 deletions
+5 -1
View File
@@ -1,6 +1,7 @@
use crate::agents::extension::PlatformExtensionContext;
use crate::agents::Agent;
use crate::config::paths::Paths;
use crate::config::Config;
use crate::scheduler::Scheduler;
use crate::scheduler_trait::SchedulerTrait;
use anyhow::Result;
@@ -52,7 +53,10 @@ impl AgentManager {
pub async fn instance() -> Result<Arc<Self>> {
AGENT_MANAGER
.get_or_try_init(|| async {
let manager = Self::new(Some(DEFAULT_MAX_SESSION)).await?;
let max_sessions = Config::global()
.get_goose_max_active_agents()
.unwrap_or(DEFAULT_MAX_SESSION);
let manager = Self::new(Some(max_sessions)).await?;
Ok(Arc::new(manager))
})
.await