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

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

Offen
#2,006 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug Integration
Vorherrschende Sprache
Python
Sterne
15.9k
Forks
1.4k
Ø Merge
1 T. 17 Std.
Gemergte PRs (30 T.)
163

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.