mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-26 00:46:23 +02:00
feat(ui): surface LLM stream errors in chat
Add a stream error event type to the shared schema and wire runtime handling to convert provider payloads into a concise string format. When a stream error is seen, emit a Run error event, preserve partial output, and stop the turn to avoid additional tool execution. In the renderer, display errors inline as assistant messages with destructive styling and trigger a toast for immediate visibility. Include error events when loading run history so prior failures are visible.
This commit is contained in:
parent
11245660fb
commit
e1d50c62da
4 changed files with 111 additions and 4 deletions
|
|
@ -51,6 +51,11 @@ export const LlmStepStreamFinishStepEvent = z.object({
|
|||
providerOptions: ProviderOptions.optional(),
|
||||
});
|
||||
|
||||
export const LlmStepStreamErrorEvent = BaseEvent.extend({
|
||||
type: z.literal("error"),
|
||||
error: z.string(),
|
||||
});
|
||||
|
||||
export const LlmStepStreamEvent = z.union([
|
||||
LlmStepStreamReasoningStartEvent,
|
||||
LlmStepStreamReasoningDeltaEvent,
|
||||
|
|
@ -60,4 +65,5 @@ export const LlmStepStreamEvent = z.union([
|
|||
LlmStepStreamTextEndEvent,
|
||||
LlmStepStreamToolCallEvent,
|
||||
LlmStepStreamFinishStepEvent,
|
||||
]);
|
||||
LlmStepStreamErrorEvent,
|
||||
]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue