diff options
Diffstat (limited to 'makima/src/server/state.rs')
| -rw-r--r-- | makima/src/server/state.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/makima/src/server/state.rs b/makima/src/server/state.rs index 32c0af3..b954efe 100644 --- a/makima/src/server/state.rs +++ b/makima/src/server/state.rs @@ -1065,6 +1065,9 @@ impl AppState { } /// Format and send a task completion notification to a supervisor. + /// + /// If `action_directive` is provided, it will be appended to the message + /// as an [ACTION REQUIRED] block to prompt the supervisor to take action. pub async fn notify_supervisor_of_task_completion( &self, supervisor_task_id: Uuid, @@ -1074,6 +1077,7 @@ impl AppState { status: &str, progress_summary: Option<&str>, error_message: Option<&str>, + action_directive: Option<&str>, ) { let mut message = format!( "TASK_COMPLETED task_id={} name=\"{}\" status={}", @@ -1091,6 +1095,12 @@ impl AppState { message.push_str(&format!(" error=\"{}\"", escaped)); } + // Append action directive if provided + if let Some(directive) = action_directive { + message.push_str("\n\n"); + message.push_str(directive); + } + if let Err(e) = self.notify_supervisor( supervisor_task_id, supervisor_daemon_id, |
