**Repo**: `coder/coder` **Scope**: Modify lifecycle executor to use task-specific build reason when auto-stopping task workspaces. **Changes**: - Modify `getNextTransition()` in `coderd/autobuild/lifecycle_executor.go` - Check if workspace has an associated task (join already present in query) - Return `database.BuildReasonTaskAutoPause` instead of `database.BuildReasonAutostop` when eligible for autostop and workspace has a task - Similar check needed for `isEligibleForFailedStop` (failed task workspaces should use `task_auto_pause`) **Files**: - `coderd/autobuild/lifecycle_executor.go` - `coderd/autobuild/lifecycle_executor_test.go` **Acceptance criteria**: - [ ] Task workspaces stopped by lifecycle executor use `task_auto_pause` reason - [ ] Regular workspaces continue using `autostop` reason - [ ] Failed task workspaces use `task_auto_pause` when stopped - [ ] Tests verify reason selection based on task presence **Dependencies**: - #1250 <!-- Issue 1 --> **References**: - [PRD: Start/Pause/Resume the Task Workspace](https://www.notion.so/coderhq/Start-Pause-Resume-the-Task-Workspace-2aad579be59280e5a15ef6bb6a93f246) - [RFC: Tasks: Start/Pause/Resume Lifecycle](https://www.notion.so/coderhq/Tasks-Start-Pause-Resume-Lifecycle-2cdd579be592805a929fc36d0c82d65d): Approach (TTL Integration)
Activity
fix(coderd): use BuildReasonTaskAutoPause for task workspaces (#22126)
johnstcn commentedon Feb 18, 2026
Fixed by coder/coder#22126