fix(domain,application,infrastructure,backend,app-tauri,frontend): Stop demande agent préserve la conversation ouverte — arrêt sans fermeture/clôture du chat, états cohérents après cancel sur les 3 adapters de session, cellule et workstate synchronisés — #343 (QA verte)
This commit is contained in:
@ -1608,8 +1608,8 @@ pub trait AgentSession: Send + Sync {
|
||||
/// # Errors
|
||||
/// [`AgentSessionError::Io`] when the adapter attempted a concrete cancel and
|
||||
/// it failed.
|
||||
async fn cancel_current_turn(&self) -> Result<(), AgentSessionError> {
|
||||
Ok(())
|
||||
async fn cancel_current_turn(&self) -> Result<CancelCurrentTurnOutcome, AgentSessionError> {
|
||||
Ok(CancelCurrentTurnOutcome::AlreadyCompleted)
|
||||
}
|
||||
|
||||
/// Termine proprement la session (tue le process/SDK sous-jacent). Idempotent.
|
||||
@ -1619,6 +1619,20 @@ pub trait AgentSession: Send + Sync {
|
||||
async fn shutdown(&self) -> Result<(), AgentSessionError>;
|
||||
}
|
||||
|
||||
/// Result of a non-destructive request to cancel one structured-agent turn.
|
||||
///
|
||||
/// The session itself remains live for every outcome. A missing session is not
|
||||
/// represented here: the application registry reports that separately.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum CancelCurrentTurnOutcome {
|
||||
/// A running turn accepted the cancellation request.
|
||||
Cancelled,
|
||||
/// The same turn had already accepted a cancellation request.
|
||||
AlreadyCancelled,
|
||||
/// The session is live but no turn is currently running.
|
||||
AlreadyCompleted,
|
||||
}
|
||||
|
||||
/// **Factory** sélectionnée par le profil (ARCHITECTURE §17.1) : crée/reprend une
|
||||
/// [`AgentSession`] pour un agent IA. C'est elle qui sait *quel adapter* instancier
|
||||
/// (Claude/Codex) selon `profile.structured_adapter` (§17.3). Open/Closed : ajouter
|
||||
|
||||
Reference in New Issue
Block a user