fix(site): keep activity bump editable when allow_user_autostop is on (#27083) - #27142
Merged
Conversation
…#27083) > 🤖 This PR was written by Coder Agents on behalf of Jake Howell. The UI guard added in #22112 disabled the `Activity bump` field and cleared its saved value whenever the template's `Default autostop` was 0. It did not check the "Allow users to customize autostop duration for workspaces" (`allow_user_autostop`) setting, so templates that relied on user-defined autostop timers had their `activity_bump_ms` silently cleared when saving in the Coder UI. Enable the field, preserve the value on submit, and update the helper text when either `default_ttl_ms > 0` or `allow_user_autostop` is true. Closes [DEVEX-438](https://linear.app/codercom/issue/DEVEX-438/allow-user-autostop-default-autostop-disabled-causes-activity-bump-to). > **Note:** This needs to be backported to 2.34 (ESR). <details> <summary>Implementation notes</summary> ### Problem [#22112](#22112) introduced a UI guard that: 1. Disables the `Activity bump (hours)` field when `default_ttl_ms === 0`. 2. Sends `activity_bump_ms: undefined` on submit under the same condition, which the backend treats as "do not update", but combined with the disabled state users cannot re-enter a value once cleared and the previously stored value effectively becomes orphaned. The guard ignored `allow_user_autostop`. When that setting is enabled, workspaces still have a scheduled stop (whatever the user configures on their workspace), so `activity_bump_ms` is still meaningful. ### Fix Broaden the guard to consider both signals. The field is only disabled and the value only discarded when **both** `default_ttl_ms === 0` **and** `allow_user_autostop === false`. Changes: - `TemplateScheduleForm.tsx` - `disabled` prop now checks `!default_ttl_ms && !allow_user_autostop`. - Submit path preserves `activity_bump_ms` when either signal is truthy. - Passes `allowUserAutostop` through to the helper text. - `TTLHelperText.tsx` - `ActivityBumpHelperText` accepts `allowUserAutostop` and only shows the "no scheduled stop" hint when neither signal is set. Updated copy mentions both signals. - Tests and stories - Existing tests explicitly uncheck `allow_user_autostop` before asserting the guard fires (since `MockTemplate.allow_user_autostop` defaults to `true`). - Added coverage: guard stays off when only `allow_user_autostop` is enabled; toggling `allow_user_autostop` re-enables the field without touching `default_ttl_ms`. - Added a story that verifies `activity_bump_ms` is preserved on submit when `allow_user_autostop` is enabled and `default_ttl_ms` is 0. </details> (cherry picked from commit 1eea4a7)
jakehwll
approved these changes
Jul 14, 2026
Member
|
@rowansmithau @jakehwll FYI, we require engineers to post backport requests in the #releases channel. I'll post this one for you, but please remember to do it yourselves next time. We monitor the channel regularly, but direct GitHub review requests can easily go unnoticed. |
mtojek
approved these changes
Jul 14, 2026
Member
|
apologies @mtojek, I’ve done it for every other backport I’ve created, just missed this one. |
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.
Backport of #27083
Original PR: #27083 — fix(site): keep activity bump editable when allow_user_autostop is on
Merge commit: 1eea4a7
Requested by: @rowansmithau