Skip to content

fix(update): avoid downloading unrelated Git branches - #172199

Merged
steipete merged 1 commit into
mainfrom
codex/update-selected-source-fetch
Oct 14, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/update-selected-source-fetch

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Dev-channel source updates could download unrelated branches while inspecting the selected upstream, exhausting disk before candidate admission.

User Impact

Updates fetch the selected upstream without downloading unrelated branch objects. Git configuration and existing shallow boundaries are preserved. Excluded or invalid sources report a fetch failure before stopping the running Gateway, instead of appearing current from stale tracking data.

Why This Change Was Made

The updater already resolved the source remote and merge ref but discarded the merge ref when fetching. Pass it through the existing private inspection owner, retain configured negative refspecs and Git's destination/force mappings, and require a fetched commit before publishing freshness. The argument separator keeps configured refs from being interpreted as fetch options. Release-tag inventory and detached-target discovery retain their existing contracts; build, Doctor and activation ownership are unchanged.

Evidence

A real Git remote reproduced the excess download: 8,393,189 object bytes including an unrelated branch versus 1,749 bytes for the same selected upstream. Production-path regressions failed before the repair for full and shallow checkouts, excluded cached main, and an option-shaped source that accidentally fetched every branch.

The touched native Git execution suite passed 47 cases; the release-tag suite passed nine. Final focused replay passed 13 cases, including full/shallow source selection, excluded main, invalid literal source, and custom HEAD, empty, abbreviated and wildcard tracking mappings. Core and test typechecks, scoped lint, formatting, diff checks and fresh P2 review passed. Broad exact-head proof is delegated to PR CI.

Local Vitest durations were 326 seconds for the existing 47-case execution file, 55 seconds for release tags, and 81 seconds for final focused replay on a busy host. These cases exercise real Git inspection, candidate admission and runtime preservation; no arbitrary waits or production test seams were added. CI duration is pending.

Production delta is +14 lines in the existing fetch owner; tests +91 and docs +2. The growth expresses the selected-source, exclusion and freshness contract without adding a separate updater, configuration or storage surface.

@clawsweeper

clawsweeper Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review October 14, 2026 14:16
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T14:20:49.604093Z 465650e Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S labels Oct 14, 2026
@steipete
steipete merged commit 24567af into main Oct 14, 2026
187 of 189 checks passed
@steipete
steipete deleted the codex/update-selected-source-fetch branch October 14, 2026 15:06
@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 size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant