fix(openclaw): update recommended kernel target and delta protocol handling

面板原本只声明 maxProtocol=3 的握手范围,且 chat delta 处理只接受前缀扩展。
连接到 2026.5.12+ 内核时会出现握手兼容问题;agent 输出在内容回滚或重排场景也会
丢失最新文本,前端 streaming 气泡停留在旧前缀。

## Connect 握手协议范围
- 将桌面端 connect frame 的 maxProtocol 从 3 扩展到 4
- 将 Web 模式 connect frame 的 maxProtocol 从 3 扩展到 4
- minProtocol 继续保留 3,用于兼容历史内核
- 范围 [3, 4] 同时覆盖旧内核和 5.12+ 内核,不需要按版本分支

## Chat delta replace 语义
- 当 payload.replace=true 时,无条件覆盖当前 AI 文本缓存
- 保留前缀扩展场景的增量更新逻辑
- 修复内容回滚或重排时文本长度变短导致 UI 不刷新的问题

## 推荐内核版本
- official 推荐目标升到 2026.5.12
- chinese 推荐目标升到 2026.5.12-zh.1
- KERNEL_FLOOR 不变,继续兼容历史安装

## 验证
- cargo check:PASS
- npm run build:PASS
This commit is contained in:
晴天
2026-05-15 18:30:04 +08:00
parent 0b4ef11971
commit 8b690cb6a7
5 changed files with 14 additions and 7 deletions

View File

@@ -138,8 +138,9 @@ pub fn create_connect_frame(
"id": format!("connect-{:08x}-{:04x}", signed_at as u32, rand::random::<u16>()),
"method": "connect",
"params": {
// 协议握手范围声明:下限 3 用于继续兼容历史内核,上限 4 启用新版增量 delta 协议。
"minProtocol": 3,
"maxProtocol": 3,
"maxProtocol": 4,
"client": {
"id": "openclaw-control-ui",
"version": env!("CARGO_PKG_VERSION"),