Give each workflow run a parent task with no agent
This commit is contained in:
@@ -69,7 +69,7 @@ func (m *Manager) subtaskTools(l *live) []mcp.Tool {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
task, err := m.createTask(ctx, project, api.Task{Title: args.Title, CreatedBy: creator.Login, ParentTaskId: &l.taskID}, nil, base, creator.Login)
|
||||
task, err := m.createTask(ctx, project, api.Task{Title: args.Title, CreatedBy: creator.Login, ParentTaskId: &l.taskID}, base, creator.Login)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -302,7 +302,7 @@ func (m *Manager) messageTask(ctx context.Context, task api.Task, user api.User,
|
||||
}
|
||||
|
||||
func (m *Manager) MergeIntoParent(ctx context.Context, task api.Task, user api.User) (api.Task, error) {
|
||||
if task.ParentTaskId == nil {
|
||||
if task.ParentTaskId == nil || task.WorkflowStage != nil {
|
||||
return api.Task{}, fmt.Errorf("%w: task %s is not a subtask", ErrInvalid, task.Id)
|
||||
}
|
||||
err := m.checkNoSubtasks(ctx, task)
|
||||
@@ -411,7 +411,7 @@ func (m *Manager) reportToParent(taskID, result string) {
|
||||
slog.Error("load subtask to report", "task", taskID, "err", err)
|
||||
return
|
||||
}
|
||||
if task.ParentTaskId == nil || task.MergingIntoParent {
|
||||
if task.ParentTaskId == nil || task.WorkflowStage != nil || task.MergingIntoParent {
|
||||
return
|
||||
}
|
||||
parent, err := m.store.GetTask(ctx, *task.ParentTaskId)
|
||||
|
||||
Reference in New Issue
Block a user