Converted all external tool calling to async
This commit is contained in:
@@ -109,7 +109,7 @@ async fn start_agent_cleans_up_pending_entry_on_failure() {
|
||||
"agent must transition to Failed after worktree creation error"
|
||||
);
|
||||
|
||||
let agents = pool.agents.lock().unwrap();
|
||||
let agents = pool.agents.lock().await;
|
||||
let failed_entry = agents
|
||||
.values()
|
||||
.find(|a| a.agent_name == "coder-1" && a.status == AgentStatus::Failed);
|
||||
@@ -121,6 +121,7 @@ async fn start_agent_cleans_up_pending_entry_on_failure() {
|
||||
|
||||
let events = pool
|
||||
.drain_events("50_story_test", "coder-1")
|
||||
.await
|
||||
.expect("drain_events should succeed");
|
||||
let has_error_event = events.iter().any(|e| matches!(e, AgentEvent::Error { .. }));
|
||||
assert!(
|
||||
@@ -736,7 +737,7 @@ async fn reconcile_canonical_agents_stops_stale_coder_in_qa_stage() {
|
||||
let pool = AgentPool::new_test(3099);
|
||||
pool.inject_test_agent("777_story_reconcile", "coder-1", AgentStatus::Running);
|
||||
|
||||
let before = pool.list_agents().unwrap();
|
||||
let before = pool.list_agents().await.unwrap();
|
||||
assert!(
|
||||
before.iter().any(|a| a.agent_name == "coder-1"
|
||||
&& matches!(a.status, AgentStatus::Running | AgentStatus::Pending)),
|
||||
@@ -745,7 +746,7 @@ async fn reconcile_canonical_agents_stops_stale_coder_in_qa_stage() {
|
||||
|
||||
pool.reconcile_canonical_agents(root).await;
|
||||
|
||||
let after = pool.list_agents().unwrap();
|
||||
let after = pool.list_agents().await.unwrap();
|
||||
let still_active = after.iter().any(|a| {
|
||||
a.story_id == "777_story_reconcile"
|
||||
&& a.agent_name == "coder-1"
|
||||
@@ -786,7 +787,7 @@ async fn reconcile_canonical_agents_leaves_correct_stage_agent_alone() {
|
||||
|
||||
pool.reconcile_canonical_agents(root).await;
|
||||
|
||||
let after = pool.list_agents().unwrap();
|
||||
let after = pool.list_agents().await.unwrap();
|
||||
let still_active = after.iter().any(|a| {
|
||||
a.story_id == "555_story_correct"
|
||||
&& a.agent_name == "coder-1"
|
||||
@@ -851,7 +852,7 @@ async fn regression_1100_stale_coder_blocks_mergemaster_then_reconciler_clears()
|
||||
pool.reconcile_canonical_agents(root).await;
|
||||
|
||||
// coder-1 must be gone from the active pool.
|
||||
let remaining = pool.list_agents().unwrap();
|
||||
let remaining = pool.list_agents().await.unwrap();
|
||||
assert!(
|
||||
!remaining.iter().any(|a| {
|
||||
a.story_id == "1100_reg"
|
||||
|
||||
Reference in New Issue
Block a user