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

Zod Validation error when streaming MCP tool calls from Langgraph Agent

Abierto
#994 2 comentarios 0 reacciones 0 asignados Ver en GitHub
bug Integration
Lenguaje dominante
Python
Estrellas
15.9k
Forks
1.4k
Merge medio
1 d 17 h
PR fusionados (30 d)
163

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.