MCPcopy Create free account
hub / github.com/compozy/agh / TestDaemonNativeTools

Function TestDaemonNativeTools

internal/daemon/native_tools_test.go:89–5265  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

87}
88
89func TestDaemonNativeTools(t *testing.T) {
90 t.Parallel()
91
92 t.Run("Should dispatch skill catalog tools through the real skill registry", func(t *testing.T) {
93 t.Parallel()
94
95 registry := newDaemonNativeRegistry(t, &daemonNativeToolsDeps{
96 Skills: newLoadedNativeSkillRegistry(t),
97 }, nativeApproveAllPolicyInputs())
98
99 listResult, err := registry.Call(
100 t.Context(),
101 toolspkg.Scope{},
102 toolspkg.CallRequest{ToolID: toolspkg.ToolIDSkillList},
103 )
104 if err != nil {
105 t.Fatalf("Registry.Call(skill_list) error = %v", err)
106 }
107 requireNativeStructuredContains(t, listResult, []byte(`"agh"`))
108
109 searchResult, err := registry.Call(
110 t.Context(),
111 toolspkg.Scope{},
112 toolspkg.CallRequest{
113 ToolID: toolspkg.ToolIDSkillSearch,
114 Input: json.RawMessage(`{"query":"network"}`),
115 },
116 )
117 if err != nil {
118 t.Fatalf("Registry.Call(skill_search) error = %v", err)
119 }
120 requireNativeStructuredContains(t, searchResult, []byte(`"agh"`))
121
122 viewResult, err := registry.Call(
123 t.Context(),
124 toolspkg.Scope{},
125 toolspkg.CallRequest{
126 ToolID: toolspkg.ToolIDSkillView,
127 Input: json.RawMessage(`{"name":"agh","file":"references/memory.md"}`),
128 },
129 )
130 if err != nil {
131 t.Fatalf("Registry.Call(skill_view) error = %v", err)
132 }
133 requireNativeStructuredContains(t, viewResult, []byte(`## Contents`))
134 if len(viewResult.Content) != 1 ||
135 !bytes.Contains([]byte(viewResult.Content[0].Text), []byte(`## Contents`)) {
136 t.Fatalf("skill_view content = %#v, want real skill body", viewResult.Content)
137 }
138 })
139
140 t.Run("Should expose bootstrap diagnostics and exclude non-MVP lifecycle tools", func(t *testing.T) {
141 t.Parallel()
142
143 registry := newDaemonNativeRegistry(t, &daemonNativeToolsDeps{
144 Skills: newLoadedNativeSkillRegistry(t),
145 Network: &nativeNetworkStub{},
146 Tasks: &nativeTaskManager{},

Callers

nothing calls this directly

Calls 15

totalCallsMethod · 0.95
totalCallsMethod · 0.95
totalCallsMethod · 0.95
totalCallsMethod · 0.95
totalCallsMethod · 0.95
totalCallsMethod · 0.95
LaunchMethod · 0.95
BindMethod · 0.95
CallMethod · 0.95
WriteMethod · 0.95
ForWorkspaceMethod · 0.95

Tested by

no test coverage detected