feat(mcp,orchestrator,frontend): tool idea_restart_self, redemarrage autonome d'un agent — #288 (tool core self-only via requester MCP handshake, retour immediat {restartId, status: scheduled} puis orchestration detachee: snapshot reprise, stop PTY/structured, liberation Busy/mailbox, relance LaunchAgent meme conversation_id fresh_start=false, injection interne invisible; events domain/wire agentRestartRequested/PhaseChanged/Completed/Failed phases stopping/releasingInput/launching/resuming; CLI custom: separateurs exacts redemarrage de l'agent + etat termine/echoue, deduplication (restartId, event), verrouillage composer; TUI native: overlay AgentRestartOverlay sans injection xterm, progress/annonces projetes jusqu'a idle; QA verte: mcp_server restart_self 1/1, restart-self 3/3, backend self_restart_contract + events wire 2/2, frontend 3 suites 92/92, npm build, cargo check --workspace, fmt --check, diff --check; reserves hors perimetre: web-server 103/110 fixture PTY preexistante, 34 echecs npm test globaux listProjectSettings/web hors #288; scripts/ hors perimetre)

This commit is contained in:
2026-09-08 22:04:18 +02:00
parent ee259dc93a
commit 63537572b8
23 changed files with 1207 additions and 37 deletions

View File

@ -280,6 +280,12 @@ export interface EmbeddedServerStatus {
}
/** A domain event relayed from the backend (tagged union on `type`). */
export type AgentRestartPhase =
| "stopping"
| "releasingInput"
| "launching"
| "resuming";
export type DomainEvent =
| { type: "projectCreated"; projectId: string }
| { type: "pluginInstalled"; pluginId: string; version: string }
@ -317,6 +323,26 @@ export type DomainEvent =
}
| { type: "agentProfileChanged"; agentId: string; profileId: string }
| { type: "agentBusyChanged"; agentId: string; busy: boolean }
| {
type: "agentRestartRequested";
agentId: string;
restartId: string;
reason: string | null;
}
| {
type: "agentRestartPhaseChanged";
agentId: string;
restartId: string;
phase: AgentRestartPhase;
}
| { type: "agentRestartCompleted"; agentId: string; restartId: string }
| {
type: "agentRestartFailed";
agentId: string;
restartId: string;
phase: AgentRestartPhase;
message: string;
}
| {
type: "backgroundTaskChanged";
projectId: string;