shuiyu67 a63b9d2f97 fix: 修复 'ToolResult' object has no attribute 'get'
根因: cli_tools.process_tool_call 在启用 UnifiedToolManager 时直接返回
ToolResult 对象,而 7 个调用点全部按 dict 用 result.get('result'),触发
AttributeError;FC 路径 _execute_tool_by_name 也可能把 ToolResult 透传出去,
后续 result[:5000] 会再炸 TypeError。

- tool_result.py: 新增 normalize_tool_text / normalize_tool_dict,
  统一收敛 ToolResult / dict / str / None 三种历史返回形态。
- cli_tools.process_tool_call: 统一返回 dict(附带 success/error_code/
  tool_result),回退 handler 路径同样归一。
- cli_core._execute_tool_by_name: handler / memory / scheduler 返回值
  归一成 str,保证 FC 路径可安全切片。
- openai/ollama/manual 引擎、websocket_server、cli_clawli: 取工具结果改用
  normalize_tool_text(带本地兜底实现,避免循环导入)。
- cli_clawli: 顺带修复只回传最后一个工具结果的 bug,改为汇总全部。
- 测试: 23 项全过;纯格式/讯飞 500 降级回归冒烟通过。
2026-08-05 10:54:39 +08:00
2026-08-02 18:39:28 +08:00
2026-06-19 00:30:15 +08:00

XiaoLi Pro-CLI

AI Programming Assistant — Code Editing · Git · Browser Automation · Multi-Agent

version python license tests


Features

  • Dual AI Engines — Ollama local + OpenAI compatible (DeepSeek, Grok, SiliconFlow, etc.)
  • Code Editing & Search — Precise replace, batch edit, symbol extraction, regex search
  • Git Integration — Full Git operations + workflow automation
  • Browser Automation — Playwright-driven, navigate/interact/screenshot/JS execution
  • Sub-Agent System — Multi-agent parallel collaboration with task delegation
  • Unified Safety — AI risk analysis + 3-mode switching (Normal/Manual/Unrestricted)
  • 15 Plugins, 141 Operations — Code, Git, browser, engineering, file management, etc.
  • 113 Automated Tests — pytest coverage for all plugins and core modules

Quick Start

git clone https://gitee.com/shuiyu1123/xiaoli-cli.git
cd xiaoli-cli
pip install -r requirements.txt
python ai_cli.py

AI Engines

Engine Type Description
ollama Local Ollama local models, no API key needed
openai Cloud/Local OpenAI compatible: DeepSeek, Grok, SiliconFlow, local vLLM

Plugins (15)

Core Productivity

Plugin Ops Description
code_editor 23 Code editing + search. replace/batch/find/regex/symbols/imports/callers/todo
git_tools 20 Git. status/diff/log/commit/branch + smart-commit/changelog/contributors
cmd_executor 1 Shell commands. Cross-platform, timeout, danger blocking
file_manager 11 File system. list/read/write/copy/move/delete/search/info/mkdir
auto_engineer 16 Engineering. lint/format/test/build/deps + complexity/security/metrics
task_manager 7 Task tracking. add/list/complete/delete/clear with JSON persistence

Advanced

Plugin Ops Description
sub_agent 8 Sub-Agent system. spawn/list/status/result/send/kill, parallel collaboration
browser_auto 31 Browser automation. navigate/click/fill/screenshot/JS/PDF/cookies
tool_search — Tool discovery. Search available plugins by keyword

Utilities

Plugin Description
network_tools ping/get/status/headers/ip
ai_search AI search via jina.ai + web content extraction
frontend_tester HTML/CSS/JS syntax check, responsive validation
speech_recognition Voice recording + speech-to-text
audio_player Audio playback
send_image Send images to phone (Clawli mode)

Safety

Three modes (/safe to switch):

Mode Icon Behavior
Normal (default) AI analyzes risk, confirms only when risk detected
Manual All commands require user confirmation
Unrestricted Execute directly, no checking

Testing

python -m pytest tests/ -v   # 113 tests

License

MIT License

S
Description
No description provided
Readme
10 MiB
0 Stars 1 Watchers 0 Forks