mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
feat: add api-error event support with folding for retry messages
Introduces support for displaying API error system messages in the web UI with automatic folding of consecutive retry messages to show only the latest state.
This commit is contained in:
@@ -216,6 +216,22 @@ export function normalizeAgentRecord(
|
||||
meta
|
||||
}
|
||||
}
|
||||
if (data.type === 'system' && data.subtype === 'api_error') {
|
||||
return {
|
||||
id: messageId,
|
||||
localId,
|
||||
createdAt,
|
||||
role: 'event',
|
||||
content: {
|
||||
type: 'api-error',
|
||||
retryAttempt: asNumber(data.retryAttempt) ?? 0,
|
||||
maxRetries: asNumber(data.maxRetries) ?? 0,
|
||||
error: data.error
|
||||
},
|
||||
isSidechain: false,
|
||||
meta
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user