Let task agents create and manage subtasks

This commit is contained in:
Ian Gulliver
2026-10-16 10:36:38 -07:00
parent fd63a0dfbc
commit 0f2415570c
30 changed files with 1067 additions and 287 deletions
+6
View File
@@ -455,6 +455,9 @@ func (m *Manager) signalText(ctx context.Context, ev api.Event) (string, error)
if task.ForkedFrom != nil {
return fmt.Sprintf("%s was forked by %s from %s at snapshot %d.", m.taskLabel(ctx, task.Id), ev.Actor, m.taskLabel(ctx, *task.ForkedFrom), *task.ForkedAt), nil
}
if task.ParentTaskId != nil {
return fmt.Sprintf("%s was created as a subtask of %s by its agent.", m.taskLabel(ctx, task.Id), m.taskLabel(ctx, *task.ParentTaskId)), nil
}
if task.TodoItem == nil {
return fmt.Sprintf("%s was created by %s.", m.taskLabel(ctx, task.Id), ev.Actor), nil
}
@@ -468,6 +471,9 @@ func (m *Manager) signalText(ctx context.Context, ev api.Event) (string, error)
if commit == "" {
return fmt.Sprintf("%s was merged by %s with nothing to commit.", m.taskLabel(ctx, deref(ev.TaskId)), ev.Actor), nil
}
if into, ok := ev.Payload["parent_task_id"].(string); ok {
return fmt.Sprintf("%s was merged by %s into %s, now at %s.", m.taskLabel(ctx, deref(ev.TaskId)), ev.Actor, m.taskLabel(ctx, into), short(commit)), nil
}
return fmt.Sprintf("%s was merged by %s as %s and pushed to %v.", m.taskLabel(ctx, deref(ev.TaskId)), ev.Actor, short(commit), ev.Payload["pushed"]), nil
case "task.discarded":