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

Function getTool

pkg/middleware/subagent_async_test.go:12–24  ·  view source on GitHub ↗
(t *testing.T, mw *SubAgentMiddleware, name string)

Source from the content-addressed store, hash-verified

10)
11
12func getTool[T any](t *testing.T, mw *SubAgentMiddleware, name string) T {
13 t.Helper()
14 var zero T
15 for _, tool := range mw.Tools() {
16 if tool.Name() == name {
17 typed, ok := tool.(T)
18 require.True(t, ok, "tool %s has unexpected type", name)
19 return typed
20 }
21 }
22 t.Fatalf("tool %s not found", name)
23 return zero
24}
25
26// TestSubAgentMiddleware_AsyncExecution 测试异步执行
27func TestSubAgentMiddleware_AsyncExecution(t *testing.T) {

Callers

nothing calls this directly

Calls 2

ToolsMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected