Skip to content

fix: remove stale coder_parameter selectable options from workflow display - #29575

Closed
untra wants to merge 3 commits into
mainfrom
feat/CLIENT-697-stale-coder_param-blocks-option-selection
Closed

untra wants to merge 3 commits into
mainfrom
feat/CLIENT-697-stale-coder_param-blocks-option-selection

Conversation

@untra

@untra untra commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

CLIENT-697

Summary

A mutable coder_parameter whose selected option is removed from a template update but used in a workspace build could block further changes.

With this PR it no longer blocks the workspace build. The stale value falls back to the parameter's default, and the substitution is reported as a warning rather than an error.

Immutable properties still report as an error.

Problem

When a template update removes an option value that a workspace has had already selected, the stored value is no longer a member of that option set.

In the web UI the preview websocket returns the same per-parameter error, which disables "Update and start"; on a template with required inputs inputs are disabled as well, leaving the user no way to select a valid option or proceed.

The CLI appears unaffected only because it drops invalid options client-side and retries against the active version, so coder ssh masked a server-side failure rather than avoiding it.

Fix

ResolveParameters now drops a carried-forward value parameter's options, letting the existing defaultbackfill supply the new default. Values supplied with the build or by a preset are still validated, since those were asked for explicitly, and immutable parameters are left alone.

The preview endpoints render through RenderReconciled, which re-renders without the dead value and attaches a warning carrying a stale_option code, so the form shows the default option.

The parameters page no longer disables its inputs via ?templateVersionId=, because the build it submits is the update the template requires. Without that query parameter the form stays disabled as before.

immutable stale parameter still cannot be updated
Screenshot 2026-09-22 at 3 41 17 PM
mutable stale option can be updated
Screenshot 2026-09-22 at 3 40 42 PM
mutable radio button can be updated
image

@linear-code

linear-code Bot commented Sep 18, 2026

Copy link
Copy Markdown

CLIENT-697

@untra
untra marked this pull request as ready for review September 23, 2026 16:14
@untra
untra requested a review from Emyrk as a code owner September 23, 2026 16:14
@coderagents

coderagents Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Documentation Check

Updates Needed

  • docs/admin/templates/extending-templates/parameters.md (open) - In the "Incompatibility in Parameter Options for Workspace Builds" section, the text and the Bob/Alice example say a workspace whose selected option was removed is prompted to select a new value, and that this "prevents workspace users from becoming trapped." With this change that is no longer the general case: when the parameter is mutable, the stored value is dropped, the build falls back to the parameter's default, and the substitution is reported as a stale_option warning rather than a prompt/error. Update the description and example to reflect this, and note that only immutable parameters still surface an error.

Automated review via Coder Agents

@Emyrk Emyrk 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.

With this PR it no longer blocks the workspace build. The stale value falls back to the parameter's default, and the substitution is reported as a warning rather than an error.

This is actually dangerous, and the current blocking behavior is current.

An example I have seen in the past, that this behavior actually used to exist (maybe in regular params though, not dynamic).

  1. A customer had a region value, us-east, us-west.
  2. A region was removed, and all workspaces on that region switched to the new default since their value was no longer valid.
  3. By switching, their volumes on their original choice were deleted.

The correct behavior is to fail and prevent the build. A resolution is to manually change the param values.


I am open to adding more UI errors/warnings/suggestions. But we cannot have the backend automate this behavior.

@untra

untra commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

@Emyrk thank you, that's really critical security feedback 🙏 I see it now, I am learning.

The suggestion was for the UI to preselect a default, but I see this is still defaulting it from the backend. I will drop the backend resolver changes, make this change more UI-centric to nudge a fixed value to pre-select.

The UI should let the user select a new valid option and proceed.
Or, at minimum, the UI should pre-select the default value (as it visually appears to do) and allow the user to click "Update and start," rather than leaving the button disabled.

@untra

untra commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

closing this; I don't like the UI solution I keep getting, which I don't understand, but which I think is due to a separate issue now being idenified. This is fixable for the customer with manual intervention on their part, however I am unsure if the ui native solution for this claude suggests for me will work. closing this until I can work something better.

@untra untra closed this Oct 9, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 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.

2 participants