Skip to content

fix: treat Go pseudo-versions as unknown server versions#590

Open
dal00 wants to merge 1 commit into
tale:mainfrom
dal00:fix/go-pseudo-version-unknown
Open

fix: treat Go pseudo-versions as unknown server versions#590
dal00 wants to merge 1 commit into
tale:mainfrom
dal00:fix/go-pseudo-version-unknown

Conversation

@dal00

@dal00 dal00 commented Jul 9, 2026

Copy link
Copy Markdown

Problem

Headscale's untagged builds — the per-commit main-* and development Docker images — report a Go pseudo-version from GET /version, e.g.:

v0.0.0-20260703052708-048308511c72

parseServerVersion matches this against the semver regex successfully, so it comes back as 0.0.0 with unknown: false. Every capability in capabilitiesFor() 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 like dev should 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.0 with a <14-digit timestamp>-<12-hex sha> prerelease — and return unknown: true for it, same as dev. A genuine 0.0.0 prerelease (e.g. v0.0.0-beta.1) still parses normally.

Testing

  • Added a unit test for the pseudo-version case and a guard test that v0.0.0-beta.1 is not flagged unknown
  • pnpm vitest run --project unit tests/unit/headscale/server-version.test.ts — 14/14 pass
  • Hit this in production running headscale/headscale:main-0483085 behind Headplane 0.7.0; with this change the agent gate passes

🤖 Generated with Claude Code

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>
@dal00 dal00 requested a review from tale as a code owner July 9, 2026 09:21
@github-actions github-actions Bot added the Integrations Related to Headplane integrations label Jul 9, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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_RE regex in app/server/headscale/api/server-version.ts to identify the <14-digit-timestamp>-<12-hex-sha> prerelease shape.
  • Marks v0.0.0-YYYYMMDDhhmmss-abcdefabcdef as unknown: true, matching the existing dev handling so modern code paths are exercised.
  • Adds unit tests covering the pseudo-version case and a guard ensuring a genuine v0.0.0-beta.1 prerelease is not flagged unknown.

Pullfrog  | View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Integrations Related to Headplane integrations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant