Skip to content

feat: add dynamic workspace update parameter editor - #1114

Draft
EhabY wants to merge 1 commit into
mainfrom
feat/workspace-update-parameters
Draft

EhabY wants to merge 1 commit into
mainfrom
feat/workspace-update-parameters

Conversation

@EhabY

@EhabY EhabY commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add a dedicated editor-tab form for dynamic workspace update parameters, using debounced REST evaluation with stale-response protection.
  • Route explicit Update Workspace and Update and Start through the form; preserve classic parameter prompting.
  • Pin evaluation/submission to the selected template version, guard cancellation and build conflicts, and suppress parameter-bearing HTTP bodies/error details in logs.

Addresses #972. The SSH-autostart/build race in #1095 remains separate; this PR uses sequential REST stop/start and does not claim to resolve that race.

Validation

  • Passed: pnpm typecheck, NODE_OPTIONS=--max-old-space-size=4096 pnpm lint, pnpm format:check, pnpm build, and git diff --check.
  • pnpm test --maxWorkers=2: 183 files passed; 2,716 tests passed, 1 skipped.
  • Independent correctness review found no blocking issues within this scope.
  • An isolated local/UI VS Code resolver harness confirmed webview loading and message delivery while authority resolution remained pending.
  • Still needed: live dynamic-template deployment validation, including owner-dependent conditional fields/options. Full VS Code integration tests were not run in the final pass; the harness is not a Coder/Remote-SSH end-to-end test.
Approved implementation plan and decisions

Scope

  1. Dedicated Update Workspace editor tab, independent of the experimental sidebar.
  2. Reactive REST evaluation for now. Existing receive-only WebSocket helpers are not a drop-in fit; WebSocket transport is deferred.
  3. Keep Updating workspace via VS Code fails #1095 separate, including its build-concurrency fix and older-server fallback policy.

Implementation

  • Add the shared typed IPC contract, React webview package using existing UI controls, extension panel factory, and extension-owned evaluation/submission session.
  • Bind the session to deployment/workspace owner, source build, and target template version. Load stored parameters; evaluate with the actual workspace owner.
  • Preserve conditional historical values, reset ephemeral historical inputs, lock existing immutable fields while allowing first-use immutable values, and retain fatal prior-state diagnostics. Validate monotonic constraints before stopping.
  • Debounce edits and immediately invalidate stale evaluations using extension-owned generations, since REST response IDs do not echo request IDs. Block pending, invalid, and stale submissions; retain local typing drafts.
  • Use exhaustive command/request handler maps and shared IPC helpers. Resend state on visibility/theme changes, bound renderer readiness, and dispose in-memory state on close.
  • Recheck source build and target version before mutation. Wait for successful stop, start the exact evaluated version, and verify the resulting build. Never blindly retry an ambiguous build request; closing during stop must not advance to start.
  • Keep parameter values out of persistence, CLI arguments, telemetry, and HTTP body/error logging; render descriptions and diagnostics as text.
  • Add focused session, panel lifecycle, form, routing, cancellation, and sensitive-logging tests plus Storybook examples; run repository checks.

UI decisions and limitations

  • Reuse VS Code-style controls: radio→Select, switch→Checkbox, slider→numeric Input, multi-select→checkboxes. Tag/list input uses a JSON string array to preserve commas within items.
  • Show requiredness, disabled/immutable state, diagnostics, evaluation progress, Retry where safe, Cancel, and explicit Update and Restart with a destructive-update warning.
  • The sequential stop/start path does not serialize unrelated clients; Updating workspace via VS Code fails #1095 is not closed by this work. Closing after a build starts cannot cancel that server build.

Generated by Coder Agents on behalf of @EhabY.

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.

1 participant