Support status-prefixed structured attachments

Support status-prefixed structured attachment output and keep visible verdict text.
This commit is contained in:
Eyejoker
2026-05-02 19:22:55 +09:00
committed by GitHub
parent fb32726ac0
commit 9e45534de0
4 changed files with 151 additions and 3 deletions

View File

@@ -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({