Skip to content

ClawShell v1.12.1 — 测试基础设施与质量修复

Choose a tag to compare

@jorinyang jorinyang released this 16 May 15:55
· 51 commits to main since this release

ClawShell v1.12.1 — 测试基础设施与质量修复

📅 2026-05-16 | 🏷️ 类型: PATCH | 🔖 基于 v1.12.0

本版本聚焦于测试基础设施修复和代码质量改进,不涉及新功能。修复了导致测试套件完全无法运行的关键问题,统一了版本号,并改进了搜索能力。


🔧 修复清单

1. 版本号三方统一

文件 修复前 修复后
CLAWSHELL_VERSION v1.12.0 v1.12.1
pyproject.toml 1.11.0 1.12.1
MANIFEST.json 1.9.0 1.12.1

2. 测试套件修复 (Critical)

问题: test_comprehensive.py (2095行, 592断言) 和 test_phase1.py (297行, 50断言) 完全无法被 pytest 收集运行。

根因: 文件中的 test_handler() 回调函数名以 test_ 开头,pytest 将其参数误解为 fixture,导致 collection error。全部 642 个断言被跳过。

修复:

  • 将模块级测试代码包裹在 def test_all() 函数内
  • 重命名 test_handler() 避免 pytest 误解
  • 添加最终 assert 确保失败时 pytest 正确报告

效果: 0/592 → 592/592 断言全部通过 ✅

3. 测试断言修复

CloudConfig.safe masks secrets — 处理测试环境中无 secret 的情况。

4. 清理重复文件

删除 6 个与 cloud/ 完全相同的顶层文件: brain.py, analyst.py, tasks.py, skills.py, task_board.py, insights_broadcasts_reviews.py

5. 依赖声明补全

pyproject.toml 新增: pyyaml>=6.0, pydantic>=2.5.0, requests>=2.28.0

6. EventBus API 改进

CloudEventBus.get_stats() 新增 deduplicated 键。

7. KnowledgeGraph 搜索改进

_tokenize() 现在生成 2-7 字符前缀,支持子串匹配。搜索 "Cloud" 可匹配 "CloudHub"。


📊 测试结果

5 passed, 3 warnings in 17.90s
642 assertions, 100% pass rate, 27 module categories

📁 变更统计

+2246 行, -3018 行 (净减少 772 行) | 12 files changed


⬆️ 升级指南

git pull origin main
pip install -e ".[cloud,edge]"

无配置变更,无破坏性修改。