mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-01-23 18:07:34 +00:00
fix: API would be stringified twice. That is now fixed.
This commit is contained in:
@@ -360,12 +360,12 @@ export function getActiveCodexSessions() {
|
||||
*/
|
||||
function sendMessage(ws, data) {
|
||||
try {
|
||||
if (typeof ws.send === 'function') {
|
||||
// WebSocket
|
||||
if (ws.isSSEStreamWriter || ws.isWebSocketWriter) {
|
||||
// Writer handles stringification (SSEStreamWriter or WebSocketWriter)
|
||||
ws.send(data);
|
||||
} else if (typeof ws.send === 'function') {
|
||||
// Raw WebSocket - stringify here
|
||||
ws.send(JSON.stringify(data));
|
||||
} else if (typeof ws.write === 'function') {
|
||||
// SSE writer (for agent API)
|
||||
ws.write(`data: ${JSON.stringify(data)}\n\n`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('[Codex] Error sending message:', error);
|
||||
|
||||
Reference in New Issue
Block a user