diff options
Diffstat (limited to 'internal/executor/agentmcp_test.go')
| -rw-r--r-- | internal/executor/agentmcp_test.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/internal/executor/agentmcp_test.go b/internal/executor/agentmcp_test.go index 3973af0..4aeb7cb 100644 --- a/internal/executor/agentmcp_test.go +++ b/internal/executor/agentmcp_test.go @@ -145,6 +145,25 @@ func TestAgentServer_SpawnSubtask(t *testing.T) { } } +// TestAgentServer_SpawnSubtask_RolePassthrough proves the MCP transport +// (ContainerRunner-driven claude/gemini agents) can spawn role-typed +// subtasks too, mirroring the native tool-use loop's coverage in +// nativerunner_test.go. +func TestAgentServer_SpawnSubtask_RolePassthrough(t *testing.T) { + ch := &recordingChannel{spawnID: "sub-2"} + cs := connectInMemory(t, newAgentServer(ch)) + _, err := cs.CallTool(context.Background(), &mcp.CallToolParams{ + Name: "spawn_subtask", + Arguments: map[string]any{"name": "eval", "instructions": "evaluate", "role": "evaluator_quality"}, + }) + if err != nil { + t.Fatalf("CallTool: %v", err) + } + if len(ch.spawned) != 1 || ch.spawned[0].Role != "evaluator_quality" { + t.Errorf("subtask role not propagated: %+v", ch.spawned) + } +} + func TestAgentServer_RecordProgress(t *testing.T) { ch := &recordingChannel{} cs := connectInMemory(t, newAgentServer(ch)) |
