-
-
Notifications
You must be signed in to change notification settings - Fork 69.5k
[Bug]: msteams: stale conversation cache breaks replies after restart #2339
Description
Bug Report: msteams plugin - stale conversation cache breaks replies after restart
Version: Clawdbot v2026.1.24-3
OS: macOS (M4 Mac Mini)
Plugin: msteams (bundled)
Problem:
After gateway restart, bot replies fail with:
TypeError: activity.applyConversationReference is not a function
Root Cause Identified:
The file ~/.clawdbot/msteams-conversations.json persists conversation references across restarts. On reload, these are deserialized as plain objects, not Activity class instances — so they lack the applyConversationReference method.
Timeline from logs:
- 16:29:43 UTC — SIGTERM, gateway shutdown
- 16:30:27 UTC — Gateway restarted, msteams provider started
- 16:42:09 UTC — First
applyConversationReferenceerror (~12 min later)
Bot worked perfectly for 48 hours before this restart.
Workaround:
- Delete
~/.clawdbot/msteams-conversations.json - Restart gateway
- Send fresh message to re-establish conversation reference
This works — replies function normally after cache is cleared.
Suggested Fix:
When loading conversation references from cache, rehydrate them as proper Activity/ConversationReference instances (or use the Bot Framework's built-in serialization). Plain JSON.parse() loses the prototype chain.
Relevant code path:
Wherever msteams-conversations.json is loaded — likely needs something like:
const ref = JSON.parse(cached);
const activity = Activity.fromObject(ref); // or similar rehydrationHappy to test a fix if you push a branch. 🦞