MCPcopy Create free account
hub / github.com/astercloud/aster / TestTaskTool_Metadata

Function TestTaskTool_Metadata

pkg/tools/builtin/task_test.go:324–359  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

322}
323
324func TestTaskTool_Metadata(t *testing.T) {
325 t.Skip("Skipping: TaskTool doesn't include metadata field in response")
326 tool, err := NewTaskTool(nil)
327 if err != nil {
328 t.Fatalf("Failed to create Task tool: %v", err)
329 }
330
331 input := map[string]any{
332 "subagent_type": "general-purpose",
333 "prompt": "Task with metadata",
334 "model": "gpt-3.5-turbo",
335 }
336
337 result := ExecuteToolWithInput(t, tool, input)
338 result = AssertToolSuccess(t, result)
339
340 // 验证subagent配置信息
341 if subagentConfig, exists := result["subagent_config"]; !exists {
342 t.Error("Result should contain 'subagent_config' field")
343 } else if configMap, ok := subagentConfig.(map[string]any); !ok {
344 t.Error("subagent_config should be a map")
345 } else {
346 // 验证配置字段
347 expectedFields := []string{"timeout", "max_tokens", "temperature", "work_dir"}
348 for _, field := range expectedFields {
349 if _, exists := configMap[field]; !exists {
350 t.Logf("Subagent config field '%s' not found (may be optional)", field)
351 }
352 }
353 }
354
355 // 验证元数据
356 if _, exists := result["metadata"]; !exists {
357 t.Error("Result should contain 'metadata' field")
358 }
359}
360
361func BenchmarkTaskTool_LaunchSubagent(b *testing.B) {
362 tool, err := NewTaskTool(nil)

Callers

nothing calls this directly

Calls 4

NewTaskToolFunction · 0.85
ExecuteToolWithInputFunction · 0.85
AssertToolSuccessFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected