Add cancellation flow for support sessions
Server changes: - Allow cancelling connected codes (not just pending) - Reject agent connections with cancelled codes - Periodic cancellation check during active sessions - Send Disconnect message when code is cancelled Agent changes: - Detect cancellation via Disconnect message - Show Windows MessageBox to notify user - Exit cleanly without reconnecting for support sessions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -202,6 +202,10 @@ impl SessionManager {
|
||||
|
||||
Some(message::Payload::Disconnect(disc)) => {
|
||||
tracing::info!("Disconnect requested: {}", disc.reason);
|
||||
// Check if this is a cancellation
|
||||
if disc.reason.contains("cancelled") {
|
||||
return Err(anyhow::anyhow!("SESSION_CANCELLED: {}", disc.reason));
|
||||
}
|
||||
return Err(anyhow::anyhow!("Disconnect: {}", disc.reason));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user