codemerge_merge
Acquire a merge lock and verify the main HEAD to merge code without race conditions. Returns proceed=False when main moved or another session holds the lock.
Instructions
Acquire the merge lock and proceed with merging.
Uses compare-and-swap on main HEAD to prevent races. If main has moved since check, returns proceed=False with reason='main_moved'. If another session holds the lock, returns proceed=False with reason='lock_held'.
Args:
session_id: The merge session ID
expected_main_head: The main HEAD SHA recorded during codemerge_check
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | ||
| expected_main_head | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||