mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-08 07:17:39 +00:00
fix(cursor): surface agent errors with warning styling in web UI (#871)
* test: reproduce issue #864 Assert Cursor error paths emit agent error payloads and web UI renders them as warning-styled events instead of neutral session messages. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(cursor): surface agent errors with warning styling in web UI (closes #864) Route Cursor stderr, init, prompt, and legacy exit failures through sendAgentMessage({ type: 'error' }) and teach the web chat layer to render error events with a warning icon instead of neutral info text. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -182,6 +182,9 @@ export function getEventPresentation(event: AgentEvent): EventPresentation {
|
||||
const suffix = typeLabel ? ` (${typeLabel})` : ''
|
||||
return { icon: '⏳', text: endsAt ? `Usage limit reached${suffix} until ${formatUnixTimestamp(endsAt)}` : `Usage limit reached${suffix}` }
|
||||
}
|
||||
if (event.type === 'error') {
|
||||
return { icon: '⚠️', text: typeof event.message === 'string' ? event.message : 'Error' }
|
||||
}
|
||||
if (event.type === 'message') {
|
||||
return { icon: null, text: typeof event.message === 'string' ? event.message : 'Message' }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user