fix(tools): isolate plugin runtime state

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Xubin Ren
2026-05-12 11:28:20 +08:00
committed by Xubin Ren
co-authored by Cursor
parent 043f0e67f7
commit 23312d683e
4 changed files with 49 additions and 7 deletions
+1 -2
View File
@@ -79,8 +79,7 @@ class MessageTool(Tool, ContextAware):
self._default_channel.set(ctx.channel)
self._default_chat_id.set(ctx.chat_id)
self._default_message_id.set(ctx.message_id)
if ctx.metadata:
self._default_metadata.set(ctx.metadata)
self._default_metadata.set(dict(ctx.metadata or {}))
def set_send_callback(self, callback: Callable[[OutboundMessage], Awaitable[None]]) -> None:
"""Set the callback for sending messages."""