fix: case where agent is already closed (#15163)

This commit is contained in:
jif-oai
2026-03-19 12:12:50 +00:00
committed by GitHub
parent 70cdb17703
commit 32d2df5c1e
2 changed files with 16 additions and 14 deletions

View File

@@ -68,17 +68,13 @@ impl ToolHandler for Handler {
return Err(collab_agent_error(agent_id, err));
}
};
let result = if !matches!(status, AgentStatus::Shutdown) {
session
.services
.agent_control
.close_agent(agent_id)
.await
.map_err(|err| collab_agent_error(agent_id, err))
.map(|_| ())
} else {
Ok(())
};
let result = session
.services
.agent_control
.close_agent(agent_id)
.await
.map_err(|err| collab_agent_error(agent_id, err))
.map(|_| ());
session
.send_event(
&turn,