Hold a task's merge while another task in the project is merging

This commit is contained in:
Ian Gulliver
2026-10-15 12:11:35 -07:00
parent ff22f33025
commit 606cf4b5c0
16 changed files with 546 additions and 190 deletions
+5 -1
View File
@@ -262,6 +262,7 @@ func (m *Manager) leadTools(l *live) []mcp.Tool {
tool("merge_task",
"Merge a task as the human: its agent merges the default branch in, then byre squashes it into one commit, pushes it to origin and closes the task. "+
"While another task in the project is merging, byre holds the merge and starts it when that one is done. "+
"Only when the human asks. You get a signal when it is merged; failures are filed in the task's inbox.",
taskOnly,
func(ctx context.Context, user api.User, raw json.RawMessage) (string, error) {
@@ -269,10 +270,13 @@ func (m *Manager) leadTools(l *live) []mcp.Tool {
if err != nil {
return "", err
}
_, err = m.Merge(ctx, task, project, user)
task, err = m.Merge(ctx, task, project, user)
if err != nil {
return "", err
}
if task.MergeQueuedAt != nil {
return fmt.Sprintf("Merge of %s held until the merge in progress in its project is done.", task.Id), nil
}
return fmt.Sprintf("Merge of %s started.", task.Id), nil
}),