myagent-ai 1.15.44 → 1.15.45

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.
@@ -1249,36 +1249,10 @@ class MainAgent(BaseAgent):
1249
1249
  )
1250
1250
  break
1251
1251
 
1252
- # finish=false: 根据工具的 callback 标志决定是否回调
1253
- if not need_callback:
1254
- logger.info(f"[{task_id}] 所有工具无需回调且 finish=false,结束循环")
1255
- # 只保存当前轮次新增的文本(前几轮已通过回调保存)
1256
- _current_round = _v2_reasoning_collected[_reasoning_len_before_round:]
1257
- if _current_round:
1258
- final_text = "\n".join(_current_round)
1259
- if current_task_plan:
1260
- final_text += f"\n\n{current_task_plan}"
1261
- elif _v2_reasoning_collected:
1262
- final_text = "\n".join(_v2_reasoning_collected)
1263
- if current_task_plan:
1264
- final_text += f"\n\n{current_task_plan}"
1265
- else:
1266
- final_text = "已完成所有操作。"
1267
- if current_task_plan:
1268
- final_text += f"\n\n任务计划:\n{current_task_plan}"
1269
- context.working_memory["final_response"] = final_text
1270
- # [v1.15.8] 跳过已发送的 reasoning 文本,避免 TTS 重复播报
1271
- if not _emitted_reasoning_this_iter:
1272
- await self._emit_v2_event("v2_reasoning", {"content": truncate_str(final_text, 3000)}, stream_callback)
1273
- if self.memory:
1274
- self.memory.add_session(
1275
- session_id=context.session_id,
1276
- role="assistant",
1277
- content=final_text,
1278
- )
1279
- break
1280
-
1281
- logger.info(f"[{task_id}] finish=false 且 need_callback=true,回调 LLM...")
1252
+ # finish=false: 必须继续回调 LLM,无论工具 callback 设置如何
1253
+ # callback 只控制工具结果是否喂回 LLM,不控制循环是否继续
1254
+ # 只有 finish=true 才应该终止循环
1255
+ logger.info(f"[{task_id}] finish=false,继续回调 LLM...")
1282
1256
 
1283
1257
  # 回调前,保存当前轮次的 LLM 输出到会话记忆
1284
1258
  # 这样每轮工具调用都有对应的 assistant 消息记录
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myagent-ai",
3
- "version": "1.15.44",
3
+ "version": "1.15.45",
4
4
  "description": "本地桌面端执行型AI助手 - Open Interpreter 风格 | Local Desktop Execution-Oriented AI Assistant",
5
5
  "main": "main.py",
6
6
  "bin": {