Skip to content

fix(autocoder): resolve merge conflicts before escalating, not on first failure - #135

Open
laird wants to merge 1 commit into
masterfrom
fix/merge-to-integration-premature-escalation
Open

fix(autocoder): resolve merge conflicts before escalating, not on first failure#135
laird wants to merge 1 commit into
masterfrom
fix/merge-to-integration-premature-escalation

Conversation

@laird

@laird laird commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Problem

merge-to-integration.sh aborted the merge and escalated (removed working,
added needs-clarification, posted a hard-escalation comment) on the first
merge conflict, before the /fix worker that had just written the fix — and
was sharing the exact same checkout — ever got a chance to look at it.

Reported as ey-org/athena2#1766, with two concrete instances 15 minutes apart
in one session where the worker read the failure and resolved the conflict by
hand anyway (mechanical conflicts it had full context for), after the label
had already flipped to needs-clarification.

Why it matters: needs-clarification is in the blocking set, so between the
premature escalation and the worker's own recovery the issue is invisible to
the claimable queue. If the worker's loop ends before it finishes (context
exhaustion, restart, gate failure), the issue is stranded wearing a
human-blocked label while a complete fix sits unmerged on its branch — and the
label is not self-clearing.

Fix

  • merge-to-integration.sh: on conflict, leave it ON DISK (no
    git merge --abort), don't touch labels, post an advisory-only comment, and
    exit 3 — a code distinct from 1 (push failure) and 2 (test failure).
  • merge-poll.sh: documents the new exit code 3 (already passed through
    generically, no behavior change needed there).
  • commands/fix.md: at all 3 merge sites, exit 3 now triggers a direct
    self-resolve attempt (the worker resolves the conflict using the context it
    has, completes the merge commit, and re-launches). Only if that second
    attempt also fails does it escalate to needs-clarification — via the
    same explicit-release-comment-then-label convention already used elsewhere
    in the file (fixes a tests/test_fix_working_lock.py invariant that a
    working-lock release must have an adjacent terminal-outcome marker).
  • Bumps the autocoder plugin to 4.21.0 across every manifest copy
    (tests/test_manifest_versions.sh enforces they all agree).
  • Adds tests/test_merge_conflict_advisory.sh: a real git-fixture test that
    drives an actual merge conflict through merge-to-integration.sh and
    asserts exit 3, the conflict left unresolved on disk, no label-changing
    issue_update call, and an advisory (not hard-escalation) comment body.

Test plan

  • tests/run-shell-suite.sh — 27/27 passed (includes the new test and the
    existing test_merge_launch_poll.sh, which still passes with the extra
    launch/poll call sites at each merge site)
  • pytest tests/ — 116/116 passed (including
    test_fix_working_lock.py, which specifically checks every
    --remove-label "working" site has an adjacent terminal marker, and
    test_gate_md_bash.py, which checks fix.md's bash blocks parse)
  • tests/test_manifest_versions.sh — all manifests agree on 4.21.0

…st failure

merge-to-integration.sh used to abort+escalate (remove 'working', add
needs-clarification, post a hard-escalation comment) on the FIRST merge
conflict, before the /fix worker that just wrote the fix — sharing this
same checkout — ever got a chance to resolve it directly.

Conflicts are now left ON DISK (not aborted) and the script exits 3, a
code distinct from 1 (push failure) and 2 (test failure). No label
change happens at that point; only an advisory comment is posted. The
caller (fix.md, at all 3 merge sites) resolves the conflict directly
using the context it has from having just written the change, re-runs
the merge, and only escalates to needs-clarification — with a proper
explicit-release comment — if that attempt also fails.

Reported as ey-org/athena2#1766, observed twice in one session where a
worker resolved a conflict the script had already escalated.

Bumps the autocoder plugin to 4.21.0 across all manifest copies and
adds tests/test_merge_conflict_advisory.sh pinning the new behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant