openclaw-navigator 5.7.8 → 5.7.9
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/cli.mjs +17 -6
- package/package.json +1 -1
package/cli.mjs
CHANGED
|
@@ -1614,14 +1614,25 @@ function handleRequest(req, res) {
|
|
|
1614
1614
|
}
|
|
1615
1615
|
|
|
1616
1616
|
// ── SSE for streaming endpoints (/api/chat) ──────────────────────
|
|
1617
|
-
//
|
|
1618
|
-
// The
|
|
1619
|
-
//
|
|
1620
|
-
// Raw binary pipe preserves the exact chunking the BFF sends.
|
|
1617
|
+
// Log the first chunk to see what the BFF actually sends (once per request).
|
|
1618
|
+
// Then pipe raw. The frontend's JSON parse error on "data: ..." suggests it
|
|
1619
|
+
// doesn't handle SSE format — log what's actually happening.
|
|
1621
1620
|
if (isSSE && isStreamingEndpoint) {
|
|
1622
|
-
|
|
1621
|
+
let logged = false;
|
|
1623
1622
|
res.writeHead(proxyRes.statusCode ?? 200, headers);
|
|
1624
|
-
proxyRes.
|
|
1623
|
+
proxyRes.on("data", (chunk) => {
|
|
1624
|
+
if (!logged) {
|
|
1625
|
+
const preview = (typeof chunk === "string" ? chunk : chunk.toString("utf-8")).substring(0, 300);
|
|
1626
|
+
console.log(` ${DIM}SSE first chunk (${chunk.length} bytes): ${preview.replace(/\n/g, "\\n")}${RESET}`);
|
|
1627
|
+
logged = true;
|
|
1628
|
+
}
|
|
1629
|
+
res.write(chunk);
|
|
1630
|
+
});
|
|
1631
|
+
proxyRes.on("end", () => {
|
|
1632
|
+
res.end();
|
|
1633
|
+
console.log(` ${GREEN}✓${RESET} SSE stream completed for ${path}`);
|
|
1634
|
+
});
|
|
1635
|
+
proxyRes.on("error", () => res.end());
|
|
1625
1636
|
return;
|
|
1626
1637
|
}
|
|
1627
1638
|
|