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
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"session_id": "<session_id>",
"expected_main_head": "<expected_main_head>"
},
"name": "codemerge_merge"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | ||
| expected_main_head | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||