Skip to content

fix(repair): harden rebase conflict retries - #332

Merged
steipete merged 1 commit into
mainfrom
fix/rebase-conflict-repair-mode-maintainer
Jun 19, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/rebase-conflict-repair-mode-maintainer

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

  • keep unresolved rebase conflicts inside the bounded Codex edit loop after successful edit passes
  • preserve transport, terminal, and ordinary worker failure classification
  • report exhausted and sequential rebase conflicts as human-required with exact paths
  • update automatic issue implementation status comments for the new terminal outcome
  • include conflicted paths and conflict-first guidance in repair prompts

Replaces #308 because the contributor fork rejected maintainer pushes. Preserves contributor credit.

Verification

  • pnpm run check
  • 526 unit tests passed
  • 560 repair tests passed
  • 1,086 full coverage tests passed
  • Codex autoreview clean after seven review/fix rounds

@clawsweeper

clawsweeper Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 19, 2026, 3:34 AM ET / 07:34 UTC.

Summary
The PR updates repair execution to retry unresolved rebase conflicts inside the Codex edit loop, report exhausted conflicts as needs_human, include conflicted paths in repair prompts/status handling, and adds focused tests plus a changelog entry.

Reproducibility: yes. from source inspection: current main can treat unresolved conflicted rebase paths as working-tree changes and leave the edit retry loop before completeRebaseIfResolved() reports the exact paths. I did not run a live conflicted worker reproduction.

Review metrics: 2 noteworthy metrics.

  • Patch surface: 9 files changed, +242/-54. The PR is focused on repair execution, prompt text, outcome reporting, and tests, but it touches live automation control flow.
  • Release-owned file touched: 1 file: CHANGELOG.md. Repository policy says normal PR work should keep this release-note context in PR bodies or commit history instead.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🦐 gold shrimp
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Remove the CHANGELOG.md entry and keep release-note context in the PR body or commit history.
  • [P1] Add redacted terminal output, worker logs, or a linked artifact from a real conflicted repair run showing retry or exact needs_human paths.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body lists checks and test counts, but it does not include redacted terminal output, worker logs, a linked artifact, or a recording from a real conflicted repair run after the fix. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] The PR changes repair-worker retry and terminal-status behavior for conflicted rebases, and source/tests do not prove the live worker path retries or reports exact paths as intended.
  • [P1] The CHANGELOG.md hunk puts normal PR release-note context into a release-owned file that repository policy says should be handled by release owners.
  • [P1] The open prompt-only sibling at Clarify rebase conflict repair prompts #321 should be reconciled after maintainers choose the canonical landing path.

Maintainer options:

  1. Require proof and policy cleanup (recommended)
    Ask for the release-owned changelog hunk to be removed and for redacted real worker output showing conflicted rebase retry or exact needs_human paths before merge.
  2. Accept source/test evidence only
    Maintainers could merge after removing the changelog hunk using source and unit-test evidence, but they would own the risk that the live repair-worker path behaves differently.

Next step before merge

  • [P1] Human handling is needed because the PR needs contributor or maintainer real conflicted-run proof and a release-owned changelog cleanup; automation cannot provide the missing external proof.

Security
Cleared: No concrete security or supply-chain concern was found; the diff changes repair TypeScript control flow, prompt text, tests, and a changelog entry without dependency, workflow, permission, or secret-handling changes.

Review findings

  • [P2] Remove the release-owned changelog entry — CHANGELOG.md:16
Review details

Best possible solution:

Remove the changelog hunk, keep release-note context in the PR body/commit history, and land the narrow conflict-loop hardening after redacted real repair-worker proof shows conflicted rebase retry or needs_human behavior.

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

Yes from source inspection: current main can treat unresolved conflicted rebase paths as working-tree changes and leave the edit retry loop before completeRebaseIfResolved() reports the exact paths. I did not run a live conflicted worker reproduction.

Is this the best way to solve the issue?

Yes in direction, but not merge-ready as submitted: keeping unresolved conflicts inside the bounded edit loop is the narrow repair, while the changelog hunk should be removed and real worker proof should be added.

Full review comments:

  • [P2] Remove the release-owned changelog entry — CHANGELOG.md:16
    AGENTS.md says OpenClaw CHANGELOG.md is release-owned and normal PR work should preserve release-note context in the PR body or commit history instead. This PR already does that in its body and co-authored commit, so please drop this changelog line and leave release notes to the release process.
    Confidence: 0.95

Overall correctness: patch is incorrect
Overall confidence: 0.87

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 25a378a5b7d9.

Label changes

Label changes:

  • add P2: This is a normal-priority repair automation reliability fix with limited blast radius but real merge-readiness blockers.
  • add merge-risk: 🚨 automation: The diff changes repair-worker retry, terminal outcome, and status reporting behavior that CI alone does not prove in a live conflicted repair run.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body lists checks and test counts, but it does not include redacted terminal output, worker logs, a linked artifact, or a recording from a real conflicted repair run after the fix. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a normal-priority repair automation reliability fix with limited blast radius but real merge-readiness blockers.
  • merge-risk: 🚨 automation: The diff changes repair-worker retry, terminal outcome, and status reporting behavior that CI alone does not prove in a live conflicted repair run.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body lists checks and test counts, but it does not include redacted terminal output, worker logs, a linked artifact, or a recording from a real conflicted repair run after the fix. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

What I checked:

  • Repository policy applied: AGENTS.md says ClawSweeper changes should stay narrow and automation-safe, and that OpenClaw CHANGELOG.md is release-owned for normal PR work. (AGENTS.md:41, 25a378a5b7d9)
  • Release-owned file changed: The PR adds a release-note entry to CHANGELOG.md, even though the PR body and commit already preserve the user-facing context and contributor credit. (CHANGELOG.md:16, d59bdb12252e)
  • Current-main failure mode: Current main treats any git status --porcelain output as produced changes before calling completeRebaseIfResolved(), so unresolved conflict entries can leave the edit loop before focused retry guidance is used. (src/repair/execute-fix-artifact.ts:2093, 25a378a5b7d9)
  • PR implementation path: The PR checks remaining unmerged paths after a successful Codex edit pass and retries or blocks before ordinary working-tree change handling. (src/repair/execute-fix-artifact.ts:2056, d59bdb12252e)
  • Prompt plumbing included: The PR passes live unmergedPaths(targetDir) into conflicted rebase prompt input, addressing the missing production plumbing noted on the prompt-only sibling PR. (src/repair/execute-fix-artifact.ts:1998, d59bdb12252e)
  • Related replacement PR: Harden repair execution for rebase conflicts #308 is closed unmerged; the current PR body says it replaces that branch because the contributor fork rejected maintainer pushes while preserving contributor credit.

Likely related people:

  • steipete: Blame and path history tie the current repair edit loop, rebase completion helpers, prompt builder, and recent changelog guard work to this author; he is included for current-main ownership, not merely for opening this PR. (role: feature owner and recent area contributor; confidence: high; commits: dc824915bb6c, e0d595ca3b5e, f84e575ec6e1; files: src/repair/execute-fix-artifact.ts, src/repair/fix-prompt-builder.ts, src/repair/git-repo-utils.ts)
  • Jhacarreiro: Authored the closed predecessor PR and is co-credited on the current commit, so this person is relevant context for the replacement and contributor-credit path even though current-main ownership points primarily elsewhere. (role: related replacement contributor; confidence: medium; commits: 3064d1b7ee62, d59bdb12252e; files: src/repair/execute-fix-artifact.ts, src/repair/fix-prompt-builder.ts, src/repair/fix-prompt-builder.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d59bdb1225

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +2056 to +2057
const remainingConflicts =
rebaseResult?.status === "conflicts" ? unmergedPaths(targetDir) : [];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Retry conflicts from Codex-owned rebases

When automerge/self-heal repairs defer the initial rebase to Codex, executeRepairBranch calls this loop with rebaseResult = null, so a successful Codex pass that starts a rebase and leaves unmerged files gets remainingConflicts = [] here. The loop then skips the new retry path, treats the conflicted index as produced changes, and only fails later in completeRebaseIfResolved, turning the job into needs_human after one pass instead of using the bounded edit retries. Check the active checkout for unmergedPaths(targetDir) even when the deterministic pre-edit rebase did not produce rebaseResult.status === "conflicts".

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. labels Jun 19, 2026
@steipete
steipete merged commit 39239e7 into main Jun 19, 2026
12 checks passed
@steipete
steipete deleted the fix/rebase-conflict-repair-mode-maintainer branch June 19, 2026 07:35
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant