Photoshop panels do not adjust their size based on the content. They are restricted to the sizes defined by the manifest. Plugins also cannot control the size of their panel programmatically.
Users can collapse the panel if they so choose (they can double-click on the tab to collapse it), but this is entirely at the user’s discretion.
The expectation is that plugin developers will design their UI in a responsive manner – allowing the user to configure the panel to their liking. Sometimes limits must be placed on this (min/max size), but generally, it should be left to the user to control their workspace, rather than the plugin doing it.
If your plugin consists of multiple accordions in the UI, you might want to consider shipping with multiple panels instead. Then the user can group all those panels together, resize them, collapse them, etc., as they choose. (Plus they can decide the ordering.) We are working on adding a feature to the manifest that will let you specify that a plugin’s panels should be automatically grouped together at first use.