diff options
Diffstat (limited to 'internal/executor/channel.go')
| -rw-r--r-- | internal/executor/channel.go | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/internal/executor/channel.go b/internal/executor/channel.go index debe21d..30d826c 100644 --- a/internal/executor/channel.go +++ b/internal/executor/channel.go @@ -112,20 +112,30 @@ func (c *storeChannel) PendingQuestion() (string, bool) { func (c *storeChannel) SpawnSubtask(_ context.Context, spec SubtaskSpec) (string, error) { now := time.Now().UTC() + agent := task.AgentConfig{ + Instructions: spec.Instructions, + MaxBudgetUSD: spec.MaxBudgetUSD, + } + if spec.Role != "" { + // Role-typed subtask: leave Type/Model empty so + // executor.Pool.execute() resolves tier 0 of the role's escalation + // ladder on dispatch, exactly like any other role-typed task. + agent.Role = spec.Role + } else { + // Backward-compatible default: every pre-Phase-6 caller of + // SpawnSubtask gets exactly this unchanged behavior. + agent.Type = "claude" + agent.Model = spec.Model + } child := &task.Task{ ID: uuid.NewString(), Name: spec.Name, ParentTaskID: c.taskID, - Agent: task.AgentConfig{ - Type: "claude", - Model: spec.Model, - Instructions: spec.Instructions, - MaxBudgetUSD: spec.MaxBudgetUSD, - }, - Priority: task.PriorityNormal, - State: task.StatePending, - CreatedAt: now, - UpdatedAt: now, + Agent: agent, + Priority: task.PriorityNormal, + State: task.StatePending, + CreatedAt: now, + UpdatedAt: now, } if err := c.store.CreateTask(child); err != nil { return "", err |
