Workspace update fails for templates that use dynamic parameters
Maintainer thường phản hồi trong vòng 2 ngày
@EhabY đang làm issue này rồi.
Từ ngày 30/9/2026.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- typescript, vscode
- Lĩnh vực
- developer-experience, tooling
Hướng nghiên cứu
Bắt đầu trong src/api/updateParameters.ts tại collectUpdateParameters và promptSpec, sau đó so sánh cách xử lý tham số legacy của nó với các endpoint tham số động và các đường dẫn resolver được liên kết trong issue. Xác định biện pháp giảm thiểu nào phù hợp cho extension, đồng thời xác minh rằng các bản cập nhật workspace xử lý các tham số bắt buộc có điều kiện và các tùy chọn động mà vẫn giữ nguyên hành vi legacy.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Symptom
Updating a workspace from VS Code fails with a generic "resolve parameters" 400 error when the template uses dynamic parameters (the dynamic-parameters experiment, docs) and any of the following are true:
- A parameter is conditionally
requiredbased on another input value. - A parameter only appears for certain combinations of other inputs (the static rich-parameters list does not include it).
- A parameter's options are computed dynamically (the static
optionslist is empty or stale).
The user sees the failure as a build error in the workspace logs, with no clear indication that the workspace update endpoint expected additional or different parameter values than were provided.
Root cause
collectUpdateParameters (src/api/updateParameters.ts) calls getTemplateVersionRichParameters, which returns the static parameter list captured at template-version provisioning time (coderd/templateversions.go:287). It then mirrors the dashboard's legacy-params getMissingParameters check.
For templates using dynamic parameters, the dashboard takes a different path entirely:
- It opens a WebSocket at
/api/v2/templateversions/{id}/dynamic-parameters?user_id=…(site/src/api/api.ts:1175). - The server reactively re-renders the parameter form as the user types, evaluating
coder_parameterconditionals against owner data, previous build values, and presets. - On submit, the build endpoint calls
wsbuilder.getDynamicParameters→dynamicparameters.ResolveParameters(coderd/wsbuilder/wsbuilder.go:881), which returns anhcl.Diagnosticserror if any reactive constraint is unsatisfied.
The extension never opens that socket, so its prompt set is whatever the static list said at provisioning time. When the dynamic resolver evaluates the submitted build values and finds a conditionally-required parameter missing (or a dynamically-restricted option violated), the build fails.
Reproduction
- Author a template with
terraform-provider-coder v2.xdeclaring two parameters where the second isoptionalonly when the first has a specific value (a typical reactive form), and enable thedynamic-parametersexperiment on the deployment. - Create a workspace from that template, choosing values such that the conditional path requires the second parameter.
- Update the template's active version (any change that keeps both parameters but does not alter the conditional logic).
- From VS Code, run
coder.updateWorkspaceon the workspace. - Observe the build fails with a 400 "resolve parameters" error from
wsbuilder. The extension shows a generic workspace-update-failed notification; the underlying diagnostic is only visible in the workspace logs.
Scope of impact
- Affected: any deployment with the
dynamic-parametersexperiment enabled (the path the Coder team is pushing as the default going forward). - Not affected: deployments still on legacy/classic parameters — those continue to work with the existing
needsPromptlogic. - Partial impact: templates that enable dynamic parameters but never use any reactive constructs (no conditional
required, no dynamic option lists, no conditionally-appearing parameters) update fine, because the static list happens to be accurate.
Proposed mitigations
In rough order of effort:
- Detect and warn (S): read the template's
use_classic_parameter_flow(or equivalent) flag incollectUpdateParameters. If false, surface a one-line warning telling the user to update via the dashboard (with a deep link) and skip the prompts. Currently we silently send incomplete data. - One-shot REST evaluate (M): call
POST /api/v2/templateversions/{id}/dynamic-parameters/evaluate(coderd/parameters.go, api.ts:1155) with the current build parameters asinputs, feed the returned non-reactive parameter list into the existingpromptSpec+ QuickPick flow. Loses interactive reactivity but picks up server-evaluatedrequiredand option lists. Best ROI for most templates. - WebSocket + Webview (L): open
/api/v2/templateversions/{id}/dynamic-parametersfrom the extension, render a reactive form in a Webview, send each answer back as the user fills it in. Closest to the dashboard UX but a real feature, not a fix. ExistingreconnectingWebSocket.tsinfra is reusable.
Related
- PR #967 (this PR): legacy-params drift detection and immutable-param prompting. Closes the legacy gap but explicitly does not address dynamic params; the JSDoc on
promptSpeccalls this out. - The dashboard skips its
getMissingParametersclient-side check whenisDynamicParametersEnabledis true (site/src/api/api.ts:2532) and relies entirely on the server resolver.
- Ngôn ngữ chính
- TypeScript
- Star
- 132
- Fork
- 48
- Merge trung bình
- 2 ngày 15 phút
- Pull request đã merge (30 ngày)
- 17
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của coder/vscode-coder
-
bug tech-debt
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
coder/vscode-coder#1140 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Split commands.ts by topicĐang mởImprovement tech-debt vs-code
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
coder/vscode-coder#1135 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Migrate CI setup to pnpm/setupCó thể đã có người làm @EhabY đã nhận 18 ngày trước. Đang mởtech-debt
coder/vscode-coder#1119 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Design the VS Code Workspaces panelCó thể đã có người làm @chrifro đã nhận 22 ngày trước. Đang mở
coder/vscode-coder#1113 · 3 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Flush the connection log buffer after N failed reconnect attempts against an unreachable serverCó thể đã có người làm @aqandrew đã nhận 6 ngày trước. Đang mởenhancement tech-debt
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
coder/vscode-coder#1112 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của coder/vscode-coder
Issue tương tự
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Small-tailqwq/dsh-deep-whale#187 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Tela Marca manda conferir o campo "Razão social", que em Portugal se chama "Denominação social"Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
melgarafael/DeskcommCRM#2503 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
0x80/isolate-package#218 ·
-
bug via-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
pingdotgg/t3code#16859 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày