myagent-ai 1.23.31 → 1.23.32
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.
- package/core/tool_dispatcher.py +7 -2
- package/package.json +1 -1
package/core/tool_dispatcher.py
CHANGED
|
@@ -182,7 +182,7 @@ class ToolDispatcher:
|
|
|
182
182
|
)
|
|
183
183
|
result = exec_result.to_dict()
|
|
184
184
|
|
|
185
|
-
output = result.get("output", "")
|
|
185
|
+
output = result.get("stdout", "") or result.get("output", "")
|
|
186
186
|
import re as _re
|
|
187
187
|
|
|
188
188
|
# [v1.23.0] 检测 __SEND_FILE__ 标记 — CLI send-file 命令输出此标记
|
|
@@ -225,7 +225,8 @@ class ToolDispatcher:
|
|
|
225
225
|
if not media_result.get("success"):
|
|
226
226
|
result["output"] += f"\n[音频播放失败: {media_result.get('error', '')}]"
|
|
227
227
|
if video_markers:
|
|
228
|
-
|
|
228
|
+
# [v1.23.32] 修复: result 可能没有 output key(来自 to_dict 的 stdout)
|
|
229
|
+
clean_output = result.get("output", "") or clean_output
|
|
229
230
|
clean_output = _re.sub(r'__EMBED_VIDEO__.+?__END__\n?', '', clean_output).strip()
|
|
230
231
|
result["output"] = clean_output
|
|
231
232
|
for media_url, media_title in video_markers:
|
|
@@ -261,6 +262,10 @@ class ToolDispatcher:
|
|
|
261
262
|
except Exception:
|
|
262
263
|
pass
|
|
263
264
|
|
|
265
|
+
# [v1.23.32] 确保 result 始终有 output 字段(to_dict 返回 stdout,V2 循环依赖 output)
|
|
266
|
+
if "output" not in result:
|
|
267
|
+
result["output"] = clean_output
|
|
268
|
+
|
|
264
269
|
return result
|
|
265
270
|
|
|
266
271
|
async def _exec_recall_memory(self, params: Dict, task_id: str) -> Dict:
|