feat(matrix): implement !reset via new platform_chat_id

Instead of calling a /reset endpoint on platform-agent, !reset now
generates a new thread_id (platform_chat_id) for the room. The old
WebSocket connection is closed and the next message creates a fresh
context automatically. No platform changes required.
This commit is contained in:
Mikhail Putilovskij 2026-04-19 21:20:31 +03:00
parent 4a5260ca79
commit 73c472ecc4
4 changed files with 45 additions and 46 deletions

View file

@ -120,6 +120,15 @@ class RealPlatformClient(PlatformClient):
async def update_settings(self, user_id: str, action) -> None:
await self._prototype_state.update_settings(user_id, action)
async def disconnect_chat(self, chat_id: str) -> None:
chat_key = str(chat_id)
chat_api = self._chat_apis.pop(chat_key, None)
self._chat_send_locks.pop(chat_key, None)
if chat_api is not None:
close = getattr(chat_api, "close", None)
if callable(close):
await close()
async def close(self) -> None:
for chat_api in list(self._chat_apis.values()):
close = getattr(chat_api, "close", None)