Skip to content

install: fail closed when npm latest has no matching git tag #144191

Closed as not planned

Description

@SebTardif

What happens

A git install that resolves OPENCLAW_VERSION=latest through the npm latest dist-tag can land on a correction release that has no matching GitHub tag. Checkout should fail closed instead of silently installing a different ref.

Dirty checkouts and --no-git-update should install the prepared tree without running npm tag resolve. Detection must treat a git worktree as a git checkout (.git is a file, so -d .git is false).

After checkout, package.json version should match the requested v* ref. Main already has Could not resolve requested git ref via #130907 (git_install_lockfile_flag). The remaining gap is an explicit checkout-vs-ref assert (assert_git_checkout_matches_ref) plus worktree-safe .git detection so a dirty worktree is not treated as a GitHub clone path.

How to see it (from reading the installer, not a live curl|bash run)

  1. Request OPENCLAW_VERSION=latest when npm latest is a correction release with no matching git tag.
  2. Or install from a dirty git worktree (.git is a file). -d "$repo_dir/.git" is false, so the installer can take the GitHub clone path instead of the local dirty-skip path.

Expected

  • Missing exact tag: fail closed, no silent downgrade.
  • Dirty / --no-git-update: install the prepared tree, do not resolve npm latest.
  • Worktree .git file: same dirty / local-checkout paths as a normal .git directory.
  • After a v* checkout: package.json matches the requested ref.

Candidate PR

#112754 is a candidate. It is not merge-ready (Claw budget-close / silver). Keep this issue open if that PR is closed to free a barnacle slot.

Activity

  1. SebTardif commented on Sep 10, 2026

    @SebTardif
    ContributorAuthor

    Candidate PR is #112754. The PR body uses Ref so this issue stays open if that PR is closed unmerged to free a barnacle slot.

  2. added
    P2
    clawsweeper:needs-product-decision
    clawsweeper:no-new-fix-pr
    clawsweeper:source-repro
    impact:ux-friction
    issue-rating: 🦞 diamond lobster
    on Sep 10, 2026
  3. clawsweeper commented on Sep 10, 2026

    @clawsweeper
    Contributor

    Codex review: this still needs some work.

    Summary
    Keep open with narrower scope: main fixes worktree recognition and rejects unresolved refs, but dirty checkouts still perform unnecessary npm resolution, and the remaining selector requirements need a compatibility decision.

    Reproducibility: Source proves the unused dirty-checkout npm lookup; no live installer reproduction ran, and current main does not support the alleged general silent downgrade.

    Root-cause cluster
    Relationship: canonical
    Canonical: #144191
    Summary: This issue retains the remaining acceptance criteria after the original candidate closed; subsequent merged PRs cover parts of the request.

    Members:

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

    Maintainer decision needed

    • Question: Should the remaining work preserve explicit-ref and --no-git-update behavior, or redefine those contracts to enforce prepared-tree installation and version equality?
    • Recommendation: Preserve existing selector contracts: Remove npm resolution from dirty-checkout paths and consider version assertions only for explicitly identified release selectors.
    • Why: The issue combines a narrow unnecessary lookup with requirements that conflict with documented and tested selector behavior.

    Next step
    Confirm compatibility-preserving scope, then establish a failing installer regression for dirty-checkout npm resolution before repairing both entry points.

    Review details

    Best possible solution:

    Remove unused dirty-checkout resolution and define release-only validation separately from supported branch and commit selection.

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

    Source proves the unused dirty-checkout npm lookup; no live installer reproduction ran, and current main does not support the alleged general silent downgrade.

    Is this the best way to solve the issue?

    Worktree recognition is already repaired; a narrow dirty-checkout lookup change is appropriate, while blanket version assertions and prepared-tree no-update semantics require an explicit compatibility decision.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • Applying package-version equality to every v-prefixed ref would reject supported branch selectors such as v2-hotfix.
    • Making --no-git-update preserve any prepared tree would change the documented requested-ref selection contract.

    Codex review notes: model internal, reasoning medium; reviewed against d821a7fd1dc8.

    Label changes

    Label changes:

    No label changes.

    Label justifications:

    • P2: The remaining behavior affects an advanced source-install workflow with limited scope.
    • impact:ux-friction: Dirty source checkouts perform unnecessary npm metadata resolution before preserving their existing tree.
    Evidence reviewed

    What I checked:

    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; those execution lanes are retired.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

    Reviewed October 28, 2026, 8:30 PM ET / October 29, 2026, 00:30 UTC.

  4. added
    clawsweeper:needs-maintainer-review
    on Oct 4, 2026
  5. openclaw-barnacle commented on Oct 28, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale after 7 days without qualifying human activity.
    Without new human activity, Barnacle may close it as not planned 7 days after this message was posted. This is administrative inactivity cleanup, not a claim that the problem is fixed.
    A human update restarts the inactivity clock; a new PR head also restarts it. A maintainer can add no-stale for a durable hold, or bad-barnacle to suppress Barnacle. Remove the hold when work can resume.

  6. added
    stale
    on Oct 28, 2026
  7. added
    clawsweeper:intake:bug
    clawsweeper:intake:needs-environment
    and removed
    clawsweeper:intake:bug
    clawsweeper:intake:needs-environment
    on Oct 29, 2026
  8. openclaw-barnacle commented on Nov 5, 2026

    @openclaw-barnacle

    Closing as not planned after the inactivity notice and full retest/update grace. This is an administrative close; the reported problem has not been confirmed fixed. Please reopen with current reproduction details if it still occurs.

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

    P2clawsweeper:needs-maintainer-reviewclawsweeper:needs-product-decisionclawsweeper:no-new-fix-prclawsweeper:source-reproimpact:ux-frictionissue-rating: 🦞 diamond lobsterstale

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions