Skip to content

fix(update): support shallow partial source checkouts - #154191

Merged
steipete merged 1 commit into
mainfrom
codex/fix-shallow-partial-update
Sep 21, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-shallow-partial-update

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes openclaw update failing with Git target inspection clone failed (exit 128) when a shallow partial source checkout has historical objects that have not been downloaded.

User Impact

Source updates can inspect and validate the candidate without hydrating or otherwise changing the installed checkout before admission. The existing Gateway keeps serving during validation.

This fix belongs to the installed updater. An older updater cannot obtain it from the candidate on its first update; that checkout needs its missing objects fetched before retrying.

Why This Change Was Made

Git ignores local object sharing when cloning a shallow repository and switches to its transfer protocol, whose upload-pack process refuses to fetch missing promised objects. The updater now initializes its private bare inspection repository from the installed refs, HEAD, shallow boundary, and shared object directory. Its existing configured remotes fetch candidate objects into that private repository, and normal admission still owns installation.

Evidence

  • Reproduced on an AWS source installation and with a healthy three-commit shallow partial Git fixture. The original updater fails before target admission; the fixed updater reaches admission while a complete installed-tree snapshot remains unchanged.
  • Real Git coverage includes shallow partial activation after upstream is taken offline, detached revisions, relative remotes, transport configuration, rollback identity, object transfer, and cleanup.
  • Transfer suite: all 12 tests passed, including a regression for truncated inspection output after a zero exit (48.43 seconds wall with one worker).
  • Measured standalone admission suite: pnpm test src/infra/update-runner-git-admission.test.ts --maxWorkers=1 passed all 33 tests in 95.21 seconds wall (85.19 seconds Vitest).
  • The added shallow proof cases took 3.06 and 4.09 seconds. These need real Git: a mocked clone cannot detect Git switching from local sharing to upload-pack. The existing admission suite exceeds 30 seconds because it verifies full source-update flows against real repositories.
  • Full check:changed passed. Core types, infra test types, and targeted lint were also refreshed after the review correction. Formatting and git diff --check passed.
  • Diff-scoped cleanup and independent P0–P2 review completed with no remaining actionable findings. CI timing is pending the published head.

@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S maintainer Maintainer-authored PR labels Sep 21, 2026
@steipete
steipete marked this pull request as ready for review September 21, 2026 00:09
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 20, 2026, 8:18 PM ET / September 21, 2026, 00:18 UTC.

ClawSweeper review

What this changes

The source updater now prepares a private Git inspection repository directly, allowing shallow partial checkouts to validate updates without changing the installed checkout.

Merge readiness

✅ Ready for maintainer review

The fix remains useful: current main still uses the clone operation implicated in the failure. No actionable correctness or security defect was found in the introduced patch, and the maintainer-protected PR should remain open.

Priority: P2
Reviewed head: 1cbaabec49713e925ad34cc1e22e49ce897a3b91

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful Git-boundary coverage, clear first-update disclosure, and no blocking finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied maintainer identity exempts this PR from the external-contributor gate. The body reports AWS reproduction and real-Git admission and activation results for the changed inspection owner; this review did not independently execute them.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied maintainer identity exempts this PR from the external-contributor gate. The body reports AWS reproduction and real-Git admission and activation results for the changed inspection owner; this review did not independently execute them.
Evidence reviewed 7 items Pinned patch ownership: Reviewed the introduced delta from ddb31b3 to the original PR head. The production change replaces inspection cloning with private repository initialization, ref and HEAD copying, shallow-boundary copying, and an alternate object directory.
Current main still needs the repair: Fetched main retains the mirror/shared clone operation in the inspection owner. Its implementation matches the pre-patch owner; no current-main implementation of this repair was established. Release inclusion was not established.
Admission and activation remain separately owned: The caller still validates candidates, prepares a self-contained object transfer, checks the installed source for changes, and runs admission before importing and activating the pinned candidate. The patch does not change requester authority, migration policy, or activation permissions.
Findings None None.
Security None None.

How this fits together

The source updater resolves and builds a candidate while the installed Gateway continues serving. Git inspection supplies the candidate to admission checks before installation and activation.

flowchart LR
 A[Installed source checkout] --> B[Private Git inspection repository]
 C[Configured remotes] --> B
 B --> D[Candidate build and validation]
 D --> E{Admission checks}
 E -->|Accepted| F[Install and activate candidate]
 E -->|Refused| G[Keep installed Gateway]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +38, Tests +44, Docs +3. Total +85 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 1 48 10 +38
Tests 2 59 15 +44
Docs 1 3 0 +3
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 110 25 +85

Review metrics

Metric Value Why it matters
Production versus test growth Production +38 net lines; tests +44 net lines Production growth replaces Git's unsuitable clone operation within the existing inspection owner; tests extend established fixtures.

Technical review

Best possible solution:

Keep inspection isolated from the installed checkout while preserving its Git identity, configured transports, and existing admission and activation lifecycle.

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

Yes: the real-Git fixture supplies a concrete shallow partial checkout with missing historical objects, and current main retains the failing clone path. This review inspected that path and coverage without executing a reproduction.

Is this the best way to solve the issue?

Yes: replacing the clone operation inside the existing inspection owner addresses the reported mechanism without adding a competing updater or changing installation policy.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: Repairs source updates for a bounded shallow-partial-checkout configuration while preserving the serving Gateway.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied maintainer identity exempts this PR from the external-contributor gate. The body reports AWS reproduction and real-Git admission and activation results for the changed inspection owner; this review did not independently execute them.

Label justifications:

  • P2: Repairs source updates for a bounded shallow-partial-checkout configuration while preserving the serving Gateway.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied maintainer identity exempts this PR from the external-contributor gate. The body reports AWS reproduction and real-Git admission and activation results for the changed inspection owner; this review did not independently execute them.

Evidence

What I checked:

  • Pinned patch ownership: Reviewed the introduced delta from ddb31b3 to the original PR head. The production change replaces inspection cloning with private repository initialization, ref and HEAD copying, shallow-boundary copying, and an alternate object directory. (src/infra/update-runner-git-target.ts:138, 1cbaabec4971)
  • Current main still needs the repair: Fetched main retains the mirror/shared clone operation in the inspection owner. Its implementation matches the pre-patch owner; no current-main implementation of this repair was established. Release inclusion was not established. (src/infra/update-runner-git-target.ts:134, 68def4154c7c)
  • Admission and activation remain separately owned: The caller still validates candidates, prepares a self-contained object transfer, checks the installed source for changes, and runs admission before importing and activating the pinned candidate. The patch does not change requester authority, migration policy, or activation permissions. (src/infra/update-runner-git.ts:367, 1cbaabec4971)
  • Meaningful real-Git regression coverage: The extended fixture creates a shallow partial clone with absent historical objects. Added cases verify successful activation after upstream is taken offline and admission refusal with an unchanged installed-tree snapshot. Existing cases cover relative remotes, effective transport settings, detached targets, publication, and retained-runtime recovery. Tests were inspected, not executed during this read-only review. (src/infra/update-runner-git-admission.test.ts:142, 1cbaabec4971)
  • Documented first-update limitation: The PR body and documentation explicitly identify this as an installed-updater repair: an older updater cannot acquire the fix from its candidate before inspection, so an affected checkout needs its missing objects fetched before retrying. This is a disclosed existing limitation, not a newly introduced upgrade restriction. Public docs: docs/cli/update/how-updates-run.md. (docs/cli/update/how-updates-run.md:621, 1cbaabec4971)
  • Supplied validation and proof scope: The complete captured body reports an AWS reproduction, a before/after real-Git fixture reaching admission without installed-tree changes, 33 admission tests passing in 95.21 seconds wall, and 12 transfer tests passing in 48.43 seconds wall. These are contributor-reported results, not reviewer execution. The supplied Repository State identifies a MEMBER author and the maintainer label; the external-contributor proof gate is therefore not applied. (1cbaabec4971)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Jason (Json): Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

@steipete
steipete merged commit dd5a7a8 into main Sep 21, 2026
282 checks passed
@steipete
steipete deleted the codex/fix-shallow-partial-update branch September 21, 2026 01:12
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant