fix: use work items as dashboard outbound SSOT

This commit is contained in:
ejclaw
2026-04-29 01:23:29 +09:00
parent 9655501bdf
commit 6b2ef42374
14 changed files with 523 additions and 81 deletions

View File

@@ -102,22 +102,20 @@ export async function deliverOpenWorkItem(args: {
}),
'Attempting to deliver produced work item as a new message',
);
if (hasAttachments) {
await args.channel.sendMessage(
args.item.chat_jid,
args.item.result_payload,
{
attachmentBaseDirs: args.attachmentBaseDirs,
attachments,
},
);
} else {
await args.channel.sendMessage(
args.item.chat_jid,
args.item.result_payload,
);
}
markWorkItemDelivered(args.item.id);
const sendResult = hasAttachments
? await args.channel.sendMessage(
args.item.chat_jid,
args.item.result_payload,
{
attachmentBaseDirs: args.attachmentBaseDirs,
attachments,
},
)
: await args.channel.sendMessage(
args.item.chat_jid,
args.item.result_payload,
);
markWorkItemDelivered(args.item.id, sendResult?.primaryMessageId ?? null);
args.openContinuation(args.item.chat_jid);
args.log.info(
buildDeliveryLogContext(args.channel, args.item, {