a2ui-project / a2ui-project/a2ui

Error handling: require handler for abnormal finalization and use the handler in example apps.

オープン
#1,860 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
a: api-simplicity component: genui P2 status: first-line-handled
主要言語
TypeScript
スター
16.4k
フォーク
1.3k
平均マージ
2日 13時間
マージ済み PR(30日)
134

説明

_↴ Ported from [flutter/genui#740](https://github.com/flutter/genui/issues/740) — originally opened by [polina-c](https://github.com/polina-c) on 2026-02-20._
_Original labels: P2, front-line-handled, a: api-simplicity_

---

Developer of the app should be enforced to handle not-successfull cycle.

## Expected behavior

Normal cycle:
- user sends message
- AI responds with one or more responses. The last response should be marked final by AI.

If something unexpected happened, application should:
1. Show nice message to user
2. Report technical details of the issue to the team via logs or other mechanism, if allowed by user

To make it easy for developer not to miss this handling, SDK should require to provide handler for abnormal finalization.

ai_primitives support finalization communication: https://github.com/flutter/genui/issues/696

dartantic_ai most likely does not support it yet (should we create issue for them?)

In addition, non-critical issues (like not respecting schema or providing not-unique id) should be discoverable and easy communicate for logging and telemetry.

## Actual behaviour

If there are issues, simple chat example shows nothing to user and just logs the issue:

```
flutter: FINE: 2026-02-19 20:58:36.766807: Attempt 4/4 for POST https://generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:streamGenerateContent?alt=sse
flutter: WARNING: 2026-02-19 20:58:36.780738: HTTP error retry exhausted after 3 attempts for POST https://generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:streamGenerateContent?alt=sse: ClientException with SocketException: Connection failed (OS Error: Operation not permitted, errno = 1), address = generativelanguage.googleapis.com, port = 443, uri=https://generativelanguage.googleapis.com/v1beta/models/gemini-3-flash-preview:streamGenerateContent?alt=sse
flutter: FINE: 2026-02-19 20:58:36.781240: Finalizing streaming orchestrator
flutter: SEVERE: 2026-02-19 20:58:36.781372: Error generating content
```

---

### 2 comment(s) from the original issue

**[polina-c](https://github.com/polina-c)** commented on 2026-02-20:

@gspencergoog FYI

---

**[polina-c](https://github.com/polina-c)** commented on 2026-02-21:

The mechanism should work well with failures of all types:
- LLM-request issue
- Parsing issue
- Renderong issue

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Look at the SDK's error handling in the streaming orchestrator and finalization logic. The example apps likely need to be updated to include a mandatory handler for abnormal finalization. Start by examining the existing chat example to see where errors are currently logged, then find where the SDK enforces or should enforce a handler. Check for related issues about ai_primitives support for finalization communication.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
backend-api-design
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
55/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。