feat(coderd): return 409 Conflict for non-active task states by mafredri · Pull Request #21887 · coder/coder

mafredri added a commit that referenced this pull request

Feb 5, 2026
Previously, tasks with pending provisioner jobs (not yet picked up)
were incorrectly reported as "initializing".

Refs #21887

Base automatically changed from mafredri/fix-task-pending-status to main

February 5, 2026 12:08

@mafredri

Previously we returned 400 Bad Request for all non-active states. This was
semantically incorrect for transitional and paused states where the request
is valid but conflicts with current state.

We now return 409 Conflict for pending/initializing/paused (resolvable by
waiting or resuming) and 400 for error/unknown (actual problems). This
enables client-side auto-resume orchestration per the task lifecycle RFC.

Closes coder/internal#1265

@mafredri mafredri marked this pull request as ready for review

February 5, 2026 12:24

johnstcn

@mafredri mafredri deleted the mafredri/feat-coderd-return-task-send-conflict branch

February 6, 2026 10:05