Skip to content

Windows Git installer advertises -Tag but builds the current checkout instead #127352

Open

Description

@steipete

Summary

scripts/install.ps1 publicly accepts -Tag, including beta/exact release selectors, but the Git install path never passes that value to Install-OpenClawFromGit. Fresh clones remain on the clone default branch and existing checkouts update their current branch, then build it regardless of the requested selector.

Frozen source reviewed at a434545620127a3105699513d662395a43b43eb1; current main was rechecked and still calls:

Install-OpenClawFromGit -RepoDir $GitDir -SkipUpdate:$NoGitUpdate

with no $Tag argument.

Deterministic sequence

  1. On Windows run install.ps1 -InstallMethod git -Tag beta or -Tag <exact-version>.
  2. The public parameter accepts the selector.
  3. Main invokes Install-OpenClawFromGit with only repo dir and skip-update.
  4. The Git installer clones/pulls the current/default branch and builds it.
  5. Installation succeeds with bytes from a different ref than explicitly requested.

Owner / contract

  • scripts/install.ps1 declares [string]$Tag = "latest" and documents it as a public parameter.
  • The npm path resolves and uses $Tag.
  • Install-OpenClawFromGit accepts no tag/ref selector and only clones/pulls the current branch.
  • Main does not pass $Tag to the Git path.
  • POSIX Git installer siblings explicitly resolve requested branch/beta/exact selectors before build.

Current PowerShell tests bind -Tag main but do not assert selected Git HEAD/ref.

Targeted live issue/PR searches found no exact existing root. This is distinct from Windows release-writer binding work and from npm tag handling.

Suggested repair

Pass the requested selector into the Git installer, resolve it to an exact remote/local ref, and check it out before dependency installation/build. Explicit selectors must fail loudly when unavailable rather than silently building another ref.

Regression

Use a fake-Git fixture with distinguishable refs and cover:

  • default/latest behavior;
  • main;
  • beta / beta alias;
  • exact release version/tag;
  • missing selector.

Assert selected HEAD equals the request and checkout occurs before pnpm/build/wrapper publication.

Risk

Review required: installer release selection and provenance. A successful-looking install can publish a different version/channel than the operator explicitly requested.

Activity

  1. added
    bug
    maintainer
    on Aug 21, 2026
  2. added
    clawsweeper:needs-maintainer-review
    clawsweeper:no-new-fix-pr
    clawsweeper:source-repro
    impact:other
    issue-rating: 🦞 diamond lobster
    P1
    on Aug 21, 2026
  3. clawsweeper commented on Aug 21, 2026

    @clawsweeper
    Contributor

    Codex review: this still needs some work. Reviewed September 27, 2026, 5:05 PM ET / 21:05 UTC.

    Summary
    Current main still ignores the requested tag on Windows Git installs. The merged related PR repairs POSIX ref selection, leaving this Windows behavior unresolved.

    Reproducibility: yes. the current source gives a high-confidence path: invoke the Windows Git installer with -Tag beta or an exact version and inspect the checkout HEAD it builds. This read-only review did not run the Windows installer.

    Root-cause cluster
    Relationship: canonical
    Canonical: #127352
    Summary: The merged POSIX ref-selection repair overlaps the installer problem but does not fix the Windows PowerShell path.

    Members:

    Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

    Maintainer decision needed

    Question Recommendation
    Should an omitted -Tag keep the Windows Git install's current-branch behavior while an explicit -Tag latest selects the published stable release? Preserve the implicit Git default: Keep omitted -Tag on the existing checkout/default branch, but resolve explicit latest, beta, versions, and main before building.

    Why: The PowerShell default is latest but currently follows the checkout, whereas the POSIX Git installers resolve latest to a published release when available; changing the implicit Windows default affects upgrades.

    Next step
    The protected maintainer and no-new-fix-pr labels, together with the implicit-default decision, call for owner-led handling before a focused Windows repair.

    Review details

    Best possible solution:

    Resolve explicit Git selectors before dependency installation, show the chosen ref, and fail safely when it is unavailable or the existing checkout cannot switch without losing work.

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

    Yes, the current source gives a high-confidence path: invoke the Windows Git installer with -Tag beta or an exact version and inspect the checkout HEAD it builds. This read-only review did not run the Windows installer.

    Is this the best way to solve the issue?

    Yes for explicit selectors: resolve and verify the ref inside the existing PowerShell Git installer before building. The implicit default needs the owner choice recorded above.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • Changing the implicit Windows Git default to the POSIX latest-release behavior could switch existing source installations away from their current branch.

    Codex review notes: model internal, reasoning high; reviewed against 0d02ab7aaf65.

    Label changes

    Label changes:

    No label changes.

    Label justifications:

    • P2: An optional Windows Git install can successfully build the wrong requested release, with limited platform and install-method scope.
    • impact:other: The installer can publish source bytes from a different ref than the operator selected.
    Evidence reviewed

    What I checked:

    Likely related people:

    • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
    • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
    • Jason O'Neal: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
    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.
  4. added
    clawsweeper:needs-product-decision
    clawsweeper:no-new-fix-pr
    clawsweeper:needs-maintainer-review
    clawsweeper:fix-shape-clear
    and removed
    clawsweeper:needs-maintainer-review
    clawsweeper:no-new-fix-pr
    clawsweeper:needs-product-decision
    clawsweeper:fix-shape-clear
    on Aug 22, 2026
  5. added
    P2
    and removed
    P1
    clawsweeper:needs-maintainer-review
    on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2bugclawsweeper:needs-product-decisionclawsweeper:no-new-fix-prclawsweeper:source-reproimpact:otherissue-rating: 🦞 diamond lobstermaintainer

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions