Skip to content

Merge-conflict guidance asks the agent to re-apply the discarded value but never names pm merge report, the only place it exists #889

Closed

Description

@unbraind

Summary

When the field-aware item merge driver hits a genuine same-field conflict, the guidance it
prints tells the agent to "re-apply the losing change if needed" — but it never names the one
command that actually holds the losing value: pm merge report.

An agent that follows the guidance verbatim has the discarded value nowhere in its context. The
conflicted .toon on disk contains only the retained (ours) side, so re-applying the losing
change from the working tree is impossible. The information exists — it is just unreachable from
the message that asks you to use it.

Reproducer (pm-cli 2026.8.3)

git init -q repo && cd repo && git config user.email a@b.c && git config user.name t
pm init && pm merge install
I=$(pm create --title "Contended item" --type Feature --priority 3 --json | jq -r .id)
git add -A && git commit -qm baseline

git checkout -qb agent-a
pm update "$I" --priority 0 --title "as agent A renamed it" --author agent-a
git add -A && git commit -qm a

git checkout -q master && git checkout -qb agent-b
pm update "$I" --priority 1 --title "as agent B renamed it" --author agent-b
git add -A && git commit -qm b

git merge agent-a -m "merge a into b"

Observed guidance:

guidance:
  - "Both branches changed priority, title; the ours value was kept. Review the merged file,
     re-apply the losing change if needed, then \"git add\" it."

The discarded values are only obtainable from a command the guidance never mentions:

$ pm merge report
    decisions:
      - field: "priority"
        base: 3
        ours: 1
        theirs: 0
        retained: 1
        discarded: 0
      - field: "title"
        ...
        discarded: "Contended item, as agent A renamed it"

Why this matters for agents

This is the multi-agent merge path — the case the driver exists for. Two agents on two branches
contend on a field, and the resolving agent is told to recover a value it cannot see. It will
either drop the losing change silently or go spelunking through git show agent-a:<path>,
which defeats the purpose of having a structured receipt.

Suggested fix

Append the recovery command to the guidance string, e.g.:

Both branches changed priority, title; the ours value was kept. Run pm merge report to see
each discarded value, re-apply what you need, then git add the file.

Optionally include the receipt id in the guidance so pm merge report output can be correlated
when several items conflict in one merge.

The rest of the surface is good — pm merge report returns exactly the right structure
(base/ours/theirs/retained/discarded per field, plus union_fields), and notes/history
union-merge losslessly through the conflict. Only the pointer is missing.

Activity

  1. coderabbitai commented on Aug 4, 2026

    @coderabbitai
    🔗 Related PRs

    #200 - Add validation self-repair and agent ergonomics primitives [closed]
    #593 - SDK-first agent UX graph, ownership, and recovery contracts [merged]
    #614 - SDK-first field-aware merge safety and storage integrity [merged]
    #758 - Make branch merge decisions recoverable, replayable, and CI-enforced [merged]
    #783 - Harden SDK context integrity, merge safety, and agent-efficient output [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. unbraind commented on Aug 4, 2026

    @unbraind
    OwnerAuthor

    Tracked in pm-fbrz7p.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions