Skip to content

fix: remove stale coder_parameter options from workflow display - #29500

Closed
untra wants to merge 2 commits into
mainfrom
feat/CLIENT-697-ui-workplace-block
Closed

untra wants to merge 2 commits into
mainfrom
feat/CLIENT-697-ui-workplace-block

Conversation

@untra

@untra untra commented Sep 17, 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.

Problem

When a template update removes an option value that a workspace already selected, the stored value is no longer a member of the option set. coder/preview relays a per-parameter

Any build that supplies no parameter values of its own build's values, so it fails with a 400. That includes autostart and prebuild reconciliation, not just the UI. 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 because replahe immutability check instead. The value is checkedagainst the option set directly because the upstream diagnostic carries no machine-readable code to match on.

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.

@linear-code

linear-code Bot commented Sep 17, 2026

Copy link
Copy Markdown

CLIENT-697

@untra untra changed the title CLIENT-697 remove stale options from workflow display fix: CLIENT-697 remove stale options from workflow display Sep 17, 2026
@untra untra changed the title fix: CLIENT-697 remove stale options from workflow display fix: remove stale coder_parameter options from workflow display Sep 17, 2026
@untra
untra marked this pull request as ready for review September 18, 2026 15:21
@untra
untra requested a review from Emyrk as a code owner September 18, 2026 15:21
@coderagents

coderagents Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Documentation Check

Updates Needed

  • docs/admin/templates/extending-templates/parameters.md (open) - The "Incompatibility in Parameter Options for Workspace Builds" section (line 141) still says a workspace "will be prompted to select the new value from a pop-up window" (line 149) and that Bob "is prompted to select a new value for image_tag" (line 169). This PR changes that behavior: when a template update removes an option that a mutable parameter had selected, the build no longer fails and the user is no longer prompted. The stale value now silently falls back to the parameter's default and is surfaced as a warning, and the "Update and start" button stays enabled when only a warning is present. The section and its worked example describe the old blocking/prompting behavior and need to be rewritten to match: immutable parameters and values explicitly supplied with the build still error, but a carried-forward mutable value that lost its option now reconciles to the default.

Automated review via Coder Agents

@untra

untra commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

stale PR; closing in favor of #29575

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

1 participant