Repository navigation
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
Current Behavior
On the Create workspace page with Dynamic Parameters enabled, each parameter
change triggers a WebSocket round-trip to /api/v2/templateversions/{id}/dynamic-parameters.
On our template (< />70 Terraform resources, < />27 .tf files), each evaluation takes < />4–5 seconds.
If the user edits one or more parameters and clicks Create workspace before the latest
WebSocket response returns, the submitted build may not use the values shown in the form
(often reverting to previous/default values). This is reproducible across multiple fields,
not a single-parameter validation issue.
The submit button is only disabled for:
- workspace creation in progress
- missing required external auth
- diagnostic errors
It is not disabled while a dynamic-parameters request is in flight.
Relevant frontend code (main branch): site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx— submitdisabledlogicsite/src/pages/CreateWorkspacePage/CreateWorkspacePage.tsx—wsResponseIdvslatestResponse.idsite/src/modules/hooks/useSyncFormParameters.ts— can overwrite values beforesetFieldTouchedcompletes
There is also a 500ms debounce forinput/textareafields before the WebSocket request is sent,
widening the race window.
Screen.Recording.2026-07-08.at.10.52.23.mov
Diagnostic notes from our investigation:
- Preview uses
github.com/coder/previewwithParseFS(".")+EvaluateAll()on the full archived template on every WebSocket message. - Even with a single parameter and ~959-byte archive, round-trips were still ~4s — bottleneck appears to be full-graph evaluation, not parameter count alone.
- Related issues: bug: multi-select parameter search input stutters/closes during WebSocket re-evaluation #25695, bug: Workspace settings parameters cycle between changed and default values when dynamic parameters enabled #21433, Auto-reconnect web socket on dynamic parameters create workspace page and reduce web socket timeout #20846
Suggested fix directions: - Track pending state:
pending = sentRequestId > latestResponse.id - Disable submit while
pending || debounceTimerActive - Set
touchedbefore asyncsetFieldValueinhandleChange - Server-side: debounce/coalesce WS evaluations; cache parsed HCL between requests
Relevant Log Output
Expected Behavior
- Create workspace should be disabled (or queued) until the latest dynamic-parameters
evaluation for the current form state has completed successfully. - Alternatively, submit should always send the current form values and not be overwritten by
stale WebSocket sync responses. - Ideally: cancel/coalesce in-flight preview requests and/or cache
ParseFSresults between
evaluations (coder/previewre-parses the full template graph on every message).
Steps to Reproduce
- Use a template with Dynamic Parameters enabled and non-trivial Terraform (~ dozens of resources).
- Open Create workspace for that template.
- Wait for the initial form to load.
- Type a new value in a string parameter (e.g. version field) or change any parameter.
- Click Create workspace within ~5 seconds (before WebSocket evaluation completes).
- Observe the created workspace build parameters — the new value was not applied.
Environment
- Coder version: v2.34.5+c3dd41e
- Template: large on-prem EC2 Terraform template (~70 resources, 22 parameters)
Additional Context
The issue occurs consistently, The issue happens on multiple deployments, I have tested this on the latest version
Activity
linear-code commentedon Jul 9, 2026
ENG-3017
PushTheLimit commentedon Jul 15, 2026
Confirming we're hitting this too. Reproduced on our own deployment running Coder v2.35.1, so it's still present as of 2.35.1 (this report was filed against v2.34.5).
+1 on the proposed fixes here: disabling Create while an evaluation (or the input debounce) is pending, and/or always submitting the current form values so a stale sync response can't overwrite them.