Client tools never execute against spec-compliant AG-UI servers (plain `success` RUN_FINISHED)
Los mantenedores suelen responder en 1 día
Evaluación
Este issue todavía no se ha evaluado.
Descripción
TanStack AI version
0.54
Framework/Library version
React 19
Describe the bug and the steps to reproduce it
What happens
When useChat is connected to a third-party AG-UI server (Pydantic AI's AGUIAdapter in my case), the model calls a registered .client() tool, the tool call is rendered, and then the run just ends. The .client() handler is never invoked and no continuation run is started.
The server emits the canonical AG-UI sequence for a frontend tool:
TOOL_CALL_START { toolCallId: "tooluse_…", toolCallName: "ping" }
TOOL_CALL_ARGS { delta: "" }
TOOL_CALL_END
RUN_FINISHED { outcome: { type: "success" } }
Why
Client-tool execution is only triggered from StreamProcessor.handleInterrupts (activities/chat/stream/processor.ts), i.e. when RUN_FINISHED carries outcome.type: "interrupt" with a metadata.kind: "client_tool" interrupt. That's the shape TanStack's own chat() emits, but it isn't what AG-UI specifies.
Per ag-ui-protocol/ag-ui#2731, a frontend tool call ends the run with a plain success outcome. It may include pendingToolCallIds; otherwise the client derives the unanswered calls from the stream. The client then executes the tools and continues with role: "tool" messages in the next run's history. There is no success-outcome path that calls onToolCall, so nothing fires.
Expected
On a success RUN_FINISHED, the client should dispatch onToolCall for tool calls that were started but not answered by TOOL_CALL_RESULT, using outcome.pendingToolCallIds when present. The rest of the pipeline already exists (pendingToolExecutions, addToolResultForClientTool, continuation). The interrupt path would stay unchanged.
Repro
- Pydantic AI agent exposed via
AGUIAdapter, no server-sidepingtool. useChat({ connection: fetchServerSentEvents(url), tools: [pingDef.client(() => 'pong')] })- Ask the agent to call
pingand report the result → handler never runs, conversation stops.
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
_
Screenshots or Videos (Optional)
No response
Do you intend to try to help solve this bug with your own PR?
None
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
- Lenguaje dominante
- TypeScript
- Estrellas
- 3.2k
- Forks
- 361
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 266
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TanStack/ai
-
Discriminate status-dependent record and option types (RunRecord, SessionIndexEntry, InputState, durable-only options)Posiblemente ocupada @jherr la tomó hoy. Abiertoenhancement waiting-on: maintainer
TanStack/ai#1799 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
ai-harness: an input with no principal runs with the owner session's principalPosiblemente ocupada @tombeckenham la tomó hace 1 día. Abiertowaiting-on: maintainer
TanStack/ai#1797 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
ai-harness: a forwarded command completes with no result, also when the owner rejects itPosiblemente ocupada @tombeckenham la tomó hace 1 día. Abiertowaiting-on: maintainer
TanStack/ai#1796 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
ai-harness: recovery runs a turn without the user message when the turn never startedPosiblemente ocupada @tombeckenham la tomó hace 1 día. Abiertowaiting-on: maintainer
TanStack/ai#1795 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
ai-mcp: modern tool calls omit x-mcp-header parameter headers in 0.9.0Posiblemente ocupada @tombeckenham la tomó hace 1 día. Abiertowaiting-on: maintainer
Dificultad 4/5 3-5 días Aptitud para principiantes 32/100
TanStack/ai#1794 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de TanStack/ai
Issues similares
-
bnv-manager-v2: accept_invite creates the Mailcow domain admin before the commitPosiblemente ocupada @myOmikron la tomó hoy. Abiertobug ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
Windows: mio 1.2.3 named-pipe use-after-free panics the native IPC broker and hangs every toolAbiertoplatform:windows tool triaged wontfix
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
nicolettas-muggelbude/RechnungsFee#448 ·
Los mantenedores suelen responder en 1 día
-
Android bug feature/error-tracking react-native team/error-tracking
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
PostHog/posthog-js#5310 · 1 comentario ·
Los mantenedores suelen responder en 1 día