feat(backend,application,frontend,domain,web-server,app-tauri): bouton Redémarrer l'agent dans la barre supérieure des cellules — #317 (QA verte)
La cellule expose un bouton Redémarrer l'agent valable pour les trois modes de présentation (headless, TUI native, CLI custom), sans jamais prendre la présentation pour vérité runtime. - Application: use case RestartCellAgentRuntime validant le binding exact cellule/runtime via les snapshots live (RestartRuntimeNotFound, ConflictAgentVisibleElsewhere, AgentNotBoundToCell) puis déléguant au scheduler self-restart existant (schedule_cell); CellAgentPresentation purement informationnelle. - Backend/app-tauri/web-server: commande restart_cell_agent sur contrat DTO identique Tauri/HTTP, stop borné par timeout typé (RestartStopTimeout), relance préservant routage TUI natif, géométrie de cellule (node/rows/cols) et conversation; évenements domaine enrichis. - Frontend: bouton dans la barre de cellule avec confirmation, overlay d'état Redémarrage…/échec (libellés par code d'erreur, Fermer/ Réessayer), gardes d'identité de cellule et de restarts externes, gateway/mock/http adapters et ports alignés. - Tests: dto_agents, workstate_actions, contrats web-server, LayoutGrid.cellControlsLayering, adapters agent/mock/http. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -139,6 +139,7 @@ pub enum DomainEventDto {
|
||||
agent_id: String,
|
||||
restart_id: String,
|
||||
phase: String,
|
||||
code: String,
|
||||
message: String,
|
||||
},
|
||||
/// A project was created.
|
||||
@ -844,11 +845,13 @@ impl From<&DomainEvent> for DomainEventDto {
|
||||
agent_id,
|
||||
restart_id,
|
||||
phase,
|
||||
code,
|
||||
message,
|
||||
} => Self::AgentRestartFailed {
|
||||
agent_id: agent_id.to_string(),
|
||||
restart_id: restart_id.clone(),
|
||||
phase: restart_phase_label(*phase).to_owned(),
|
||||
code: code.clone(),
|
||||
message: message.clone(),
|
||||
},
|
||||
DomainEvent::ProjectCreated { project_id } => Self::ProjectCreated {
|
||||
@ -1427,11 +1430,13 @@ mod tests {
|
||||
agent_id: id,
|
||||
restart_id: "restart-288".to_owned(),
|
||||
phase: domain::events::AgentRestartPhase::Launching,
|
||||
code: "LAUNCH_FAILED".to_owned(),
|
||||
message: "launch failed".to_owned(),
|
||||
});
|
||||
let failed = serde_json::to_value(failed).expect("serialisable");
|
||||
assert_eq!(failed["type"], "agentRestartFailed");
|
||||
assert_eq!(failed["phase"], "launching");
|
||||
assert_eq!(failed["code"], "LAUNCH_FAILED");
|
||||
assert_eq!(failed["message"], "launch failed");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user