@@ -181,6 +181,43 @@ func TestBuildToolRegistryUsesWebFetchConfig(t *testing.T) {
181181 }
182182}
183183
184+ func TestBuildToolRegistryRegistersSpawnSubAgent (t * testing.T ) {
185+ t .Parallel ()
186+
187+ cfg := config .StaticDefaults ().Clone ()
188+ cfg .Workdir = t .TempDir ()
189+
190+ registry , cleanup , err := buildToolRegistry (cfg )
191+ if err != nil {
192+ t .Fatalf ("buildToolRegistry() error = %v" , err )
193+ }
194+ if cleanup != nil {
195+ defer cleanup ()
196+ }
197+
198+ tool , err := registry .Get (tools .ToolNameSpawnSubAgent )
199+ if err != nil {
200+ t .Fatalf ("registry.Get(spawn_subagent) error = %v" , err )
201+ }
202+ if tool .Name () != tools .ToolNameSpawnSubAgent {
203+ t .Fatalf ("tool.Name() = %q, want %q" , tool .Name (), tools .ToolNameSpawnSubAgent )
204+ }
205+ specs , err := registry .ListAvailableSpecs (context .Background (), tools.SpecListInput {})
206+ if err != nil {
207+ t .Fatalf ("ListAvailableSpecs() error = %v" , err )
208+ }
209+ found := false
210+ for _ , spec := range specs {
211+ if spec .Name == tools .ToolNameSpawnSubAgent {
212+ found = true
213+ break
214+ }
215+ }
216+ if ! found {
217+ t .Fatalf ("expected %q in available specs, got %+v" , tools .ToolNameSpawnSubAgent , specs )
218+ }
219+ }
220+
184221func TestBuildMCPRegistryFromConfig (t * testing.T ) {
185222 stubClient := & stubMCPServerClient {
186223 tools : []mcp.ToolDescriptor {
@@ -1672,6 +1709,13 @@ func (s *stubRemoteRuntimeForBootstrap) ListSessionSkills(context.Context, strin
16721709 return nil , nil
16731710}
16741711
1712+ func (s * stubRemoteRuntimeForBootstrap ) ListAvailableSkills (
1713+ context.Context ,
1714+ string ,
1715+ ) ([]services.AvailableSkillState , error ) {
1716+ return nil , nil
1717+ }
1718+
16751719func (s * stubRemoteRuntimeForBootstrap ) Close () error {
16761720 s .closed = true
16771721 return nil
0 commit comments