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

[Bug]: [langgraph/typescript] Trailing content on finish_reason chunks is silently dropped

Đang mở
#2,006 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug Integration
Ngôn ngữ chính
Python
Star
15.9k
Fork
1.4k
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
163

Mô tả

## Description

The TypeScript `OnChatModelStream` handler has an early return at the top of the case:

```ts
// integrations/langgraph/typescript/src/agent.ts
if (event.data.chunk.response_metadata.finish_reason) return;
```

Some providers (e.g. OpenAI, Ollama) set `finish_reason: "stop"` on the same chunk that also carries a final content delta or tool-arg delta. The early return silently drops that payload before it can be emitted.

`OnChatModelEnd` already handles final stream flushing, so this guard provides no value.

## Reproducer

```ts
// chunk: { content: "final words", response_metadata: { finish_reason: "stop" } }
// Actual: no events emitted
// Expected: TEXT_MESSAGE_START + TEXT_MESSAGE_CONTENT
```

## Affected component

`integrations/langgraph/typescript`

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.