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:
Cian Johnston
2025-10-16 10:21:08 +01:00
committed by GitHub
parent 3fa438f80e
commit 0faee8e913
10 changed files with 397 additions and 2 deletions
+4
View File
@@ -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