Skip to content

Tasks: Manual pause endpoint #1261

Closed
coder/coder
#21889

Description

@mafredri

Repo: coder/coder

Scope: Add API endpoint for manually pausing a task.

Changes:

  • Add POST /api/v2/tasks/{user}/{task}/pause endpoint
  • Triggers workspace stop with task_manual_pause build reason
  • Returns workspace build info for progress tracking
  • Validates task is in pausable state (not already paused, not in transition)

Files:

  • coderd/aitasks.go
  • codersdk/aitasks.go
  • coderd/coderd.go (route registration)

Acceptance criteria:

  • Endpoint triggers workspace stop build
  • Build reason is task_manual_pause
  • Returns 409 if task already paused or in transition
  • Returns build ID/info for progress tracking
  • Authorization checks task ownership

Dependencies:

References:

Activity

  1. added theissue type on Jan 15, 2026
  2. SasSwart commented on Feb 4, 2026

    @SasSwart

    Update: I've implemented a first draft the endpoint with a base "OK" test case.
    Next Step: Complete tests to prove that the endpoint works.

  3. SasSwart commented on Feb 5, 2026

    @SasSwart

    Update:

    • Pull request feat: add an endpoint to manually pause a coder task coder#21889 is ready for review to close this issue.
    • I'm double checking the Task ownership authorization check. I would expect this to work out of the box based on the authz for pausing a workspace, but I notice that we don't have a specific test for this so I'm adding one.
  4. SasSwart commented on Feb 6, 2026

    @SasSwart

    Update:

    • All blocking review is resolved, but final conversations are still being resolved.
    • Feedback is that we're testing too granularly, but that we can generalize and deduplicate tests as a follow-up.

    We should be able to merge soon.

  5. SasSwart commented on Feb 9, 2026

    @SasSwart

    Update:

    • We've merged the endpoint required to close this issue.
    • There were some follow-ups to ensure consistent testing patterns.
    • Those will be implemented as part of Tasks: Resume endpoint #1262
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions