Conversation
EhabY
force-pushed
the
fix/1095-update-reconnect-race
branch
from
September 17, 2026 16:43
492f431 to
668ce42
Compare
`coder update` runs a stop build and then a start build. Between the two, the extension's own `coder ssh` reconnect autostarts the workspace on the old template version, so the update's start build is rejected with "A workspace build is already active" and the workspace comes back unchanged. On servers from 2.36, post a single build that carries the start in `on_success`, so nothing can take the build slot in between. Leave `template_version_id` unset on the follow-up build, because pinning it requires template update permission and the update targets the active version anyway. Servers before 2.36 keep the `coder update` path, and CLIs before 2.24 keep the REST path. Pass `--disable-autostart` as an internal SSH flag so a custom `coder.sshFlags` value cannot drop it, and ask before connecting to the existing version when an update fails instead of falling back silently. Fixes #1095
EhabY
force-pushed
the
fix/1095-update-reconnect-race
branch
from
September 17, 2026 17:11
668ce42 to
bf287af
Compare
The ProxyCommand expectations hardcoded POSIX separators, so they failed on Windows, where the paths are joined with backslashes and then quoted. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
coder updateruns a stop build and then a start build. Between the two, the extension's owncoder sshreconnect autostarts the workspace on the old template version, so the update's start build is rejected:The workspace restarts on the version it already had, and the extension logs a warning and connects anyway.
Changes
on_success, so nothing can take the build slot in between.template_version_idstays unset on the follow-up build, because pinning it requires template update permission and the update targets the active version anyway.coder update, or REST on CLIs before 2.24.--disable-autostartbecomes an internal SSH flag, so a customcoder.sshFlagsvalue cannot drop it.The state machine ignores monitor events older than the accepted build and waits for the server to create the start build instead of racing it.
Validation
pnpm lint,pnpm typecheck,pnpm format:check, andpnpm test(2,691 passed, 1 skipped). No live SSH-race reproduction or Windows smoke test.Fixes #1095.
🤖 Generated with Claude Code