Skip to content

Commit 78291a6

Browse files
committed
fix: clone task status before moving task in wait_for_task borrow checker
1 parent fc94791 commit 78291a6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/tools/wait_for_task.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,21 +118,23 @@ impl Tool for WaitForTaskTool {
118118
task.status,
119119
crate::tasks::TaskStatus::Done | crate::tasks::TaskStatus::Backlog
120120
) {
121+
let task_status = task.status.clone();
121122
return Ok(WaitForTaskOutput {
122123
success: true,
123124
task: Some(task),
124-
message: format!("Task #{} completed with status: {}", task_number, task.status),
125+
message: format!("Task #{} completed with status: {}", task_number, task_status),
125126
});
126127
}
127128

128129
// Check timeout
129130
if elapsed >= timeout_secs {
131+
let task_status = task.status.clone();
130132
return Ok(WaitForTaskOutput {
131133
success: false,
132134
task: Some(task),
133135
message: format!(
134136
"Task #{} still {} after {}s. Call wait_for_task again to continue waiting, or check manually with task_get.",
135-
task_number, task.status, elapsed
137+
task_number, task_status, elapsed
136138
),
137139
});
138140
}

0 commit comments

Comments
 (0)