@eyeclaw/eyeclaw 2.3.6 → 2.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eyeclaw/eyeclaw",
3
- "version": "2.3.6",
3
+ "version": "2.3.8",
4
4
  "description": "EyeClaw plugin for OpenClaw - HTTP SSE streaming + WebSocket client",
5
5
  "type": "module",
6
6
  "main": "./index.ts",
@@ -152,6 +152,8 @@ export function createHttpHandler(api: OpenClawPluginApi, getConfig: () => EyeCl
152
152
  const chunk = JSON.parse(data)
153
153
  const content = chunk.choices?.[0]?.delta?.content
154
154
  if (content) {
155
+ const timestamp = new Date().toISOString();
156
+ logger.info(`[EyeClaw] [${timestamp}] SSE chunk: "${content}"`);
155
157
  res.write(formatSSE('stream_chunk', { stream_id: currentStreamId, content }))
156
158
  }
157
159
  } catch { /* ignore */ }
@@ -231,7 +231,11 @@ export class EyeClawWebSocketClient {
231
231
  // 解析 SSE 流式响应
232
232
  while (true) {
233
233
  const { done, value } = await reader.read()
234
- if (done) break
234
+ if (done) {
235
+ // 流结束,通知 Rails
236
+ this.sendMessage('stream_end', { session_id: sessionId })
237
+ break
238
+ }
235
239
 
236
240
  buffer += decoder.decode(value, { stream: true })
237
241
  const lines = buffer.split('\n')
@@ -306,6 +310,8 @@ export class EyeClawWebSocketClient {
306
310
  * 发送流式内容块到 Rails
307
311
  */
308
312
  private sendChunk(content: string, sessionId?: string) {
313
+ const timestamp = new Date().toISOString();
314
+ this.api.logger.info(`[EyeClaw] [${timestamp}] Sending chunk to Rails: "${content}"`);
309
315
  this.sendMessage('stream_chunk', {
310
316
  content,
311
317
  session_id: sessionId,