Add attention inbox and AI usage observability
This commit is contained in:
1 parent
ca59ba0f1f
commit
83b5f1f5b6
30 files changed
+702
-28
No files matched your search
@@ -70,4 +70,17 @@ describe('DeliveryOutboxRepository', () => {
|
||||
expect(outbox.markSent(delivery.id, 'worker-a', sentMessageId, 130)).toBe(true);
|
||||
expect(outbox.get(delivery.id)).toMatchObject({ status: 'sent', sentMessageId, leaseOwner: null });
|
||||
});
|
||||
|
||||
it('surfaces failed deliveries for the attention inbox', () => {
|
||||
const delivery = outbox.discover({
|
||||
postId: 'post-1', recipient: 'recipient', subject: 'subject', message: 'message', idempotencyKey: 'post-1:v1', now: 100,
|
||||
});
|
||||
outbox.markPrepared(delivery.id, 110);
|
||||
outbox.claim(delivery.id, 'worker-a', 50, 120);
|
||||
outbox.markFailed(delivery.id, 'worker-a', 'Reddit rejected the invitation', 130);
|
||||
|
||||
expect(outbox.getFailed()).toEqual([
|
||||
expect.objectContaining({ id: delivery.id, status: 'failed', lastError: 'Reddit rejected the invitation' }),
|
||||
]);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user