Skip to content

Replace the legacy replica groups serializer with a client patch - #4248

Merged
Bihan merged 1 commit into
dstackai:masterfrom
Bihan:replace_legacy_serializer_with_patch
Sep 2, 2026
Merged

Replace the legacy replica groups serializer with a client patch#4248
Bihan merged 1 commit into
dstackai:masterfrom
Bihan:replace_legacy_serializer_with_patch

Conversation

@Bihan

@Bihan Bihan commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Replica groups shipped in 0.21.3. Every earlier CLI — 0.20.7 through 0.21.2 — knows only replicas: [{count: ...}]. Until now that was handled by _serialize_legacy_replica_groups, which rewrote groups into the old layout on every dump, because the model has no way to know who it is serializing for. The server does: every request carries X-API-VERSION. So the rewrite moves into patch_run_spec, which converts groups back to replicas/count only for clients older than 0.21.3.

@Bihan
Bihan marked this pull request as ready for review September 2, 2026 09:10
@Bihan Bihan changed the title [Draft] Replace the legacy replica groups serializer with a client patch Replace the legacy replica groups serializer with a client patch Sep 2, 2026
@Bihan
Bihan merged commit 356c59d into dstackai:master Sep 2, 2026
27 checks passed
un-def added a commit that referenced this pull request Sep 3, 2026
`ServiceConfigurationParams.groups` was added in 0.21.3 (#4177) along
with a model serializer that popped `groups` from every dump and
re-emitted it as the legacy `replicas: [{count: ...}]` shape. Living on
the model, it applied in both directions, so a 0.21.3 client never put
`groups` on the wire.

PR #4248 removed that serializer in favor of a server-side patch gated
on `client_version < 0.21.3`. That covers server -> old client, but
nothing replaced client -> old server, so 0.21.4 clients always send
`configuration.groups` and servers before 0.21.3 reject it as an extra
field.

Exclude service `groups` when unset, as already done for
`TaskConfiguration.groups`. This covers all three client paths that send
a `run_spec`: `get_plan`, `apply`, and `gpus/list`.

Fixes: #4255

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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