fix: treat Go pseudo-versions as unknown server versions#590
Open
dal00 wants to merge 1 commit into
Open
Conversation
Headscale's untagged builds (per-commit main-* and development Docker images) report a Go pseudo-version such as v0.0.0-20260703052708-048308511c72 instead of "dev". This parses as semver 0.0.0, so capabilitiesFor() denies every capability — the UI shows "Agent requires Headscale 0.28 or newer" against a server running the newest code. Detect the pseudo-version shape (0.0.0 with a <14-digit timestamp>-<12-hex sha> prerelease) and mark it unknown, matching the existing intent that unknown versions exercise the modern code paths. A genuine 0.0.0 prerelease like v0.0.0-beta.1 still parses normally. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — Detects Go module pseudo-versions from untagged Headscale builds and treats them as unknown server versions so capability gating doesn't lock out main-* / development images.
- Adds a
GO_PSEUDO_VERSION_PRERELEASE_REregex inapp/server/headscale/api/server-version.tsto identify the<14-digit-timestamp>-<12-hex-sha>prerelease shape. - Marks
v0.0.0-YYYYMMDDhhmmss-abcdefabcdefasunknown: true, matching the existingdevhandling so modern code paths are exercised. - Adds unit tests covering the pseudo-version case and a guard ensuring a genuine
v0.0.0-beta.1prerelease is not flagged unknown.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
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
Headscale's untagged builds — the per-commit
main-*anddevelopmentDocker images — report a Go pseudo-version fromGET /version, e.g.:parseServerVersionmatches this against the semver regex successfully, so it comes back as0.0.0withunknown: false. Every capability incapabilitiesFor()is then denied, and the UI shows "Agent requires Headscale 0.28 or newer" against a server that is actually running the newest code on main.The existing design intent (per the comment on
ServerVersion.unknown) is that unrecognizable versions likedevshould be treated as fully capable so modern code paths get exercised. A Go pseudo-version is exactly such a dev build — it just happens to parse.Fix
Detect the pseudo-version shape —
0.0.0with a<14-digit timestamp>-<12-hex sha>prerelease — and returnunknown: truefor it, same asdev. A genuine0.0.0prerelease (e.g.v0.0.0-beta.1) still parses normally.Testing
v0.0.0-beta.1is not flagged unknownpnpm vitest run --project unit tests/unit/headscale/server-version.test.ts— 14/14 passheadscale/headscale:main-0483085behind Headplane 0.7.0; with this change the agent gate passes🤖 Generated with Claude Code