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:
SSU-WEI HUANG
2026-06-18 10:17:57 +08:00
committed by GitHub
co-authored by Cursor
parent bfd0f4a376
commit 02a0aa6733
13 changed files with 149 additions and 24 deletions
+3
View File
@@ -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' }
}