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

Ouverte
#2,329 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
15.9k
Forks
1.4k
Merge moyen
1 j 17 h
PR mergées (30 j)
163

Description

## 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.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.