fix(gateway): extract content from payload in received messages

Display payload.content instead of raw JSON when the payload
is an object with a content field.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
yushen 2026-01-30 14:46:30 +08:00
parent 7775ba5ca9
commit d9ba793fee

View file

@ -674,7 +674,8 @@
});
socket.on('receive', (msg) => {
const content = typeof msg.payload === 'string' ? msg.payload : JSON.stringify(msg.payload);
const p = msg.payload;
const content = typeof p === 'string' ? p : (p && p.content ? p.content : JSON.stringify(p));
appendMsg('in', content, msg.from);
});