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

@@ -156,6 +156,45 @@ describe('shared agent protocol helpers', () => {
});
});
it('parses status-prefixed fenced public ejclaw attachments', () => {
expect(
normalizeEjclawStructuredOutput(`TASK_DONE
\`\`\`json
{
"ejclaw": {
"visibility": "public",
"text": "이미지를 첨부했습니다.",
"verdict": "done",
"attachments": [
{
"path": "/tmp/ejclaw-discord-image-status.png",
"name": "status.png",
"mime": "image/png"
}
]
}
}
\`\`\``),
).toEqual({
result: 'TASK_DONE\n\n이미지를 첨부했습니다.',
output: {
visibility: 'public',
text: 'TASK_DONE\n\n이미지를 첨부했습니다.',
verdict: 'done',
attachments: [
{
path: '/tmp/ejclaw-discord-image-status.png',
name: 'status.png',
mime: 'image/png',
},
],
},
});
});
});
describe('shared agent protocol fallback behavior', () => {
it('parses in_progress public envelopes instead of leaking raw structured JSON', () => {
const raw = JSON.stringify({
ejclaw: {