Skip to content

fix: prompt for workspace update parameters#945

Draft
EhabY wants to merge 2 commits intomainfrom
fix/api-workspace-update-defaults
Draft

fix: prompt for workspace update parameters#945
EhabY wants to merge 2 commits intomainfrom
fix/api-workspace-update-defaults

Conversation

@EhabY
Copy link
Copy Markdown
Collaborator

@EhabY EhabY commented May 7, 2026

Summary

  • Replaces the coder update subprocess with an API update path.
  • Matches the dashboard-style missing-parameter preflight before stopping the workspace.
  • Prompts for required/immutable/invalid scalar-option parameters inside VS Code and sends only those supplied values, relying on backend inheritance for existing/default values.
  • Waits for stop/start update builds and carries the fresh workspace through the connection state machine.

Fixes #939.

Tests

  • pnpm test:extension ./test/unit/api/workspace.test.ts ./test/unit/remote/workspaceStateMachine.test.ts
  • pnpm typecheck
  • pnpm lint
  • pnpm format:check
Supporting plan and decision context

The issue is caused by coder update prompting for parameter values while the extension streams CLI output to a read-only VS Code OutputChannel.

Chosen approach: replace only the update subprocess with API calls, preserving the existing reload-before-update flow. The updater fetches a fresh workspace, fetches previous build parameters and target template parameters, computes prompt-worthy parameters using dashboard-style logic, collects those values with VS Code prompts before stopping the workspace, starts the active template version with only the prompted values, waits for the build, and returns the fresh workspace.

Prompt-worthy parameters are:

  • mutable required parameters without a previous/supplied value;
  • immutable parameters without a previous/supplied value;
  • scalar option parameters whose previous/supplied value is not in the current options.

Rejected alternatives:

  • Interactive terminal/PTY: larger UX change and keeps the CLI subprocess path.
  • coder update --use-parameter-defaults: only available in newer CLI versions and would not support required parameters without defaults.
  • Full dynamic-parameter webview: closer to the dashboard settings page, but larger than this issue.

Caveat: full dynamic-parameter editing inside VS Code would require a richer webview and dynamic evaluation flow. This PR keeps the UI lightweight and still relies on backend validation for final correctness.

Generated by Coder Agents.

@EhabY EhabY changed the title fix: update workspaces via API defaults fix: prompt for workspace update parameters May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't provide values/input for new workspace parameters when updating via extension pop-up?

1 participant