Repository navigation
fix(install): reject commit-less git checkouts - #113809
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 8:24 PM ET / August 1, 2026, 00:24 UTC. ClawSweeper reviewWhat this changesThe PR makes OpenClaw’s POSIX, CLI, and PowerShell Git installers reject an existing checkout whose Merge readinessKeep this PR open for installer-owner review, not cleanup: current Likely related people: Peter Steinberger is the only current-main history signal found for these installer entry points, with low confidence because the available blame trail is carried by a broad recent commit rather than a focused installer change. Priority: P2 Review scores
Verification
How this fits togetherThe Git install scripts either clone OpenClaw into a destination or reuse that destination before fetching, checking out, installing dependencies, and building. This change adds an early repository-validity gate so an incomplete clone receives an actionable recovery outcome rather than failing later in update or build work. flowchart LR
A[Git install destination] --> B[Official installer]
B --> C{Existing .git directory?}
C -->|No| D[Clone OpenClaw]
C -->|Yes| E{HEAD resolves to commit?}
E -->|Yes| F[Update checkout and build]
E -->|No| G[Preserve directory and show recovery guidance]
D --> F
Decision needed
Why: The patch is a targeted repair, but it intentionally changes upgrade/retry behavior for a pre-existing damaged local installation and makes operator recovery explicit. Before merge
Agent review detailsSecurityNone. PR surfaceTests +82, Other +40. Total +122 across 6 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Confirm that early, non-destructive failure is the intended installer recovery contract, then merge the pinned commit-object validation across the three owner scripts and retain the focused regression coverage. Do we have a high-confidence way to reproduce the issue? Yes, source reproducibly establishes the path: current main accepts Is this the best way to solve the issue? Yes, this is the best repair shape: each official installer owns its own lifecycle, and a pinned AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a1b41d5ddb05. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
41eea9d to
8955621
Compare
8955621 to
3b2147f
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review The hosted-installer source finding is addressed in the PR evidence. |
* fix(install): reject commit-less git checkouts * test(install): fix incomplete-checkout coverage * fix(install): pin incomplete checkout validation * test(install): update pinned checkout stub * fix(install): require checkout HEAD commit object
* origin/main: fix(install): reject commit-less git checkouts (openclaw#113809) chore(i18n): refresh native locales (openclaw#117948) fix(release): validate MiniMax M3 in stable lanes (openclaw#118017)
What Problem This Solves
Git install destinations that contain
.gitbut whoseHEADdoes not resolve to an existing commit object are currently accepted as reusable checkouts. Interrupted or damaged clones can therefore continue into update and build operations and fail later with misleading errors.Fixes #113808.
Why This Change Was Made
All three official Git install paths now validate the selected checkout before update, checkout, or build work:
scripts/install.shscripts/install-cli.shscripts/install.ps1The validation pins
--git-dirand--work-treeso Git cannot walk into a parent repository, and resolvesHEAD^{commit}so a dangling ref or missing object is rejected. The installers stop with recovery guidance and do not delete or move the checkout because it may contain recoverable objects, refs, or user files.User Impact
Users retrying a Git installation after an interrupted or damaged clone receive the actual cause immediately while their existing directory is preserved. Valid Git checkouts and first-time destinations are unchanged.
Evidence
Final head:
3b2147f2dfc35c34b600246ab31fe2093a4cb67f, rebased without conflicts onto17a8961a6a36e0bab0a56a248e9c79372ddff402.Real behavior
The probes used real Git repositories. The invalid fixture was nested inside a valid parent repository and had a syntactically valid branch ref whose commit object was absent. Each guard rejected the nested damaged checkout without touching its marker file; valid controls remained accepted.
The PowerShell result was produced by parsing and invoking the exact
Assert-GitCheckoutHasCommitfunction fromscripts/install.ps1, not a rewritten copy.A direct Git control demonstrates why the final peel is required:
Focused tests
Both changed shell installers also pass
bash -n, andgit diff --checkis clean.Canonical hosted delivery path
The repository copies changed by this PR are the canonical installer sources.
.github/workflows/website-installer-sync.ymlis triggered whenever any of these three files changes. After its static, Linux Docker, macOS, and Windows jobs pass, thesync-websitejob runs on pushes tomainand copies these exact sources into the hosted repository:The workflow then validates the synced website assets, builds the website, commits them, and pushes
openclaw.ai/main(sync implementation). Therefore a separate contributor patch toopenclaw/openclaw.aiwould duplicate generated output and race the canonical sync.Current Website Installer Sync run 30462223171:
Review
Final-patch autoreview reported:
The clean review ran immediately before the current-main rebase.
git range-diffreports all five commits as exact (=) matches after the rebase, and the focused tests were rerun on the final head.