Skip to content

The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu

Fix JSON inventory to filter configs and MCP servers when --all is not set

Cursor Agent67accff206a5
diff --git a/cli/beacon/cmd/endpoint_diagnostics.go b/cli/beacon/cmd/endpoint_diagnostics.go
index 2c158414..653740ad 100644
--- a/cli/beacon/cmd/endpoint_diagnostics.go
+++ b/cli/beacon/cmd/endpoint_diagnostics.go
@@ -147,6 +147,24 @@ func runEndpointInventory(cmd *cobra.Command, args []string) error {
}
}
result.Harnesses = filtered
+
+ filteredConfigs := []endpointinventory.Config{}
+ existingPaths := map[string]bool{}
+ for _, c := range result.Configs {
+ if c.Exists {
+ filteredConfigs = append(filteredConfigs, c)
+ existingPaths[c.PathHash] = true
+ }
+ }
+ result.Configs = filteredConfigs
+
+ filteredServers := []endpointinventory.MCPServer{}
+ for _, s := range result.MCPServers {
+ if existingPaths[s.SourcePathHash] {
+ filteredServers = append(filteredServers, s)
+ }
+ }
+ result.MCPServers = filteredServers
}
return json.NewEncoder(os.Stdout).Encode(result)
}