mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat(coderd): notify on task completion/failure (#20327)
Adds notifications on task transitions to completed or failure state. Authored by Claude, I reviewed it and it appears to be legit.
This commit is contained in:
@@ -452,6 +452,10 @@ func (api *API) enqueueAITaskStateNotification(
|
||||
notificationTemplate = notifications.TemplateTaskWorking
|
||||
case codersdk.WorkspaceAppStatusStateIdle:
|
||||
notificationTemplate = notifications.TemplateTaskIdle
|
||||
case codersdk.WorkspaceAppStatusStateComplete:
|
||||
notificationTemplate = notifications.TemplateTaskCompleted
|
||||
case codersdk.WorkspaceAppStatusStateFailure:
|
||||
notificationTemplate = notifications.TemplateTaskFailed
|
||||
default:
|
||||
// Not a notifiable state, do nothing
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user