myagent-ai 1.15.46 → 1.15.47

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.
@@ -1147,10 +1147,12 @@ class MainAgent(BaseAgent):
1147
1147
  _max_output = 6000
1148
1148
  else:
1149
1149
  _max_output = 3000
1150
+ # 超时工具明确标注状态,让 LLM 清楚知道哪个工具超时了
1151
+ _status = "超时" if is_timeout else ('成功' if tool_result.get('success') else '失败')
1150
1152
  tool_outputs_parts.append(
1151
1153
  f"### {before_call}\n"
1152
1154
  f"**工具**: {tool_name}\n"
1153
- f"**结果**: {'成功' if tool_result.get('success') else '失败'}\n"
1155
+ f"**结果**: {_status}\n"
1154
1156
  f"{truncate_str(output_str, _max_output)}\n"
1155
1157
  )
1156
1158
 
@@ -1160,7 +1162,7 @@ class MainAgent(BaseAgent):
1160
1162
  ))
1161
1163
  conversation_history.append(Message(
1162
1164
  role="user",
1163
- content=f"[工具 {tool_name} 执行完成] {'成功' if tool_result.get('success') else '失败'}",
1165
+ content=f"[工具 {tool_name} {'超时' if is_timeout else '执行完成'}] {_status}",
1164
1166
  ))
1165
1167
 
1166
1168
  # 保存工具调用到会话记忆
@@ -1177,13 +1179,25 @@ class MainAgent(BaseAgent):
1177
1179
  self.memory.add_session(
1178
1180
  session_id=context.session_id,
1179
1181
  role="tool",
1180
- content=f"[{tool_name}] {'成功' if tool_result.get('success') else '失败'}\n{truncate_str(output_str, 5000)}",
1182
+ content=f"[{tool_name}] {_status}\n{truncate_str(output_str, 5000)}",
1181
1183
  key="tool_result",
1182
1184
  importance=0.4,
1183
1185
  )
1184
1186
 
1185
- # 任一工具超时 → 立即停止执行剩余工具,用已收集的结果回调 LLM
1187
+ # 任一工具超时 → 立即停止执行剩余工具
1186
1188
  if _has_timeout:
1189
+ # 收集当前工具之后未执行的工具,一并写入回调数据
1190
+ _current_idx = parsed.tools_to_call.index(tool_info)
1191
+ _skipped_tools = []
1192
+ for _remaining in parsed.tools_to_call[_current_idx + 1:]:
1193
+ _rname = _remaining.get("toolname", "").strip()
1194
+ if _rname:
1195
+ _skipped_tools.append(_rname)
1196
+ if _skipped_tools:
1197
+ tool_outputs_parts.append(
1198
+ f"**注意**: 工具 {tool_name} 执行超时 ({timeout}s),"
1199
+ f"以下工具未执行: {', '.join(_skipped_tools)}"
1200
+ )
1187
1201
  break
1188
1202
 
1189
1203
  all_tool_outputs = "\n".join(tool_outputs_parts)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myagent-ai",
3
- "version": "1.15.46",
3
+ "version": "1.15.47",
4
4
  "description": "本地桌面端执行型AI助手 - Open Interpreter 风格 | Local Desktop Execution-Oriented AI Assistant",
5
5
  "main": "main.py",
6
6
  "bin": {