ag-ui-protocol / ag-ui-protocol/ag-ui

HttpAgent: non-OK HTTP response throws inside the rxjs pipeline with no catch — runAgent consumers never see the failure

Aperta
#2,329 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
15.9k
Fork
1.4k
Merge medio
1g 17h
PR unite (30g)
163

Descrizione

## Context

Same production evaluation as #2327 (`@ag-ui/client@0.0.57`, `@ag-ui/core@0.0.57`, consumed through `@assistant-ui/react-ag-ui@0.0.50`).

## Finding

When the agent endpoint answers a non-OK HTTP status, `HttpAgent` throws from inside its rxjs pipeline. There is no catch on that path, so:

- the error surfaces as an **unhandled promise rejection**, not through any callback the consumer registered;
- `useAgUiRuntime`'s `onError` never fires;
- the run never settles — from the UI's point of view the turn neither finished nor failed (dead composer, no user-visible failure state);
- error reporting hooks (Sentry etc.) attached to the runtime see nothing.

Combined with the RUN_ERROR/RUN_CANCELLED semantics in #2327, there is currently no reliable channel by which a consumer learns "this run failed at the transport level."

## Interim we ship

A custom `fetch` (already required for cookie credentials, see #2327 item 3) that converts a non-OK response into a coded `RUN_ERROR` event stream, so the run settles honestly through the normal event channel.

## Ask

Catch transport-level failures inside `HttpAgent` and emit them as `RUN_ERROR` (or reject `runAgent` with a typed error) so consumers get exactly one failure channel. An unhandled rejection from a library pipeline is not consumable.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.