feat: 添加 OpenClaw 详细连接日志
- 连接建立时显示就绪状态 - 主动发送 connect 请求(不等待 challenge) - 发送消息前显示日志 - 为后续更详细日志做准备
This commit is contained in:
@@ -343,14 +343,16 @@ class OpenClawConnection {
|
|||||||
this.socket.on('open', () => {
|
this.socket.on('open', () => {
|
||||||
this.isConnected = true;
|
this.isConnected = true;
|
||||||
this.reconnectAttempts = 0;
|
this.reconnectAttempts = 0;
|
||||||
console.log('[OpenClaw] WebSocket connected, waiting for challenge...');
|
console.log('[OpenClaw] ✅ WebSocket 连接已建立'); console.log('[OpenClaw] 就绪状态:', this.socket.readyState, '(1=OPEN)');
|
||||||
|
|
||||||
// 检查窗口是否存在
|
// 检查窗口是否存在
|
||||||
if (mainWindow && !mainWindow.isDestroyed()) {
|
if (mainWindow && !mainWindow.isDestroyed()) {
|
||||||
this.eventHandler('connected');
|
this.eventHandler('connected');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 注意:不立即发送 connect,等待服务器发送 connect.challenge 后再响应
|
// 主动发送 connect 请求
|
||||||
|
console.log('[OpenClaw] 📤 发送 connect 请求...');
|
||||||
|
this.sendConnect();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.socket.on('message', (data) => {
|
this.socket.on('message', (data) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user