Skip to content

feat(site): add pause/resume actions to task page - #21952

Merged
EhabY merged 4 commits into
mainfrom
show-pause-resume-in-task-page
Feb 9, 2026
Merged

EhabY merged 4 commits into
mainfrom
show-pause-resume-in-task-page

Conversation

@EhabY

@EhabY EhabY commented Feb 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add pause button during startup scripts phase
  • Add resume functionality when task is paused (with error dialog for API errors)
  • Show contextual messages: "timed out" vs "paused" based on workspace stop reason
  • Extract task action logic into reusable hooks for TaskPage, TasksSidebar, and TasksTable

Changes

  • Move TaskActionButton to modules/tasks/ for shared access
  • Create taskActions.ts with pure helpers (canPauseTask, canResumeTask, isPauseDisabled)
  • Create useTaskActions.ts with mutation hooks and configs
  • Add transitional state UI (pausing, canceling, deleting)
  • Add TaskStateMessage component for consistent state displays

Closes coder/internal#1267

@EhabY
EhabY force-pushed the show-pause-resume-in-task-page branch from 8c73628 to bc1167c Compare February 5, 2026 18:41

@DanielleMaywood DanielleMaywood left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than some issues with the mutations, looks good

Comment thread site/src/modules/tasks/taskActions.ts Resolved
Comment thread site/src/pages/TaskPage/TaskPage.tsx Resolved
Comment thread site/src/pages/TaskPage/TaskPage.tsx Resolved
@EhabY
EhabY force-pushed the show-pause-resume-in-task-page branch from bc1167c to 009d823 Compare February 9, 2026 09:34
@EhabY
EhabY requested a review from DanielleMaywood February 9, 2026 09:35
@EhabY
EhabY force-pushed the show-pause-resume-in-task-page branch 2 times, most recently from 847dd00 to f85c81d Compare February 9, 2026 11:07

@mafredri mafredri left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed a few cases (two pictured) where we could still adjust terminology, but otherwise looks good. And we can deal with these in a follow-up PR:

image image

The theme is, restart -> resume.

@EhabY

EhabY commented Feb 9, 2026

Copy link
Copy Markdown
Contributor Author

Oh right, I've missed those. I'll update them here since it's a very small change!

EhabY added 4 commits February 9, 2026 23:18
Add the ability to pause a running task and resume a paused task directly
from the TaskPage. This includes showing contextual messages when a task
is paused (manual vs timeout) and proper error handling with dialogs for
API errors.

- Extract task action logic into reusable hooks (useTaskActions.ts)
- Add mutation configs for custom error handling scenarios
- Move TaskActionButton to modules/tasks for better organization
- Add pause button to TaskStartingAgent component
- Show appropriate state messages for transitioning states (pausing,
  canceling, deleting)
Move pauseTask/resumeTask mutation configs from useTaskActions.ts hook
wrappers into api/queries/tasks.ts, following the codebase convention of
defining mutation configs in api/queries/ and using useMutation inline.
@EhabY
EhabY force-pushed the show-pause-resume-in-task-page branch from f85c81d to dbe3bee Compare February 9, 2026 20:21
@coderagents

coderagents Bot commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

Documentation Check

New Documentation Needed

  • docs/ai-coder/tasks.md or new docs/ai-coder/task-lifecycle.md - Document pause/resume functionality
    • Explain how to pause a task during startup scripts
    • Explain how to resume a paused task
    • Clarify the difference between "paused" (manual) vs "timed out" (autostop) states
    • Document that tasks can be paused and resumed from the UI

Automated review via Coder Tasks

@EhabY
EhabY merged commit 8990a10 into main Feb 9, 2026
28 checks passed
@EhabY
EhabY deleted the show-pause-resume-in-task-page branch February 9, 2026 20:37
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 9, 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: UI pause/resume buttons

3 participants