diff --git a/openclaw-version-policy.json b/openclaw-version-policy.json index e9cf50d..c3bd6e2 100644 --- a/openclaw-version-policy.json +++ b/openclaw-version-policy.json @@ -9,10 +9,10 @@ }, "default": { "official": { - "recommended": "2026.5.7" + "recommended": "2026.5.12" }, "chinese": { - "recommended": "2026.5.7-zh.1" + "recommended": "2026.5.12-zh.1" } }, "panels": { diff --git a/scripts/dev-api.js b/scripts/dev-api.js index 8f8c2f8..854fd39 100644 --- a/scripts/dev-api.js +++ b/scripts/dev-api.js @@ -6288,7 +6288,8 @@ const handlers = { id: `connect-${idHex}-${rndHex}`, method: 'connect', params: { - minProtocol: 3, maxProtocol: 3, + // 协议握手范围声明:下限 3 用于继续兼容历史内核,上限 4 启用新版增量 delta 协议。 + minProtocol: 3, maxProtocol: 4, client: { id: 'openclaw-control-ui', version: '1.0.0', platform, deviceFamily: 'desktop', mode: 'ui' }, role: 'operator', scopes: SCOPES, caps: [], auth: { token: gatewayToken || '' }, diff --git a/src-tauri/src/commands/device.rs b/src-tauri/src/commands/device.rs index 54a6e82..a953866 100644 --- a/src-tauri/src/commands/device.rs +++ b/src-tauri/src/commands/device.rs @@ -138,8 +138,9 @@ pub fn create_connect_frame( "id": format!("connect-{:08x}-{:04x}", signed_at as u32, rand::random::()), "method": "connect", "params": { + // 协议握手范围声明:下限 3 用于继续兼容历史内核,上限 4 启用新版增量 delta 协议。 "minProtocol": 3, - "maxProtocol": 3, + "maxProtocol": 4, "client": { "id": "openclaw-control-ui", "version": env!("CARGO_PKG_VERSION"), diff --git a/src/lib/feature-catalog.js b/src/lib/feature-catalog.js index 19eab1d..59fb1f4 100644 --- a/src/lib/feature-catalog.js +++ b/src/lib/feature-catalog.js @@ -189,8 +189,10 @@ export const KERNEL_FLOOR = { */ export const KERNEL_TARGET = { openclaw: { - official: '2026.5.6', - chinese: '2026.5.6-zh.2', + // 内核协议在 5.12 升级到 v4(MIN_CLIENT_PROTOCOL_VERSION=4,新增增量 chat delta payloads), + // 面板通过 connect frame `[minProtocol=3, maxProtocol=4]` 同时兼容新旧内核 + official: '2026.5.12', + chinese: '2026.5.12-zh.1', }, hermes: { default: '0.13.x', diff --git a/src/pages/chat.js b/src/pages/chat.js index 3019538..d59048b 100644 --- a/src/pages/chat.js +++ b/src/pages/chat.js @@ -1862,7 +1862,10 @@ function handleChatEvent(payload) { if (c?.audios?.length) _currentAiAudios = c.audios if (c?.files?.length) _currentAiFiles = c.files if (c?.tools?.length) _currentAiTools = c.tools - if (c?.text && c.text.length > _currentAiText.length) { + // 增量 delta 协议下,当输出文本不是前缀扩展时(例如内容回滚或重排), + // 对端会带 replace=true,此时新文本可能比当前缓存短,必须无条件覆盖,否则会丢失最新内容。 + const isReplace = payload.replace === true + if (c?.text && (isReplace || c.text.length > _currentAiText.length)) { showTyping(false) if (!_currentAiBubble) { _currentAiBubble = createStreamBubble()