Commit Graph

11 Commits

Author SHA1 Message Date
晴天
7d75486a53 feat(gateway): surface negotiated handshake protocol version in UI
Users have reported confusion about "when will ClawPanel update its
gateway protocol to v4". This is actually a misreading: ClawPanel v0.15+
already advertises `minProtocol=3, maxProtocol=4` in its connect frame,
and negotiates v4 transparently when the kernel is >= 2026.5.12. The
`v3|` prefix users were seeing in dev-api.js is the device signature
payload string schema version, which is a completely separate concept
from the handshake protocol version.

Make this visible and unambiguous:

UI
- Add a "Proto v4" badge next to the Gateway service name in
  /services once the WS handshake succeeds, with a tooltip explaining
  that this is the WS handshake protocol version (not the device
  signature payload v3 format).
- Add the same protocol info to the WebSocket row in /chat-debug.

API
- WsClient now exposes `negotiatedProtocol` which prefers the explicit
  field from the hello payload (`protocol` / `protocolVersion` /
  `negotiatedProtocol`) and falls back to inferring from serverVersion:
  kernels >= 2026.5.12 are reported as v4, older as v3. This matches
  the panel's advertised range of [3, 4].
- KernelSnapshot grows a `protocol` field so feature gates and UIs that
  already consume the snapshot can read it without touching wsClient.

Comments
- Expand the KERNEL_TARGET comment in feature-catalog.js to spell out
  the two-distinct-version-numbers rule explicitly.
- Add matching clarifying comments next to the `v3|...` payload string
  in both scripts/dev-api.js and src-tauri/src/commands/device.rs, so
  the next reader does not confuse payload schema with handshake.

## Verification
- node --check on all touched JS files
- npm run build
- cargo fmt --check && cargo check (clippy errors that surface are
  pre-existing debt in config.rs, untouched here)
- Playwright /services: mock wsClient state, observe `协议 v4` badge
  rendered with `rgba(99, 102, 241, 0.1)` background and accent color,
  for both the explicit-protocol path and the version-inferred path.
2026-05-16 13:02:08 +08:00
晴天
8b690cb6a7 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
2026-05-15 18:30:04 +08:00
晴天
70d768be17 feat: new pages + dashboard enhancements + backend improvements
New pages:
- Plugin Hub: grid cards, search, install/toggle/enable plugins
- Route Map: SVG visualization of channels→agents bindings with legends
- Diagnose: gateway connectivity diagnosis with step-by-step checks

Dashboard enhancements:
- WebSocket status indicator (connected/handshaking/reconnecting/disconnected)
- Connected channels overview with platform icons
- Colored log level badges (ERROR/WARN/INFO/DEBUG) with timestamps
- Channels data loading in dashboard secondary fetch

Splash screen:
- Multi-stage boot detection (JS not loaded vs boot slow vs timeout)
- 15s: WebView2/resource load failure
- 20s: "initializing..." hint with elapsed counter
- 90s: true timeout error

Backend (Rust):
- diagnose.rs: gateway connectivity diagnosis command
- messaging.rs: plugin management commands
- service.rs: improvements
- lib.rs: register new commands

Frontend libs:
- feature-gates.js: feature flag system
- ws-client.js: reconnect state tracking
- tauri-api.js: new API bindings
- model-presets.js: provider fixes
- Remove gateway-guardian-policy.js (unused)

Dev API (scripts/dev-api.js):
- list_all_plugins, toggle_plugin, install_plugin handlers
- probe_gateway_port, diagnose_gateway_connection handlers

i18n: dashboard, sidebar, diagnose, extensions, routeMap locale modules
CSS: plugin-hub cards, route-map SVG styles
2026-04-11 00:44:06 +08:00
晴天
69160c06f4 feat: 兼容 OpenClaw v2026.3.7 (SecretRef token, caps tool-events, 认证错误处理, Gateway 可见终端) 2026-03-09 00:23:44 +08:00
晴天
80197bdc60 security: 修复命令注入/路径遍历漏洞 + 收紧 allowedOrigins + 审计日志 + OnceLock 缓存 2026-03-06 20:51:32 +08:00
晴天
a6e1f40a59 feat: image rendering, sidebar toggle, contribute section; fix: private repo update check; bump v0.2.1 2026-03-04 20:47:00 +08:00
晴天
73d7d6e7f5 fix: 修复 pairing required - 改用 openclaw-control-ui 客户端 ID 触发静默自动配对
上游源码分析发现根本原因:
- Gateway 的 shouldAllowSilentLocalPairing 需要 isControlUi=true
  才能在本地连接时静默自动批准设备配对
- 我们之前用 gateway-client+backend,isControlUi=false,加上
  Tauri WebView 会发 Origin 头(hasBrowserOriginHeader=true),
  导致 shouldAllowSilentLocalPairing 返回 false → 'pairing required'

修复内容:
- device.rs: client.id 改为 openclaw-control-ui,mode 改为 ui,
  v3 签名 payload 同步更新,本地连接触发静默自动配对
- pairing.rs: paired.json 的 clientId/clientMode 同步更新
- main.js: 启动时自动调用 autoPairDevice(),确保 device 已配对
  + allowedOrigins 已写入,无需用户手动点击一键修复
2026-03-04 14:39:48 +08:00
晴天
c096ba143c fix: 修复 CI 编译错误与 Clippy 警告
- service.rs: macOS platform impl 是同步 fn,用 #[cfg] 在 caller 处区分,避免 .await 类型不匹配
- config.rs: macOS detect_installed_source read_link 失败时无 fallback,补充 return official
- config.rs: clippy::manual_strip,&path[2..] 改用 strip_prefix
- device.rs: clippy::needless_borrow,&pub_bytes 去掉多余引用
- device.rs: clippy::manual_is_multiple_of,% 2 != 0 改用 .is_multiple_of(2)
- logs.rs: clippy::manual_arithmetic_check,if/else 改用 saturating_sub
2026-03-04 12:31:19 +08:00
晴天
7cd6bb9b1b style: cargo fmt 格式化 Rust 代码,修复 CI 格式检查失败 2026-03-04 12:20:59 +08:00
晴天
dab61ccd24 fix: 修复多项关键 Bug,与 openclaw 上游协议对齐
- main.js: wsClient.connect 传参格式错误(完整 ws:// URL → host:port)
- ws-client.js: request() 等待重连时不处理 onReady 握手失败
- gateway.js: bind 写入非法值 'all',改为 openclaw 合法值 'lan'
- device.rs: connect payload 从 v2 升级到 v3,补充 platform/deviceFamily
- config.rs: macOS reload_gateway 在 async fn 中用同步 Command 阻塞 tokio
- service.rs: Windows check_service_status 端口硬编码 18789,改为读配置
- extensions.rs: parse_cftunnel_status 全角冒号解析失败,添加 split_after_colon
- tauri-api.js: cachedInvoke miss 时 logRequest 被记录两次
- tauri-api.js: mock 补充 list_agents / restart_gateway
- chat.js: 附件对象冗余 data 字段(双倍内存)+ 缩进修复
- services.js: 服务操作缺少操作中 toast 反馈
2026-03-04 12:16:58 +08:00
晴天
3705ab8081 feat: 聊天页面 + Agent 管理 + 模型排序固化 + 多项增强
- 新增聊天页面(WebSocket 实时通信、会话管理、Markdown 渲染)
- 新增 Agent 管理页面(CRUD、备份、工作区配置、模型选择)
- 新增设备认证模块(Ed25519 签名)
- 模型排序固化到配置文件(拖拽排序 + 下拉排序均写入底层数据)
- 记忆文件页面支持 Agent 切换
- Gateway 配置页重构为选项卡片布局
- 页面路由加载动画
- 批量测试支持终止、实时刷新卡片
- 服务管理备份说明文案
- Modal 组件支持 readonly 字段
- 脱敏 mock 数据中的内部地址
2026-03-01 12:19:21 +08:00