fix(client): prevent stale service replacement - #42185
Closed
kitlangton wants to merge 1 commit into
Closed
Conversation
This was referenced Aug 13, 2026
Contributor
Author
|
Closing because this encodes the wrong rollback policy. Older Desktop must be able to intentionally downgrade its managed service; treating every newer service as compatible creates a partial rollback where the UI downgrades but the server does not. We will track replacement authority and the concrete scenarios in a separate design issue. |
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.
What
Prevent an older CLI or Desktop client from replacing a newer managed background service.
Before / After
Before
A client required its exact installed version. After an update, an older client saw the newer service as incompatible and replaced it with the older binary. A newer client could then replace that service again.
After
CLI and Desktop accept a service at the same or a newer comparable version. A newer client still sees an older service as incompatible, so normal automatic upgrades continue.
flowchart TD A[Client discovers service] --> B{Service version >= client?} B -->|Yes| C[Reuse service] B -->|No| D[Existing replacement path]How
packages/client/src/service-version.tscompares stable and numeric preview versions and conservatively accepts incomparable development versions.packages/cli/src/services/service-config.tsuses the compatibility predicate for managed startup.packages/desktop/src/main/background-cli.tsapplies the same policy.Scope
This PR only changes version compatibility policy. It does not change stop authentication, PID signaling, Promise registration validation, migration polling, service election, or TUI presentation.
Testing
cd packages/client && bun run testcd packages/client && bun typecheckcd packages/cli && bun run test test/server-connection.test.ts --test-name-pattern 'service options'cd packages/cli && bun typecheckcd packages/desktop && bun typecheck