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

Zod Validation error when streaming MCP tool calls from Langgraph Agent

オープン
#994 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug Integration
主要言語
Python
スター
15.9k
フォーク
1.4k
平均マージ
1日 17時間
マージ済み PR(30日)
163

説明

Hi Team,

I'm getting these Zod Validation errors when streaming tool calls via the @ag-ui/client & @ag-ui/core npm packages.

This specifically happens when the Langgraph Agent is leveraging tools of an MCP Server,

Attaching my npm packages - I believe they're all the latest

```
"@ag-ui/client": "^0.0.43",
"@ag-ui/langgraph": "^0.0.22",
"@copilotkit/react-core": "^1.50.1",
"@copilotkit/react-ui": "^1.50.1",
"@copilotkit/runtime": "^1.50.1",
"@copilotkit/runtime-client-gql": "^1.50.1",
"@copilotkit/shared": "^1.50.1",
"@copilotkitnext/agent": "^0.0.33",
"@copilotkitnext/core": "^0.0.33",
"@copilotkitnext/react": "^0.0.33",
"@copilotkitnext/runtime": "^0.0.33",
```

And my error that I see in the NextJS Frontend

```
Console ZodError

[
{
"code": "invalid_type",
"expected": "string",
"received": "undefined",
"path": [
"toolCallId"
],
"message": "Required"
},
{
"code": "invalid_type",
"expected": "string",
"received": "undefined",
"path": [
"content"
],
"message": "Required"
}
]

Call Stack
26

Hide 26 ignore-listed frame(s)
get error
node_modules/@ag-ui/core/node_modules/zod/v3/types.js (39:1)
ZodDiscriminatedUnion.parse
node_modules/@ag-ui/core/node_modules/zod/v3/types.js (114:1)
Object.next
node_modules/@ag-ui/client/dist/index.mjs (6:1180)
ConsumerObserver.next
../src/internal/Subscriber.ts (161:25)
Subscriber._next
../src/internal/Subscriber.ts (119:22)
Subscriber.next
../src/internal/Subscriber.ts (75:12)
eval
../src/internal/Subject.ts (68:20)
errorContext
../src/internal/util/errorContext.ts (29:5)
Subject.next
../src/internal/Subject.ts (61:17)
t
node_modules/@ag-ui/client/dist/index.mjs (6:20)
Object.next
node_modules/@ag-ui/client/dist/index.mjs (4:9158)
ConsumerObserver.next
../src/internal/Subscriber.ts (161:25)
Subscriber._next
../src/internal/Subscriber.ts (119:22)
Subscriber.next
../src/internal/Subscriber.ts (75:12)
eval
../src/internal/Subject.ts (68:20)
errorContext
../src/internal/util/errorContext.ts (29:5)
Subject.next
../src/internal/Subject.ts (61:17)
ReplaySubject.next
../src/internal/ReplaySubject.ts (65:15)
Object.next
node_modules/@ag-ui/client/dist/index.mjs (6:969)
ConsumerObserver.next
../src/internal/Subscriber.ts (161:25)
Subscriber._next
../src/internal/Subscriber.ts (119:22)
Subscriber.next
../src/internal/Subscriber.ts (75:12)
eval
../src/internal/operators/switchMap.ts (115:42)
OperatorSubscriber._this._next
../src/internal/operators/OperatorSubscriber.ts (70:13)
Subscriber.next
../src/internal/Subscriber.ts (75:12)
eval
node_modules/@ag-ui/client/dist/index.mjs (4:8724)
```

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

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

評価

この issue はまだ評価されていません。

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

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