Skip to content

Tasks: CLI send auto-resumes paused tasks #1266

Closed
coder/coder
#22203

Description

@mafredri

Repo: coder/coder

Scope: Modify coder tasks send to automatically resume paused tasks before delivering message.

Changes:

  • Attempt to send message to task
  • If 409 response (task paused):
    • Print "Task is paused. Resuming (this may take a moment)..."
    • Call POST /tasks/{task}/resume endpoint
    • Poll task status until active or build fails (see Polling logic below)
    • Show build progress via cliui.WorkspaceBuild()
    • Retry send when task is active
    • Print "Input sent." on success

Polling logic:

  • Poll task status every 5 seconds
  • Exit loop when task.Status == "active" (workspace running, agent ready, AgentAPI responding)
  • Exit loop on terminal build failure (job status is failed/canceled)

Error handling:

  • 409 on send, resume build fails: Print build failure details, exit with code 1
  • 409 on send, resume succeeds, retry send fails: Print send error (network/AgentAPI issue), exit with code 1
  • Non-409 send error: Print error, exit with code 1 (no resume attempted)

Files:

  • cli/task.go
  • cli/task_test.go

Acceptance criteria:

  • Send to active task works normally (no change in behavior)
  • Send to paused task receives 409, triggers resume, waits for active, retries send
  • Build progress displayed during resume via cliui.WorkspaceBuild()
  • Polling exits when task.Status == "active" and send succeeds
  • Terminal build failure stops polling and shows build error
  • Retry send failure after successful resume shows send error (not resume error)
  • All error messages are actionable and clear

Dependencies:

References:

Activity

  1. added theissue type on Jan 15, 2026
  2. self-assigned this
    on Feb 6, 2026
  3. SasSwart commented on Feb 19, 2026

    @SasSwart

    Update:

    Given the balance of capacity remaining for the sprint, I'm handing this ticket over to @DanielleMaywood, so that I can focus on design work for: #1269

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions