fix: use consistent fallback for pickle_key derivation

Address review: _pickle_key now uses _acct_id (which has the 'hermes'
fallback) instead of raw self._user_id, so both values stay consistent
when user_id is empty.
This commit is contained in:
Hermes Agent 2026-04-11 17:26:17 +00:00
parent 050f496816
commit de7253dcdf

View file

@ -357,7 +357,7 @@ class MatrixAdapter(BasePlatformAdapter):
# pickle_key secures in-memory serialisation; derive from
# the same user_id:device_id pair used for the on-disk HMAC.
_acct_id = self._user_id or "hermes"
_pickle_key = f"{self._user_id}:{self._device_id}"
_pickle_key = f"{_acct_id}:{self._device_id}"
crypto_store = MemoryCryptoStore(
account_id=_acct_id,
pickle_key=_pickle_key,