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

@ -492,6 +492,7 @@ pub fn map_tool_call(
},
"idea_stop_agent" => OrchestratorRequest {
request_type: Some("agent.stop".to_owned()),
requested_by: Some(requester.to_owned()),
target_agent: s("target"),
..base()
},
@ -840,7 +841,8 @@ mod tests {
assert_eq!(
map("idea_stop_agent", &json!({ "target": "Dev" })).unwrap(),
OrchestratorCommand::StopAgent {
name: "Dev".to_owned()
name: "Dev".to_owned(),
requester: None,
}
);
assert_eq!(
@ -868,6 +870,19 @@ mod tests {
);
}
#[test]
fn stop_agent_maps_handshake_requester_for_authorization() {
assert_eq!(
map_tool_call("idea_stop_agent", &json!({ "target": "Dev" }), REQ).unwrap(),
OrchestratorCommand::StopAgent {
name: "Dev".to_owned(),
requester: Some(domain::AgentId::from_uuid(
uuid::Uuid::parse_str(REQ).unwrap()
)),
}
);
}
#[test]
fn missing_required_field_surfaces_validation_error() {
let err = map("idea_update_context", &json!({ "target": "Architect" }));