Skip to content

feat(coderd): return 409 Conflict for non-active task states#21887

Merged
mafredri merged 1 commit intomainfrom
mafredri/feat-coderd-return-task-send-conflict
Feb 6, 2026
Merged

feat(coderd): return 409 Conflict for non-active task states#21887
mafredri merged 1 commit intomainfrom
mafredri/feat-coderd-return-task-send-conflict

Conversation

@mafredri
Copy link
Member

@mafredri mafredri commented Feb 3, 2026

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 force-pushed the mafredri/feat-coderd-return-task-send-conflict branch 3 times, most recently from 374501e to 7bfdb51 Compare February 3, 2026 13:08
@mafredri mafredri force-pushed the mafredri/fix-task-pending-status branch 2 times, most recently from 55e2f76 to 33bfeae Compare February 4, 2026 08:04
@mafredri mafredri force-pushed the mafredri/feat-coderd-return-task-send-conflict branch from 7bfdb51 to a414b58 Compare February 4, 2026 08:04
@mafredri mafredri force-pushed the mafredri/fix-task-pending-status branch from 33bfeae to 59b3504 Compare February 5, 2026 11:40
@mafredri mafredri force-pushed the mafredri/feat-coderd-return-task-send-conflict branch from a414b58 to 961f27b Compare February 5, 2026 11:40
@mafredri mafredri force-pushed the mafredri/fix-task-pending-status branch from 59b3504 to cd03cca Compare February 5, 2026 11:50
@mafredri mafredri force-pushed the mafredri/feat-coderd-return-task-send-conflict branch from 961f27b to cf0f5f1 Compare February 5, 2026 11:50
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 mafredri force-pushed the mafredri/feat-coderd-return-task-send-conflict branch 2 times, most recently from 21f45b6 to 8ad5dc7 Compare February 5, 2026 12:11
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 force-pushed the mafredri/feat-coderd-return-task-send-conflict branch from 8ad5dc7 to ec71985 Compare February 5, 2026 12:24
@mafredri mafredri marked this pull request as ready for review February 5, 2026 12:24
@mafredri mafredri requested review from SasSwart and johnstcn February 5, 2026 12:24
@mafredri mafredri merged commit 2549fc7 into main Feb 6, 2026
32 checks passed
@mafredri mafredri deleted the mafredri/feat-coderd-return-task-send-conflict branch February 6, 2026 10:05
@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tasks: API /send returns 409 when paused

2 participants