Skip to content

resolve-merge-conflicts skill fetches from stale local origin instead of upstream remote #487

@Trecek

Description

@Trecek

Bug Report

Category: Skill / clone architecture
Severity: blocking
AutoSkillit version: 0.5.2

Summary

The `/autoskillit:resolve-merge-conflicts` skill always reports "clean rebase — no conflicts" even when the PR has actual merge conflicts on GitHub. The root cause is that `clone.py` sets `origin` to `file://{clone_path}` (self-referential local URL) and `upstream` to the real GitHub URL. The skill fetches from `origin` (stale local) instead of `upstream` (GitHub), so it never sees commits that merged into the base branch after the clone was created.

Reproduction

  1. Run a parallel remediation pipeline producing multiple PRs targeting `integration`
  2. PR A and PR B merge into integration via merge queue
  3. PR C (which was cloned before A/B merged) enters the merge queue and gets ejected due to conflicts
  4. `resolve-merge-conflicts` runs `git fetch origin integration` → fetches from `file://{clone_path}` → sees stale integration state → rebase reports "up to date"
  5. Push + re-enter queue → ejected again. Loop indefinitely.

Evidence

PR #484 (`adjudicated-failure-false-positive-make-plan-session-killed/477` → `integration`) was ejected 3 times. `resolve-merge-conflicts` ran 3 times, each reporting clean rebase:

Attempt Session ID Result
1 `02fbde2a-bcff-48e2-a508-83fd8d0e9f0f` "Clean rebase, no conflicts"
2 `c7d4cdb7-6017-4fd4-bc65-d25d79eae1b0` "Clean rebase, no conflicts"
3 `b3763017-f2b0-4397-998c-8ddf0134f7bb` "Clean rebase, no conflicts"

Diagnostic logs: `~/.local/share/autoskillit/logs/` (search by session IDs above)

Root Cause

In `src/autoskillit/workspace/clone.py` (lines 334-348), after cloning:

  • `origin` is set to `file://{clone_path}` (self-referential local URL)
  • `upstream` gets the real GitHub URL

The `resolve-merge-conflicts` skill runs `git fetch origin {base_branch}` and rebases against `origin/{base_branch}`. Since `origin` points to the local clone (which was created before other PRs merged), `origin/integration` is permanently stale. The rebase always succeeds because it's rebasing against the old state.

Fix

The skill should fetch from `upstream` instead of `origin`, or the orchestrator should pass the `remote_url` (captured at clone time) so the skill can fetch the correct remote. Alternatively, `push_to_remote` could update `origin` to the real URL after pushing.

Impact

Any parallel pipeline where earlier PRs merge into the base branch before a later PR enters the merge queue will loop indefinitely: eject → "clean rebase" → push → re-enter → eject. The pipeline stalls permanently with no error signal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugExisting behavior is brokenrecipe:remediationRoute: investigate/decompose before implementationstagedImplementation staged and waiting for promotion to main

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions