From 3eb50175564ecc7e0b0b250ce8b43dec7edec003 Mon Sep 17 00:00:00 2001 From: Claudomator Agent Date: Wed, 8 Jul 2026 08:55:38 +0000 Subject: feat(agentloop,executor): expose depends_on on the spawn_subtask tool --- internal/agentloop/tools.go | 13 ++++++++----- internal/executor/agentmcp.go | 12 +++++++----- 2 files changed, 15 insertions(+), 10 deletions(-) (limited to 'internal') diff --git a/internal/agentloop/tools.go b/internal/agentloop/tools.go index ad1aecf..32dd284 100644 --- a/internal/agentloop/tools.go +++ b/internal/agentloop/tools.go @@ -56,6 +56,7 @@ func agentToolSpecs() []provider.ToolSpec { "model": strProp("optional model override"), "max_budget_usd": map[string]any{"type": "number", "description": "optional budget cap in USD"}, "role": strProp("optional role name to dispatch the subtask through instead of a fixed model (e.g. an evaluator role); when set, model is ignored and the role's escalation ladder picks the provider/model"), + "depends_on": map[string]any{"type": "array", "items": map[string]any{"type": "string"}, "description": "optional list of sibling subtask IDs (returned by prior spawn_subtask calls in this same decomposition) this subtask must wait for before it can run"}, }, "required": []string{"name", "instructions"}, }, @@ -205,11 +206,12 @@ func (l *Loop) dispatchTool(ctx context.Context, name, argsJSON string) (result case "spawn_subtask": var a struct { - Name string `json:"name"` - Instructions string `json:"instructions"` - Model string `json:"model"` - MaxBudgetUSD float64 `json:"max_budget_usd"` - Role string `json:"role"` + Name string `json:"name"` + Instructions string `json:"instructions"` + Model string `json:"model"` + MaxBudgetUSD float64 `json:"max_budget_usd"` + Role string `json:"role"` + DependsOn []string `json:"depends_on"` } _ = json.Unmarshal([]byte(argsJSON), &a) id, ssErr := l.Channel.SpawnSubtask(ctx, agentchannel.SubtaskSpec{ @@ -218,6 +220,7 @@ func (l *Loop) dispatchTool(ctx context.Context, name, argsJSON string) (result Model: a.Model, MaxBudgetUSD: a.MaxBudgetUSD, Role: a.Role, + DependsOn: a.DependsOn, }) if ssErr != nil { return "", false, ssErr diff --git a/internal/executor/agentmcp.go b/internal/executor/agentmcp.go index a89c670..0b36c14 100644 --- a/internal/executor/agentmcp.go +++ b/internal/executor/agentmcp.go @@ -64,11 +64,12 @@ type reportSummaryInput struct { } type spawnSubtaskInput struct { - Name string `json:"name" jsonschema:"short descriptive name for the subtask"` - Instructions string `json:"instructions" jsonschema:"complete instructions for the subtask agent"` - Model string `json:"model,omitempty" jsonschema:"optional model override, e.g. sonnet or opus"` - MaxBudgetUSD float64 `json:"max_budget_usd,omitempty" jsonschema:"optional budget cap in USD"` - Role string `json:"role,omitempty" jsonschema:"optional role name to dispatch the subtask through instead of a fixed model (e.g. an evaluator role); when set, model is ignored and the role's escalation ladder picks the provider/model"` + Name string `json:"name" jsonschema:"short descriptive name for the subtask"` + Instructions string `json:"instructions" jsonschema:"complete instructions for the subtask agent"` + Model string `json:"model,omitempty" jsonschema:"optional model override, e.g. sonnet or opus"` + MaxBudgetUSD float64 `json:"max_budget_usd,omitempty" jsonschema:"optional budget cap in USD"` + Role string `json:"role,omitempty" jsonschema:"optional role name to dispatch the subtask through instead of a fixed model (e.g. an evaluator role); when set, model is ignored and the role's escalation ladder picks the provider/model"` + DependsOn []string `json:"depends_on,omitempty" jsonschema:"optional list of sibling subtask IDs (returned by prior spawn_subtask calls in this same decomposition) this subtask must wait for before it can run"` } type recordProgressInput struct { @@ -152,6 +153,7 @@ func newAgentServer(ch AgentChannel) *mcp.Server { Model: in.Model, MaxBudgetUSD: in.MaxBudgetUSD, Role: in.Role, + DependsOn: in.DependsOn, }) if err != nil { return nil, nil, err -- cgit v1.2.3