fix: use "idle timeout" as task auto-pause reason#22287
Merged
DanielleMaywood merged 1 commit intomainfrom Feb 24, 2026
Merged
Conversation
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.
mafredri
approved these changes
Feb 24, 2026
Member
mafredri
left a comment
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The task auto-pause notification was using
"inactivity exceeded the dormancy threshold"as thepause_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
LastUsedAtagainstTimeTilDormantand producesBuildReasonDormancy— it never triggers the task pause notification.The real flow is:
DefaultTTLisEligibleForAutostop()fires → becomesBuildReasonTaskAutoPauseChanges
coderd/autobuild/lifecycle_executor.go: Changedpause_reasonfrom"inactivity exceeded the dormancy threshold"to"idle timeout"coderd/autobuild/lifecycle_executor_test.go: Updated test assertion to matchTesting
TestExecutorTaskWorkspace/AutostopNotificationpasses ✅