fix(gateway): support latest hello server version payload

OpenClaw 2026.5.18/2026.5.19 still uses Gateway WS protocol v4
(PROTOCOL_VERSION=4, MIN_CLIENT_PROTOCOL_VERSION=4), so there is no v5
handshake to implement. The compatibility break is the hello payload
shape: current upstream sends the runtime version at `hello.server.version`
while ClawPanel only read the old flat `hello.serverVersion` field.

Read both shapes so latest kernels keep populating wsClient.serverVersion,
which in turn keeps Dashboard display, kernel snapshot feature gates and
isLatest checks working after the WebSocket handshake succeeds.

Also bump the recommended OpenClaw targets to the current npm latests:
- official: 2026.5.19
- chinese: 2026.5.18-zh.1

Verification:
- node --test tests/kernel.test.js
- npm run build
- manual module check: simulated both hello.server.version and legacy
  hello.serverVersion payloads, both report serverVersion and protocol v4
This commit is contained in:
晴天
2026-05-21 14:25:10 +08:00
parent 230b5e6dca
commit a50000a933
5 changed files with 10 additions and 8 deletions

View File

@@ -160,10 +160,12 @@ test('buildSnapshot edge case: version slightly below 5.6 feature requirement',
})
test('buildSnapshot.isLatest works against KERNEL_TARGET', () => {
const at_target = buildSnapshot('openclaw', '2026.5.6')
const at_target = buildSnapshot('openclaw', '2026.5.19')
const at_chinese_target = buildSnapshot('openclaw', '2026.5.18-zh.1')
const above_target = buildSnapshot('openclaw', '2026.6.0')
const below_target = buildSnapshot('openclaw', '2026.5.5')
const below_target = buildSnapshot('openclaw', '2026.5.18')
assert.equal(at_target.isLatest, true)
assert.equal(at_chinese_target.isLatest, true)
assert.equal(above_target.isLatest, true)
assert.equal(below_target.isLatest, false)
})