乐于分享
好东西不私藏

OpenClaw 每日更新 | 3 月 26 日:大规模重构 + 类型系统完善

OpenClaw 每日更新 | 3 月 26 日:大规模重构 + 类型系统完善

大家好,我是程序员虎哥,跟踪学习、不定期同步以 OpenClaw 为代表的 Agent 技术。技术发展应该为劳动者减负,而不应该增加焦虑和内耗~


OpenClaw 每日更新 | 3 月 26 日:大规模重构 + 类型系统完善

📊 概览

统计时间:2026 年 3 月 26 日(太平洋时区 PDT UTC-7)

指标
数据
总 Commits
230+
贡献者
15+ 人
修改文件
2316+ 个
新增代码
~97,699 行
删除代码
~44,698 行

分类统计

类型
数量
占比
♻️ refactor
100+
43%
🔧 fix
80+
35%
🧪 test
30+
13%
📝 docs
10+
4%
🏗️ build/chore
10+
4%

主要贡献者 TOP 5

排名
贡献者
Commits
主要工作
1
Peter Steinberger
100+
大规模重构、测试优化
2
Tak Hoffman
40+
类型系统、CI 修复
3
Ayaan Zaidi
30+
Feishu 类型、重构
4
Jacob Tomlinson
20+
安全修复、网关权限
5
Marcus Castro
5+
Skill sourceInfo 迁移

🚀 重点重构

1. Provider 运行时迁移到 Extensions

贡献者:Peter Steinberger

内容

  • refactor: move provider runtime into extensions
  • refactor: move memory host into sdk package
  • refactor: move memory engine behind plugin adapters
  • refactor: move memory plugin state into plugin host
  • refactor: plugin-own speech provider config

意义:将 Provider 运行时从核心代码迁移到 Extensions 插件系统,提高了模块化程度和可维护性。

2. Browser 插件化

贡献者:Peter Steinberger

内容

  • refactor: switch browser ownership to bundled plugin
  • refactor: add browser plugin runtime package
  • refactor: remove browser compat shadow tree
  • refactor: remove legacy browser bridge entrypoints

意义:Browser 功能完全插件化,从核心代码中剥离,提高了代码清晰度。

3. Memory 系统重构

贡献者:Peter Steinberger

内容

  • refactor: move memory tooling into memory-core extension
  • refactor: move memory flush ownership into memory plugin
  • refactor: move memory-core engine behind plugin adapters
  • refactor: genericize memory embedding adapters

意义:Memory 系统完全由插件管理,核心代码不再直接依赖 Memory 实现。

4. CLI 后端插件化

贡献者:Peter Steinberger

内容

  • feat: pluginize cli inference backends
  • refactor: split cli runner pipeline
  • refactor: split embedded run helpers
  • refactor: split embedded attempt helpers

意义:CLI 推理后端支持插件化,可以灵活选择不同的 AI 编程助手(Claude Code、Codex 等)。


🔧 关键 Bug 修复

1. WhatsApp 引用消息提及检测

贡献者:lurebat

问题:引用消息中的 mentionedJids 被错误地计入当前消息的提及检测。

修复

  • fix(whatsapp): exclude quoted message mentionedJids from mention detection (#52711)
  • 区分引用消息和当前消息的 mentionedJids

影响:WhatsApp 群组消息提及检测更准确。

2. Discord 网关清理竞争条件

贡献者:Tak Hoffman

问题:Discord 网关清理过程中存在竞争条件,可能导致崩溃。

修复

  • fix(discord): force fresh gateway reconnects (#54697)
  • fix(discord): harden forced reconnect teardown
  • fix(discord): retry after socket drain timeouts
  • fix(discord): guard forced socket teardown

影响:Discord 连接更稳定,避免崩溃。

3. HTTP 500 错误未触发故障转移

贡献者:Craig Allan-McWilliams

问题:HTTP 500(内部服务器错误)未被视为瞬态错误,导致 Agent 失败而不是尝试下一个候选模型。

修复

  • Fix: treat HTTP 500 as a transient failover error (#55332)
  • 将 HTTP 500 加入 TRANSIENT_HTTP_ERROR_CODES

影响:模型故障转移更可靠。

4. Session Status 工具可见性检查绕过

贡献者:Tak Hoffman

问题:当传入 sessionId 而不是显式 agent key 时,session_status 工具可能绕过可见性检查。

修复

  • fix(agents): enforce session_status guard after sessionId resolution (#55105)
  • 使用原始的 isExplicitAgentKey 标志而不是动态检查

影响:沙箱 Agent 无法通过提供 sessionId 绕过可见性限制。

5. WhatsApp 自动回复工具禁用提示词注入

贡献者:dhi13man

问题runCliAgent() 无条件地向所有 CLI 后端会话追加"Tools are disabled in this session"提示词,导致 CLI Agent(如 Claude Code)误解为禁止使用所有工具(包括其原生 Bash、Read、Write 工具)。

修复

  • fix(agents): remove unconditional "Tools are disabled" prompt injection in CLI runner
  • 完全移除硬编码字符串,CLI 后端已接收 tools: []

影响:CLI 后端 cron 作业、群聊、DM 会话中的工具调用恢复正常。


🛡️ 安全修复

1. Feishu 加密密钥配置绕过

贡献者:Coy Geek

内容

  • fix(cr-mbx-feishu-encryptkey-config-redaction-bypass): apply security fix (#53414)
  • 应用 Feishu 加密密钥配置脱敏绕过修复

影响:提高 Feishu 渠道安全性。

2. Telegram 网络限制绕过

贡献者:Jacob Tomlinson

内容

  • Telegram: enforce DM auth for callbacks (#55112)
  • Telegram: throttle repeated webhook auth guesses (#55142)
  • 限制重复的 webhook 认证猜测

影响:防止 Telegram webhook 认证暴力猜测。

3. BlueBubbles 网络限制绕过

贡献者:Jacob Tomlinson

内容

  • fix(bluebubbles): throttle webhook auth guesses (#55133)
  • fix(bluebubbles): trust proxied webhook client IPs
  • fix(bluebubbles): honor real-ip fallback for webhooks

影响:防止 BlueBubbles webhook 认证暴力猜测。

4. 网关会话权限修复

贡献者:Jacob Tomlinson

内容

  • Gateway: require requester ownership for HTTP session kills (#55308)
  • Gateway: require caller scope for subagent session deletion (#55281)
  • Gateway: require pairing for backend scope upgrades (#55286)

影响:提高网关会话管理安全性。


📝 类型系统完善

1. Feishu 类型修复

贡献者:Ayaan Zaidi

内容

  • test(feishu): type bot interaction fixtures
  • test(feishu): type reply lifecycle fixtures
  • test(feishu): type tool harness fixtures
  • test(feishu): type policy fixtures
  • test(feishu): type basic fixtures
  • refactor(feishu): remove docx explicit-any escapes
  • refactor(feishu): remove stale explicit-any escapes

意义:Feishu 渠道代码类型安全性大幅提升。

2. Mattermost 类型修复

贡献者:Ayaan Zaidi

内容

  • refactor(mattermost): type config seams
  • refactor(mattermost): type action params
  • refactor(mattermost): define post schema once
  • test(mattermost): remove untyped mocks
  • test(mattermost): remove double-cast test helpers

意义:Mattermost 渠道代码类型安全性提升。

3. 大规模类型清理

贡献者:Peter Steinberger, Tak Hoffman

内容

  • 移除大量 explicit-any 转义
  • 统一类型定义
  • 修复类型导入问题

意义:整体代码类型安全性提升。


🧪 测试优化

1. 测试并行化优化

贡献者:Peter Steinberger

内容

  • perf: speed up test parallelism
  • perf: enable local channel planner parallelism on node 25
  • perf: speed up channel test runs
  • perf: overlap isolated channel runs with shared lane

意义:测试运行速度显著提升。

2. 测试夹具去重

贡献者:Peter Steinberger

内容

  • test: dedupe extension channel fixtures
  • test: share cli command and discord test helpers
  • test: share ui reconnect and storage helpers
  • test: share gateway authz and watchdog fixtures
  • test: share matrix migration fixtures

意义:减少代码重复,提高测试可维护性。

3. Discord 测试隔离

贡献者:Peter Steinberger, Tak Hoffman

内容

  • test: stabilize discord monitor ci isolation
  • test: dedupe discord provider proxy overrides
  • test: share discord monitor fixtures
  • fix(ci): repair discord regression tests

意义:Discord 测试在 CI 中更稳定。


📈 贡献者榜单

贡献者
Commits
主要贡献领域
Peter Steinberger
100+
大规模重构、测试优化
Tak Hoffman
40+
类型系统、CI 修复、Discord
Ayaan Zaidi
30+
Feishu 类型、重构
Jacob Tomlinson
20+
安全修复、网关权限
Marcus Castro
5+
Skill sourceInfo 迁移
Tyler Yust
5+
BlueBubbles 功能增强
Saurabh Mishra
3+
错误处理、修复
Kevin Sheng
2+
Discord 网关修复
其他贡献者
20+
各种修复和改进

📝 观察与总结

技术趋势

  1. 大规模重构:43% 的 commits 是重构,显示团队在技术债务管理上的巨大投入。Provider、Browser、Memory、CLI 后端等核心功能都在向插件化迁移。

  2. 类型系统完善:大量类型修复(尤其是 Feishu 和 Mattermost),显示团队对代码质量的重视。

  3. 安全性提升:多个安全修复(Telegram、BlueBubbles、网关权限),显示团队对安全问题的快速响应。

  4. 测试优化:测试并行化、夹具去重、CI 隔离,显示团队对开发效率的持续优化。

代码质量观察

  • 重构规模大:230+ commits 中 100+ 是重构,代码结构正在发生根本性变化
  • 类型安全性提升:大量移除 explicit-any 转义,类型定义更严谨
  • 测试覆盖全面:30+ 测试 commits,测试夹具去重,CI 更稳定
  • 安全修复及时:发现安全问题后迅速修复并发布

🔗 相关链接

  • OpenClaw GitHub: https://github.com/openclaw/openclaw[1]
  • 本次 Commits 对比:https://github.com/openclaw/openclaw/compare/之前的[2] SHA..a3b85e1583
  • Feishu 加密密钥安全修复:https://github.com/openclaw/openclaw/pull/53414[3]
  • Discord 网关修复:https://github.com/openclaw/openclaw/pull/54697[4]

这是「Agent 扫地僧」的 OpenClaw 每日更新。如果你觉得有价值,欢迎关注公众号,一起跟踪学习 Agent 技术~ 🧹

引用链接

[1]https://github.com/openclaw/openclaw

[2]https://github.com/openclaw/openclaw/compare/之前的: https://github.com/openclaw/openclaw/compare/%E4%B9%8B%E5%89%8D%E7%9A%84

[3]https://github.com/openclaw/openclaw/pull/53414

[4]https://github.com/openclaw/openclaw/pull/54697