Conversation
EhabY
force-pushed
the
fix/1095-update-reconnect-race
branch
2 times, most recently
from
September 17, 2026 17:11
668ce42 to
bf287af
Compare
EhabY
force-pushed
the
fix/1095-update-reconnect-race
branch
from
September 18, 2026 12:26
5585be7 to
43ff3d8
Compare
EhabY
force-pushed
the
fix/1095-update-reconnect-race
branch
from
September 18, 2026 12:47
43ff3d8 to
131d30b
Compare
EhabY
marked this pull request as ready for review
September 18, 2026 12:47
EhabY
force-pushed
the
fix/1095-update-reconnect-race
branch
2 times, most recently
from
September 18, 2026 22:24
44bc3f5 to
dc31dd9
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. While that build is queued, the state machine follows it instead of starting the workspace itself, and a failed update asks before connecting to the existing version instead of falling back silently. Split the version-keyed capabilities into `CliFeatureSet` and `ServerFeatureSet` so the new check reads the deployment version rather than the CLI's. The Tasks panel moves with it, bounded to the releases that serve `/api/v2/tasks`: 2.29 through 2.34. Fixes #1095
EhabY
force-pushed
the
fix/1095-update-reconnect-race
branch
from
September 18, 2026 22:37
dc31dd9 to
df24ea4
Compare
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 slot in betweencoder update, or the REST API on CLIs before 2.24The server owns the slot from the moment the stop build is posted, so a reconnect can no longer jump ahead of the update.
template_version_idstays unset on the queued start, because pinning a follow-up build requires template update permission and the update targets the active version anyway. A workspace that is already stopped takes a lone start build, which can name the version.While the queued build runs, the state machine follows it instead of starting the workspace itself, and it ignores monitor events from older builds.
On a failed update, a modal offers Connect Anyway instead of silently falling back to the old version. Declining aborts the connection.
Feature sets
FeatureSetbecomesCliFeatureSet, and a newServerFeatureSetkeys the 2.36 check to the deployment version instead of the CLI's. The Tasks check moves there too, bounded to 2.29 through 2.34, the releases that serve/api/v2/tasks(coder/coder#20921 promoted it out of/api/experimental). Below 2.29 the panel used to show and then 404 on every poll.Validation
pnpm lint,pnpm typecheck,pnpm format:check, andpnpm test(2,729 passed, 1 skipped, 185 files). No live SSH-race reproduction or Windows smoke test.Fixes #1095.