Skip to content

Tasks: UI auto-resume on send #1269

Closed
coder/coder
#22302

Description

@mafredri

Repo: coder/coder

Scope: When user sends a message to a paused task, automatically resume and deliver.

Changes:

  • Attempt to send message via POST /tasks/{task}/send
  • If 409 response (task paused):
    • Store message in component state (not persisted)
    • Call POST /tasks/{task}/resume endpoint
    • Poll task status until active or build fails (see Polling logic below)
    • Show build progress indicator with workspace build details
    • Retry send with stored message when task is active
    • Clear stored message on successful send
    • Transition to live chat interface

Polling logic:

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

Local state handling:

  • Message stored in component state during resume (not persisted)
  • Message persists in input field during resume (user sees what they typed)
  • Message cleared from state on successful send
  • Message kept in input field on error (user can edit and retry)
  • Message lost if user navigates away (acceptable - no warning needed, standard web behavior)

Error handling:

  • 409 on send, resume build fails: Show build error modal, keep message in input field for retry
  • 409 on send, resume succeeds, retry send fails: Show "Failed to send message" error, keep message in input field for retry
  • Non-409 send error: Show send error (network/AgentAPI issue), keep message in input field

Files:

  • site/src/pages/TaskPage/TaskPage.tsx

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
  • Message remains visible in input field during entire resume process
  • Build progress indicator shown during resume with workspace build status
  • Polling exits when task.Status === "active" and send succeeds
  • Terminal build failure stops polling, shows build error, preserves message
  • Retry send failure after successful resume shows send error, preserves message
  • Successful send clears message from input and transitions to live chat
  • User can navigate away during resume (message lost, no warning - standard behavior)

Dependencies:

References:

Activity

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

    @SasSwart

    Update:

    After consultation with @jakehwll and @mafredri, I've implemented this first iteration:

    Screen.Recording.2026-02-25.at.10.44.45.mov

    I'm still verifying that it behaves exactly as intended.

  4. SasSwart commented on Feb 25, 2026

    @SasSwart

    Update:

    Testing this on a running system has brought a few issues to light. I'm working through them.

    When resuming a task, this is what the build status indicator looks like:

    Image

    This is consistent with the Edit Prompt experience and communicates clearly.

  5. SasSwart commented on Feb 25, 2026

    @SasSwart

    The happy path has been implemented here:
    coder/coder#22302

    This effort was assisted by an LLM. I am reviewing the results before requesting external review.

  6. SasSwart commented on Feb 26, 2026

    @SasSwart

    Update:

    Digging into the weeds of the PR have been slow-going. Tedious bits include:

    • Tedious storybook issues required individual inspection
    • An LLM with too much initiative went down a design rabbit-hole
    • Linter and CI issues required some thought

    I'm still working through getting the PR completely ready for review, but getting closer.

  7. SasSwart commented on Mar 2, 2026

    @SasSwart

    Update:

    The PR has now been handed over for review.

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