Converted all external tool calling to async
This commit is contained in:
@@ -5,7 +5,6 @@ use std::path::Path;
|
||||
use crate::config::ProjectConfig;
|
||||
use crate::pipeline_state::Stage;
|
||||
use crate::slog;
|
||||
use crate::slog_error;
|
||||
|
||||
use super::super::super::PipelineStage;
|
||||
use super::super::AgentPool;
|
||||
@@ -80,13 +79,7 @@ impl AgentPool {
|
||||
if *stage == PipelineStage::Coder
|
||||
&& let Some(max) = config.max_coders
|
||||
{
|
||||
let agents_lock = match self.agents.lock() {
|
||||
Ok(a) => a,
|
||||
Err(e) => {
|
||||
slog_error!("[auto-assign] Failed to lock agents: {e}");
|
||||
break;
|
||||
}
|
||||
};
|
||||
let agents_lock = self.agents.lock().await;
|
||||
let active = count_active_agents_for_stage(config, &agents_lock, stage);
|
||||
if active >= max {
|
||||
slog!(
|
||||
@@ -102,13 +95,7 @@ impl AgentPool {
|
||||
// stage_mismatch=true means the preferred agent's stage doesn't match the
|
||||
// pipeline stage, so we fell back to a generic stage agent.
|
||||
let (already_assigned, free_agent, preferred_busy, stage_mismatch) = {
|
||||
let agents = match self.agents.lock() {
|
||||
Ok(a) => a,
|
||||
Err(e) => {
|
||||
slog_error!("[auto-assign] Failed to lock agents: {e}");
|
||||
break;
|
||||
}
|
||||
};
|
||||
let agents = self.agents.lock().await;
|
||||
let assigned = is_story_assigned_for_stage(config, &agents, story_id, stage);
|
||||
if assigned {
|
||||
(true, None, false, false)
|
||||
|
||||
Reference in New Issue
Block a user