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

未关闭
#2,329 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
15.9k
派生
1.4k
平均合并
1 天 17 小时
30 天内合并 PR
163

描述

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

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。