@wu529778790/open-im 1.11.7-beta.1 → 1.11.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -43,6 +43,8 @@ export function setupClawbotHandlers(config, sessionManager) {
43
43
  await sendTextReply(c, t);
44
44
  },
45
45
  };
46
+ // 记录已发送的工具调用通知,避免重复发送
47
+ let lastToolNote = '';
46
48
  const handleAIRequest = createPlatformAIRequestHandler({
47
49
  platform: 'clawbot',
48
50
  config,
@@ -52,9 +54,10 @@ export function setupClawbotHandlers(config, sessionManager) {
52
54
  runningTasks: ctx.runningTasks,
53
55
  taskKeyBuilder: (userId, _msgId) => `${userId}:${msgId}`,
54
56
  taskCallbacksFactory: ({ chatId: c }) => ({
55
- streamUpdate: async (content, toolNote) => {
56
- // 有工具调用时,发送工具调用通知
57
- if (toolNote) {
57
+ streamUpdate: async (_content, toolNote) => {
58
+ // 只在新工具调用时发送通知,避免重复
59
+ if (toolNote && toolNote !== lastToolNote) {
60
+ lastToolNote = toolNote;
58
61
  await sendTextReply(c, `⚙️ ${toolNote}`);
59
62
  }
60
63
  },
@@ -48,6 +48,8 @@ export function setupWorkBuddyHandlers(config, sessionManager) {
48
48
  await sendTextReply(null, c, t, msgId);
49
49
  },
50
50
  };
51
+ // 记录已发送的工具调用通知,避免重复发送
52
+ let lastToolNote = '';
51
53
  // Create per-event handleAIRequest that captures msgId for task callbacks
52
54
  const handleAIRequest = createPlatformAIRequestHandler({
53
55
  platform: 'workbuddy',
@@ -58,9 +60,10 @@ export function setupWorkBuddyHandlers(config, sessionManager) {
58
60
  runningTasks: ctx.runningTasks,
59
61
  taskKeyBuilder: (userId, _msgId) => `${userId}:${msgId}`,
60
62
  taskCallbacksFactory: ({ chatId: c }) => ({
61
- streamUpdate: async (content, toolNote) => {
62
- // 有工具调用时,发送工具调用通知
63
- if (toolNote) {
63
+ streamUpdate: async (_content, toolNote) => {
64
+ // 只在新工具调用时发送通知,避免重复
65
+ if (toolNote && toolNote !== lastToolNote) {
66
+ lastToolNote = toolNote;
64
67
  await sendTextReply(null, c, `⚙️ ${toolNote}`, msgId);
65
68
  }
66
69
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wu529778790/open-im",
3
- "version": "1.11.7-beta.1",
3
+ "version": "1.11.7",
4
4
  "description": "Your AI coding assistant, in every chat app. Multi-platform IM bridge for Claude Code, Codex, and CodeBuddy.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",