summaryrefslogtreecommitdiff
path: root/makima/src/daemon/ws/protocol.rs
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-01-23 23:52:35 +0000
committersoryu <soryu@soryu.co>2026-01-23 23:52:35 +0000
commit579c983d3efb8f1414ffb45b9e031f741cce5f76 (patch)
tree1a0060f19a4f4eea8fb9cff9eb52a46cedcdc152 /makima/src/daemon/ws/protocol.rs
parentf6f0790217d4098ffb6d2b3df08b0cf83ff61727 (diff)
downloadsoryu-579c983d3efb8f1414ffb45b9e031f741cce5f76.tar.gz
soryu-579c983d3efb8f1414ffb45b9e031f741cce5f76.zip
Add resume to daemon tasks
Diffstat (limited to 'makima/src/daemon/ws/protocol.rs')
-rw-r--r--makima/src/daemon/ws/protocol.rs36
1 files changed, 36 insertions, 0 deletions
diff --git a/makima/src/daemon/ws/protocol.rs b/makima/src/daemon/ws/protocol.rs
index ec9b09e..2e7caef 100644
--- a/makima/src/daemon/ws/protocol.rs
+++ b/makima/src/daemon/ws/protocol.rs
@@ -60,6 +60,25 @@ pub enum DaemonMessage {
error: Option<String>,
},
+ /// Task recovery detected after daemon restart.
+ /// Sent when daemon finds orphaned tasks that can be recovered.
+ TaskRecoveryDetected {
+ #[serde(rename = "taskId")]
+ task_id: Uuid,
+ /// Previous state of the task before daemon restart.
+ #[serde(rename = "previousState")]
+ previous_state: String,
+ /// Whether the worktree is still intact.
+ #[serde(rename = "worktreeIntact")]
+ worktree_intact: bool,
+ /// Path to the worktree if available.
+ #[serde(rename = "worktreePath")]
+ worktree_path: Option<String>,
+ /// Whether the task needs a checkpoint patch for recovery.
+ #[serde(rename = "needsPatch")]
+ needs_patch: bool,
+ },
+
/// Register a tool key for orchestrator API access.
RegisterToolKey {
#[serde(rename = "taskId")]
@@ -698,6 +717,23 @@ impl DaemonMessage {
}
}
+ /// Create a task recovery detected message.
+ pub fn task_recovery_detected(
+ task_id: Uuid,
+ previous_state: &str,
+ worktree_intact: bool,
+ worktree_path: Option<String>,
+ needs_patch: bool,
+ ) -> Self {
+ Self::TaskRecoveryDetected {
+ task_id,
+ previous_state: previous_state.to_string(),
+ worktree_intact,
+ worktree_path,
+ needs_patch,
+ }
+ }
+
/// Create a register tool key message.
pub fn register_tool_key(task_id: Uuid, key: String) -> Self {
Self::RegisterToolKey { task_id, key }