Compare commits

..

1 Commits

Author SHA1 Message Date
SHL0MS
b7e4760a8f fix(claw): handle OpenClaw TTS provider rename from "edge" to "microsoft"
OpenClaw renamed the "edge" TTS provider to "microsoft"
(openclaw/openclaw#56220). The migration tool only checked
providers.edge / tts.edge, silently finding nothing when the
source config used the new name.

Check both "edge" and "microsoft" provider keys when reading TTS
config. Normalize "microsoft" back to "edge" in the output since
Hermes still uses the original name.

Refs #7847
2026-04-11 13:13:14 -04:00
3 changed files with 8 additions and 18 deletions

View File

@@ -352,16 +352,7 @@ class MatrixAdapter(BasePlatformAdapter):
from mautrix.crypto import OlmMachine
from mautrix.crypto.store import MemoryCryptoStore
# account_id and pickle_key are required by mautrix ≥0.21.
# Use the Matrix user ID as account_id for stable identity.
# 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"{_acct_id}:{self._device_id}"
crypto_store = MemoryCryptoStore(
account_id=_acct_id,
pickle_key=_pickle_key,
)
crypto_store = MemoryCryptoStore()
# Restore persisted crypto state from a previous run.
# Uses HMAC to verify integrity before unpickling.

View File

@@ -1324,8 +1324,9 @@ class Migrator:
tts_data: Dict[str, Any] = {}
provider = tts.get("provider")
if isinstance(provider, str) and provider in ("elevenlabs", "openai", "edge"):
tts_data["provider"] = provider
if isinstance(provider, str) and provider in ("elevenlabs", "openai", "edge", "microsoft"):
# OpenClaw renamed "edge" to "microsoft"; Hermes still uses "edge"
tts_data["provider"] = "edge" if provider == "microsoft" else provider
# TTS provider settings live under messages.tts.providers.{provider}
# in OpenClaw (not messages.tts.elevenlabs directly)
@@ -1374,9 +1375,9 @@ class Migrator:
tts_data["openai"] = oai_settings
edge_tts = (
(providers.get("edge") or {})
if isinstance(providers.get("edge"), dict) else
(tts.get("edge") or {})
(providers.get("edge") or providers.get("microsoft") or {})
if isinstance(providers.get("edge"), dict) or isinstance(providers.get("microsoft"), dict) else
(tts.get("edge") or tts.get("microsoft") or {})
)
if isinstance(edge_tts, dict):
edge_voice = edge_tts.get("voice")

View File

@@ -157,9 +157,7 @@ def _make_fake_mautrix():
mautrix_crypto_store = types.ModuleType("mautrix.crypto.store")
class MemoryCryptoStore:
def __init__(self, account_id="", pickle_key=""):
self.account_id = account_id
self.pickle_key = pickle_key
pass
mautrix_crypto_store.MemoryCryptoStore = MemoryCryptoStore