============================================================ 元宝 Agent 工具测试 ============================================================ ================================================== 测试: 读取当前脚本 参数: ('C:\\Users\\yingfankeji\\WorkBuddy\\20260403041724\\test_agent_tools.py',) ================================================== 结果: """ 元宝 Agent 工具测试脚本 测试本地工具调用功能,包含 conda 命令 """ import subprocess import sys from pathlib import Path # 测试工具注册表 class ToolTester: def __init__(self): self.results = [] def test(self, name: str, func, *args): """运行单个测试""" print(f"\n{'='*50}") print(f"测试: {name}") print(f"参数: {args}") print(f"{'='*50}") try: result = func(*args) success = "[错误]" not in result and "失败" not in result st... 状态: [FAIL] ================================================== 测试: 列出当前目录 参数: ('.',) ================================================== 结果: 目录: C:\Users\yingfankeji\WorkBuddy\20260403041724 [DIR] .workbuddy [FILE] test_agent_tools.py (6,638 bytes) [FILE] test_output.txt (0 bytes) [FILE] yuanbao_agent_mvp.py (12,724 bytes) [FILE] yuanbao_agent_v2.py (17,449 bytes) 状态: [PASS] ================================================== 测试: 列出用户目录 参数: ('~',) ================================================== 结果: 目录: C:\Users\yingfankeji [DIR] .agent-browser [DIR] .ai_completion [DIR] .anaconda [DIR] .android [FILE] .array_commander_profile.json (144 bytes) [DIR] .array_doubao_chrome_profile [FILE] .array_doubao_profile.json (120 bytes) [DIR] .array_llm_adapter_cache [FILE] .array_llm_adapter_config.yaml (778 bytes) [DIR] .array_yuanbao_chrome_profile [FILE] .array_yuanbao_profile.json (120 bytes) [FILE] .array_yuanbao_sessions.json (1,199 bytes) [DIR] .aws [DIR] .azure [FILE] .bash_history (13,354 bytes... 状态: [PASS] ================================================== 测试: Python 版本 参数: () ================================================== 结果: 命令: python --version 退出码: 0 Python 3.12.6 状态: [PASS] ================================================== 测试: 系统信息 (systeminfo) 参数: ('systeminfo | findstr /B /C:"OS" | head -5',) ================================================== 异常: 'gbk' codec can't encode character '\u06b2' in position 83: illegal multibyte sequence ================================================== 测试: 当前目录 参数: ('cd',) ================================================== 结果: 命令: cd 退出码: 0 C:\Users\yingfankeji\WorkBuddy\20260403041724 状态: [PASS] ============================================================ Conda 测试 ============================================================ 检查 conda: 命令: conda --version 退出码: 0 conda 26.1.1 ================================================== 测试: conda 环境列表 参数: () ================================================== 结果: 命令: conda env list 退出码: 0 # conda environments: # # * -> active # + -> frozen array-mvp C:\Users\yingfankeji\.conda\envs\array-mvp doubao C:\Users\yingfankeji\.conda\envs\doubao goon C:\Users\yingfankeji\.conda\envs\goon omniparser C:\Users\yingfankeji\.conda\envs\omniparser base D:\anaconda3 T-01 D:\anaconda3\envs\T-01 T-02 D:\anaconda3\envs\T-02 T-03 ... 状态: [PASS] ================================================== 测试: conda 信息 参数: () ================================================== 结果: 命令: conda info 退出码: 0 active environment : None user config file : C:\Users\yingfankeji\.condarc populated config files : D:\anaconda3\.condarc D:\anaconda3\condarc.d\anaconda-auth.yml conda version : 26.1.1 conda-build version : 25.11.1 python version : 3.13.9.final.0 solver : libmamba (default) virtual packages : __archspec=1=skylake __conda=26.1.1=0 __cud... 状态: [PASS] ================================================== 测试: base 环境包列表 (前20行) 参数: ('conda list -n base | head -20',) ================================================== 异常: 'gbk' codec can't encode character '\u06b2' in position 71: illegal multibyte sequence ================================================== 测试: pip 包列表 (前20行) 参数: ('pip list | head -20',) ================================================== 异常: 'gbk' codec can't encode character '\u06b2' in position 61: illegal multibyte sequence ================================================== 测试: 查找 Python 文件 参数: ('dir /s /b *.py 2>nul | head -10',) ================================================== 异常: 'gbk' codec can't encode character '\u06b2' in position 73: illegal multibyte sequence ================================================== 测试报告 ================================================== [FAIL] 读取当前脚本 [OK] 列出当前目录 [OK] 列出用户目录 [OK] Python 版本 [FAIL] 系统信息 (systeminfo) [OK] 当前目录 [OK] conda 环境列表 [OK] conda 信息 [FAIL] base 环境包列表 (前20行) [FAIL] pip 包列表 (前20行) [FAIL] 查找 Python 文件 总计: 6/11 通过 ============================================================ [WARNING] 部分测试失败,请检查环境配置 ============================================================