Support status-prefixed structured attachments
Support status-prefixed structured attachment output and keep visible verdict text.
This commit is contained in:
@@ -75,6 +75,34 @@ describe('agent runner IPC message payload', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('normalizes status-prefixed EJClaw envelopes and preserves attachments', () => {
|
||||
expect(
|
||||
buildSendMessageIpcPayload({
|
||||
chatJid: 'dc:123',
|
||||
text: `TASK_DONE
|
||||
|
||||
\`\`\`json
|
||||
{"ejclaw":{"visibility":"public","text":"첨부했습니다.","verdict":"done","attachments":[{"path":"/tmp/ejclaw-status.png","name":"status.png","mime":"image/png"}]}}
|
||||
\`\`\``,
|
||||
groupFolder: 'discord-review',
|
||||
timestamp: '2026-04-04T13:45:00.000Z',
|
||||
}),
|
||||
).toEqual({
|
||||
type: 'message',
|
||||
chatJid: 'dc:123',
|
||||
text: 'TASK_DONE\n\n첨부했습니다.',
|
||||
groupFolder: 'discord-review',
|
||||
timestamp: '2026-04-04T13:45:00.000Z',
|
||||
attachments: [
|
||||
{
|
||||
path: '/tmp/ejclaw-status.png',
|
||||
name: 'status.png',
|
||||
mime: 'image/png',
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
it('turns silent EJClaw envelopes into empty no-op messages', () => {
|
||||
expect(
|
||||
buildSendMessageIpcPayload({
|
||||
|
||||
Reference in New Issue
Block a user