Skip to content

fix: use "idle timeout" as task auto-pause reason#22287

Merged
DanielleMaywood merged 1 commit intomainfrom
fix/task-pause-reason-idle-timeout
Feb 24, 2026
Merged

fix: use "idle timeout" as task auto-pause reason#22287
DanielleMaywood merged 1 commit intomainfrom
fix/task-pause-reason-idle-timeout

Conversation

@DanielleMaywood
Copy link
Contributor

Summary

The task auto-pause notification was using "inactivity exceeded the dormancy threshold" as the pause_reason. This is misleading because the actual trigger is the workspace build deadline expiring (autostop TTL), not dormancy.

Dormancy is a completely separate mechanism that checks LastUsedAt against TimeTilDormant and produces BuildReasonDormancy — it never triggers the task pause notification.

The real flow is:

  1. Task workspace gets a deadline based on the template's DefaultTTL
  2. While the AI agent is active, activity bumps extend the deadline
  3. When the agent goes idle and bumps stop, the deadline expires
  4. isEligibleForAutostop() fires → becomes BuildReasonTaskAutoPause

Changes

  • coderd/autobuild/lifecycle_executor.go: Changed pause_reason from "inactivity exceeded the dormancy threshold" to "idle timeout"
  • coderd/autobuild/lifecycle_executor_test.go: Updated test assertion to match

Testing

TestExecutorTaskWorkspace/AutostopNotification passes ✅


Written by Coder Mux w/ Opus 4.6

The task auto-pause notification was using "inactivity exceeded the
dormancy threshold" as the pause_reason. This is misleading because
the actual trigger is the workspace build deadline expiring (autostop
TTL), not dormancy. Dormancy is a completely separate mechanism that
checks LastUsedAt against TimeTilDormant and produces BuildReasonDormancy.

Change the pause_reason to "idle timeout" which accurately describes
what happened: the AI agent went idle, activity bumps stopped, and
the workspace deadline expired.
@DanielleMaywood DanielleMaywood changed the title fix(notifications): use "idle timeout" as task auto-pause reason fix(coderd/notifications): use "idle timeout" as task auto-pause reason Feb 24, 2026
@DanielleMaywood DanielleMaywood changed the title fix(coderd/notifications): use "idle timeout" as task auto-pause reason fix: use "idle timeout" as task auto-pause reason Feb 24, 2026
@DanielleMaywood DanielleMaywood marked this pull request as ready for review February 24, 2026 16:23
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

I think I called out "idle timeout" as a bit vague in my previous review, but I prefer to get this merged in before the freeze. We can always iterate on terminology later.

@DanielleMaywood DanielleMaywood merged commit 974ca3e into main Feb 24, 2026
36 checks passed
@DanielleMaywood DanielleMaywood deleted the fix/task-pause-reason-idle-timeout branch February 24, 2026 16:45
@github-actions github-actions bot locked and limited conversation to collaborators Feb 24, 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.

2 participants