Skip to content

Bug: fork prep sync serializes unrelated mainline files #108016

Description

@steipete

Bug type

Behavior bug (incorrect output/state without crash)

Summary

scripts/pr prepare-sync-head rebases a fork-backed prepared branch onto moving main, then createCommitOnBranch serializes every resulting mainline tree difference as a fork update.

Steps to reproduce

  1. Prepare a contributor fork PR and add reviewed maintainer fixups locally.
  2. Let main advance after the contributor branch point.
  3. Run scripts/pr prepare-sync-head <PR> with the default GraphQL push mode.
  4. Observe the tool encode unrelated mainline files before calling GitHub.

Expected behavior

Fork synchronization publishes only fixup commits appended to the hosted PR head. Mainline freshness remains the responsibility of merge verification and GitHub conflict detection.

Actual behavior

The reproduced PR attempted to encode 12,557 files because the local prep branch had first been rebased onto main while the hosted fork head retained its original ancestry.

OpenClaw version

main at c508e4a2b85d511e7f509cb23094522e28566d3e

Operating system

macOS

Install method

Source checkout

Model

Not applicable

Provider / routing chain

Not applicable

Impact and severity

Maintainer fork-PR landing stalls and creates oversized GraphQL payloads whenever prepared branches are rebased after main advances. The failure is deterministic for affected branches and blocks landing until the prep history is reconstructed.

Additional information

The merge drift guard is already advisory by default. The remaining eager rebase in prepare-sync-head is inconsistent with that policy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintainerMaintainer-authored PR

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions