fix(custom-cli): le bouton Stop annule le tour courant sans fermer la session et cascade l'annulation aux agents délégués — stop_agent suit l'arbre des dépendances actives (cancel_current_turn + préemption runtime + enfants d'exécution), TurnCancel tue le process du tour en cours, autorisation requester/sous-arbre sur idea_stop_agent, fixtures DTO runtime_state/node_id alignées — #257 (QA verte)

This commit is contained in:
2026-08-28 22:57:32 +02:00
parent 9505a3305d
commit 1aabc3d702
12 changed files with 534 additions and 110 deletions

View File

@ -259,10 +259,12 @@ pub enum OrchestratorCommand {
/// Desired visibility for the launched session.
visibility: OrchestratorVisibility,
},
/// Stop a running agent by killing its terminal session.
/// Stop/cancel a running agent.
StopAgent {
/// Target agent display name.
name: String,
/// Requesting agent, when the stop originates from an agent tool.
requester: Option<AgentId>,
},
/// Overwrite an agent's `.md` context with a new body.
UpdateAgentContext {
@ -482,9 +484,11 @@ impl OrchestratorRequest {
}),
"stop_agent" => Ok(OrchestratorCommand::StopAgent {
name: self.require_name(action)?,
requester: self.optional_requester(action)?,
}),
"agent.stop" => Ok(OrchestratorCommand::StopAgent {
name: self.require_target_agent(action)?,
requester: self.optional_requester(action)?,
}),
"update_agent_context" => Ok(OrchestratorCommand::UpdateAgentContext {
name: self.require_name(action)?,
@ -965,7 +969,8 @@ mod tests {
assert_eq!(
r.validate().unwrap(),
OrchestratorCommand::StopAgent {
name: "dev-backend".to_owned()
name: "dev-backend".to_owned(),
requester: None,
}
);
}