According to the Javadoc of PluginContext#getDataDirectory(), the directory returned by that method (which is $RHQ_AGENT_HOME/data/<plug-in name>) is a "Directory where plugins can store persisted data that survives agent restarts". The obvious expectation is that this remains true even during an auto-update of the agent. In fact, since the auto-update only changes the version of the plug-in container, but not the version of the plug-ins (at least not for custom plug-ins), there is no reason why the plug-in data directories would be reset. However, the observed behavior during an auto-update (from 3.0.0 to 4.5.1) is that the data directories are moved together with the old agent installation (to $RHQ_AGENT_HOME-OLD) and not restored to the new agent installation.
Andreas, after the agent has auto-updated, it will get new(er) plugin versions from the server which also has updated and is (at least for stock RHQ plugins) thus also having newer plugins. Do I understand you correctly that your custom plugin is staying the same and thus expects to e.g. fetch temporary data from the data/ directory, which has gone?