@wu529778790/open-im 0.3.2 → 0.3.3

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.
@@ -99,9 +99,9 @@ export function setupTelegramHandlers(bot, config, sessionManager) {
99
99
  const taskKey = `${userId}:${msgId}`;
100
100
  // 创建动态节流器
101
101
  const throttle = new DynamicThrottle();
102
- // 保存思考内容和状态
102
+ // 不保存思考内容,只显示最终结果
103
103
  let savedThinkingText = '';
104
- let hasThinkingContent = false; // 是否包含思考内容
104
+ let hasThinkingContent = false; // 始终为 false,不显示思考内容
105
105
  // 创建包装的流式更新函数(带串行化、智能跳过和防抖)
106
106
  const createStreamUpdateWrapper = () => {
107
107
  let lastUpdateTime = 0;
@@ -181,11 +181,10 @@ export function setupTelegramHandlers(bot, config, sessionManager) {
181
181
  const DEBOUNCE_MS = 150;
182
182
  let debounceTimer = null;
183
183
  return (content, toolNote) => {
184
- // 检测是否是思考内容
184
+ // 检测是否是思考内容,如果则跳过不显示
185
185
  if (content.startsWith('💭 **思考中...**')) {
186
- // 保存思考内容(去掉前缀)
187
- savedThinkingText = content.replace('💭 **思考中...**\n\n', '');
188
- hasThinkingContent = true;
186
+ // 不保存思考内容,直接返回,不触发更新
187
+ return;
189
188
  }
190
189
  const now = Date.now();
191
190
  const elapsed = now - lastUpdateTime;
@@ -223,15 +222,8 @@ export function setupTelegramHandlers(bot, config, sessionManager) {
223
222
  },
224
223
  sendComplete: async (content, note) => {
225
224
  throttle.reset();
226
- // 完成时,如果有思考内容,将其包含在最终消息中
227
- if (savedThinkingText && hasThinkingContent) {
228
- const thinkingFormatted = `💭 思考过程:\n${savedThinkingText}\n\n─────────\n\n`;
229
- const combined = thinkingFormatted + content;
230
- await sendFinalMessages(chatId, msgId, combined, note, toolId);
231
- }
232
- else {
233
- await sendFinalMessages(chatId, msgId, content, note, toolId);
234
- }
225
+ // 完成时,只发送最终结果,不包含思考内容
226
+ await sendFinalMessages(chatId, msgId, content, note, toolId);
235
227
  },
236
228
  sendError: async (error) => {
237
229
  throttle.reset();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wu529778790/open-im",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Multi-platform IM bridge for AI CLI tools (Claude, Codex, Cursor)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",