Improve workflow error messaging

This commit is contained in:
2026-03-09 23:51:37 -04:00
parent fa2de3e259
commit f2c25fb9c6
11 changed files with 272 additions and 41 deletions

View File

@@ -99,9 +99,9 @@ describe('task notification builder', () => {
const notification = buildTaskNotification(baseTask({
task_type: 'analyze_filing',
status: 'failed',
stage: 'failed',
stage_detail: 'Primary filing document fetch failed.',
error: 'Primary filing document fetch failed.',
stage: 'analyze.fetch_document',
stage_detail: 'Could not load the primary filing document.',
error: 'Could not load the primary filing document for AAPL · 0000320193-26-000001. Retry the job after confirming the SEC source is reachable.',
stage_context: {
subject: {
ticker: 'AAPL',
@@ -116,7 +116,8 @@ describe('task notification builder', () => {
}));
expect(notification.tone).toBe('error');
expect(notification.detailLine).toBe('Primary filing document fetch failed.');
expect(notification.statusLine).toBe('Failed during fetch primary document');
expect(notification.detailLine).toBe('Could not load the primary filing document.');
expect(notification.actions.some((action) => action.id === 'open_filings')).toBe(true);
});
});