Skip to content

fix(updater): exclude prerelease tags from stable channel git resolution - #86424

Closed
1052326311 wants to merge 1 commit into
openclaw:mainfrom
1052326311:fix/git-updater-stable-excludes-alpha
Closed

1052326311 wants to merge 1 commit into
openclaw:mainfrom
1052326311:fix/git-updater-stable-excludes-alpha

Conversation

@1052326311

Copy link
Copy Markdown
Contributor

Summary

openclaw update on git installs with the stable channel can check out alpha tags (e.g. v2026.5.24-alpha.1) because isStableTag only excludes beta — every other prerelease suffix passes the stable filter. The git updater then sorts all v* tags descending and picks the first isStableTag match, which can be an alpha tag newer than the latest stable release.

This PR widens the stable gate by introducing isPrereleaseTag (matches alpha, beta, rc, canary, dev, nightly, preview suffixes) and changes isStableTag to exclude all prereleases, not just beta. No changes to npm registry resolution — only the git tag filter is affected.

Closes #86218.

Change Type

  • Bug fix
  • Test

Scope

  • CLI / Updater

Linked Issue

Real behavior proof

Behavior or issue addressed: On a git-based install configured for the stable channel, openclaw update checks out v2026.5.24-alpha.1 instead of v2026.5.22 because isStableTag only rejects beta tags and lets alpha tags through.

Real environment tested: macOS Darwin 25.4.0 arm64, Node v22.22.0, openclaw branch fix/git-updater-stable-excludes-alpha rebased on upstream main commit 9afbfc1b63cde5e152e24f280f2132d8957bc50f.

Exact steps or command run after this patch:

  1. node scripts/run-vitest.mjs run src/infra/update-channels.test.ts — focused tag classification tests.
  2. node scripts/run-vitest.mjs run test/scripts/install-sh.test.ts test/scripts/install-cli.test.ts — Sweeper acceptance criteria.
  3. Drift proof: reverted src patch, re-ran update-channels.test.ts — new tests fail on missing isPrereleaseTag export.
  4. pnpm exec oxfmt --check src/infra/update-channels.ts src/infra/update-channels.test.ts
  5. pnpm exec oxlint src/infra/update-channels.ts src/infra/update-channels.test.ts

Evidence after fix:

$ node scripts/run-vitest.mjs run src/infra/update-channels.test.ts

 ✓  unit-fast  ../../src/infra/update-channels.test.ts (41 tests) 4ms

 Test Files  1 passed (1)
      Tests  41 passed (41)
$ node scripts/run-vitest.mjs run test/scripts/install-sh.test.ts test/scripts/install-cli.test.ts

 ✓  tooling  ../scripts/install-sh.test.ts (34 tests) 2315ms
 ✓  tooling  ../scripts/install-cli.test.ts (16 tests) 5144ms

 Test Files  2 passed (2)
      Tests  50 passed (50)

Drift proof (patch reverted):

$ git stash push -- src/infra/update-channels.ts

$ node scripts/run-vitest.mjs run src/infra/update-channels.test.ts

 ×  classifies v2026.2.24-alpha.1 — expected stable=false, got true
 ×  classifies v2026.2.24-rc.1 — expected stable=false, got true
 ×  classifies v2026.5.24-alpha.1 — expected stable=false, got true
 ×  excludes prerelease tags from stable — isPrereleaseTag is not exported

 Test Files  1 failed (1)
      Tests  6 failed | 35 passed (41)

$ git stash pop
$ pnpm exec oxlint src/infra/update-channels.ts src/infra/update-channels.test.ts
Found 0 warnings and 0 errors.

$ pnpm exec oxfmt --check src/infra/update-channels.ts src/infra/update-channels.test.ts
All matched files use the correct format.

Observed result after fix: isStableTag("v2026.5.24-alpha.1") now returns false. Tags with alpha, rc, canary, dev, nightly, or preview suffixes are correctly excluded from stable channel resolution. Pure version tags like v2026.5.22 still return true. The git updater will no longer check out prerelease tags on the stable channel.

What was not tested: A live openclaw update on a real git clone with alpha tags present was not executed; the fix is verified through focused unit tests covering all prerelease suffix variants and the Sweeper-specified acceptance test suite.

Root Cause

isStableTag in src/infra/update-channels.ts:40 is defined as !isBetaTag(tag), where isBetaTag only matches the substring "beta". Alpha, rc, canary, dev, nightly, and preview tags pass through the stable filter. The git updater (src/infra/update-runner.ts:293) sorts all v* tags descending and returns the first isStableTag match, so an alpha tag with a higher version number is selected over the true latest stable release.

Regression Test Plan

  • Extended the existing tag classification table in src/infra/update-channels.test.ts with alpha, rc, canary, preview, and v2026.5.24-alpha.1 (the exact tag from Git updater on stable channel checked out alpha tag instead of npm latest #86218) cases, each asserting stable: false.
  • Added a dedicated excludes prerelease tags from stable test covering all 7 prerelease suffixes (alpha, beta, rc, canary, dev, nightly, preview) plus 3 stable tags as negative controls.
  • Drift proof confirmed: reverting the source patch causes 6 test failures (4 classification + 2 in the dedicated test).

User-visible / Behavior Changes

  • openclaw update on git installs configured for the stable channel will no longer check out alpha/rc/canary/preview tags. Only pure version tags (e.g. v2026.5.22) are considered stable.
  • Beta channel behavior is unchanged.
  • npm registry resolution is unchanged — only the git tag filter is affected.

Scope boundary

  • Only isStableTag semantics in src/infra/update-channels.ts are changed; isBetaTag retains its original meaning for the beta channel.
  • No changes to update-runner.ts, update-cli.ts, or any channel other than stable git tag resolution.
  • No changes to npm dist-tag resolution.

Prior art

No prior PR found targeting #86218 at the time of this submission. The isStableTag = !isBetaTag definition dates back to the initial updater channel implementation.

…l resolution

Introduce isPrereleaseTag covering alpha, beta, rc, canary, dev,
nightly, and preview suffixes. Change isStableTag to use
!isPrereleaseTag so the git updater no longer checks out prerelease
tags on the stable channel.

Closes openclaw#86218
@openclaw-barnacle openclaw-barnacle Bot added size: XS proof: supplied External PR includes structured after-fix real behavior proof. labels May 25, 2026
@clawsweeper

clawsweeper Bot commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed May 25, 2026, 5:43 AM ET / 09:43 UTC.

Summary
The branch adds an isPrereleaseTag helper, makes isStableTag reject common prerelease suffixes, expands tag-classification tests, and adds a changelog fix entry.

PR surface: Source +4, Tests +26, Docs +1. Total +31 across 3 files.

Reproducibility: yes. from source inspection: current main treats stable as not-beta and the git updater checks out the first sorted stable match, so a newer alpha tag can win over the true stable tag. I did not run a live updater repro in this read-only review.

Review metrics: none identified.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🦪 silver shellfish
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Add redacted terminal output or logs from a real git checkout or dry-run fixture with both v2026.5.24-alpha.1 and v2026.5.22 showing the stable channel resolves to the stable tag.

Proof guidance:
Needs real behavior proof before merge: The PR body provides unit/installer test output and drift proof, but no after-fix live or dry-run git update proof in a real checkout; add redacted terminal/log proof and update the PR body to trigger a fresh review, or ask a maintainer for @clawsweeper re-review.

Risk before merge

  • Real behavior proof is currently test-only; before merge, the PR needs redacted terminal/log proof from a real git checkout or dry-run scenario with both stable and prerelease tags present.

Maintainer options:

  1. Decide the mitigation before merge
    Land the narrow tag-classification fix after real git-update proof or maintainer-run live proof confirms stable git updates choose the stable tag while preserving legacy numeric patch tags.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge
No automated repair is needed; the patch looks correct, but an external PR needs real behavior proof and normal required-check review before merge.

Security
Cleared: The diff only changes an updater tag predicate, focused tests, and changelog text; it does not touch dependencies, workflows, secrets, lockfiles, package scripts, or downloaded code paths.

Review details

Best possible solution:

Land the narrow tag-classification fix after real git-update proof or maintainer-run live proof confirms stable git updates choose the stable tag while preserving legacy numeric patch tags.

Do we have a high-confidence way to reproduce the issue?

Yes from source inspection: current main treats stable as not-beta and the git updater checks out the first sorted stable match, so a newer alpha tag can win over the true stable tag. I did not run a live updater repro in this read-only review.

Is this the best way to solve the issue?

Yes, the patch directly tightens the shared stable-tag predicate and adds focused regression coverage without changing npm registry resolution. The solution still needs real git-update proof before merge.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 4737e1905871.

Label changes

Label changes:

  • add P2: This is a normal-priority updater correctness fix with limited blast radius to git installs using stable or beta tag resolution.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body provides unit/installer test output and drift proof, but no after-fix live or dry-run git update proof in a real checkout; add redacted terminal/log proof and update the PR body to trigger a fresh review, or ask a maintainer for @clawsweeper re-review.

Label justifications:

  • P2: This is a normal-priority updater correctness fix with limited blast radius to git installs using stable or beta tag resolution.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body provides unit/installer test output and drift proof, but no after-fix live or dry-run git update proof in a real checkout; add redacted terminal/log proof and update the PR body to trigger a fresh review, or ask a maintainer for @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +4, Tests +26, Docs +1. Total +31 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 5 1 +4
Tests 1 34 8 +26
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 40 9 +31

What I checked:

Likely related people:

  • steipete: Git history shows Peter Steinberger introduced dev update-channel support, added beta/stable fallback behavior, expanded update-channel helper coverage, and has the largest commit count in the central updater files. (role: feature owner and historical update-channel contributor; confidence: high; commits: 4ebf55f1db82, 3d5ffee07fa7, bc9a9cf9723c; files: src/infra/update-runner.ts, src/infra/update-channels.ts, src/infra/update-channels.test.ts)
  • vincentkoc: Recent commits touched update CLI self-update, package-root targeting, and package-manager flows adjacent to this git/package updater surface. (role: recent adjacent updater contributor; confidence: medium; commits: 6cc824433374, a24af4910018, 5a7aba94a2bf; files: src/cli/update-cli/update-command.ts, src/cli/update-cli.test.ts, src/infra/update-runner.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels May 25, 2026
@clawsweeper

clawsweeper Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@steipete

Copy link
Copy Markdown
Contributor

Thanks for the careful fix here. I picked #86260 as the canonical PR for this bug because it has the same stable-tag classifier change plus an update-runner regression that proves the git updater checks out the stable tag when a newer prerelease tag sorts first.

I refreshed #86260 on current main, left-tested src/infra/update-channels.test.ts and src/infra/update-runner.test.ts, and autoreview is clean on that exact head, so I am closing this duplicate to keep the queue tidy.

@steipete steipete closed this May 25, 2026
@1052326311

Copy link
Copy Markdown
Contributor Author

Thanks @steipete — totally fair call, #86260 has the broader update-runner regression coverage which is the right canonical fix. Glad to see this one moving forward.

Already lined up the next batch of queueable-fixes from our enterprise OpenClaw deployments — keeping each PR narrow, proof-backed, and minimal so the maintainer queue stays clean. More incoming.

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

Labels

P2 Normal backlog priority with limited blast radius. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Git updater on stable channel checked out alpha tag instead of npm latest

2 participants