openclaw-navigator 5.7.6 → 5.7.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.
Files changed (2) hide show
  1. package/cli.mjs +7 -31
  2. package/package.json +1 -1
package/cli.mjs CHANGED
@@ -1613,39 +1613,15 @@ function handleRequest(req, res) {
1613
1613
  return;
1614
1614
  }
1615
1615
 
1616
- // ── SSE passthrough for streaming endpoints (/api/chat) ────────────
1617
- // Pass SSE through as-isthe web UI frontend handles SSE natively.
1618
- // Disable response buffering so each SSE event reaches the client immediately.
1616
+ // ── SSE for streaming endpoints (/api/chat) ──────────────────────
1617
+ // DO NOT transform SSEpipe raw bytes through untouched.
1618
+ // The web UI works fine hitting port 4000 directly; any transformation
1619
+ // we add (SSE→JSON, SSE→NDJSON, setEncoding) breaks the frontend parser.
1620
+ // Raw binary pipe preserves the exact chunking the BFF sends.
1619
1621
  if (isSSE && isStreamingEndpoint) {
1620
- console.log(` ${DIM}SSE passthrough: ${path}${RESET}`);
1621
-
1622
- // Ensure SSE headers are clean for the browser
1623
- headers["cache-control"] = "no-cache";
1624
- headers["connection"] = "keep-alive";
1625
- // Keep content-type as text/event-stream
1626
- delete headers["content-length"]; // SSE is chunked
1627
-
1622
+ console.log(` ${DIM}SSE raw pipe: ${path}${RESET}`);
1628
1623
  res.writeHead(proxyRes.statusCode ?? 200, headers);
1629
-
1630
- // Disable buffering at every layer
1631
- if (res.socket) res.socket.setNoDelay(true);
1632
-
1633
- // Pipe SSE events directly — no transformation
1634
- proxyRes.on("data", (chunk) => {
1635
- res.write(chunk);
1636
- // Flush after each chunk to prevent TCP buffering
1637
- if (typeof res.flush === "function") res.flush();
1638
- });
1639
-
1640
- proxyRes.on("end", () => {
1641
- res.end();
1642
- console.log(` ${GREEN}✓${RESET} SSE stream completed for ${path}`);
1643
- });
1644
-
1645
- proxyRes.on("error", (err) => {
1646
- console.log(` ${DIM}SSE stream error: ${err.message}${RESET}`);
1647
- sendJSON(res, 502, { ok: false, error: "Stream error" });
1648
- });
1624
+ proxyRes.pipe(res, { end: true });
1649
1625
  return;
1650
1626
  }
1651
1627
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-navigator",
3
- "version": "5.7.6",
3
+ "version": "5.7.8",
4
4
  "description": "One-command bridge + tunnel for the Navigator browser — works on any machine, any OS",
5
5
  "keywords": [
6
6
  "browser",