assistant-ui icon indicating copy to clipboard operation
assistant-ui copied to clipboard

AI SDK v5 Agent terminates prematurely after using frontendTools

Open upwindchange opened this issue 11 months ago • 3 comments

    "@assistant-ui/react": "0.11.47",
    "@assistant-ui/react-ai-sdk": "^1.1.16",
    "@assistant-ui/react-markdown": "^0.11.6",
    "@assistant-ui/react-ui": "^0.2.1",

It seems that the result of frontendTools is never passed back into backend agent. And the agent will terminate immediately after using tools defined using frontendTools.

upwindchange avatar Dec 10 '25 11:12 upwindchange

I am facing the same issue both with an agent flow (AI SDK v6) and a simple streamText call. @upwindchange have you been able to find any workaround?

wh1t3cAt1k avatar Dec 16 '25 22:12 wh1t3cAt1k

Hi @wh1t3cAt1k , here is my guess according to my observation:

  1. The team is doing a huge scale rewrite from version 0.11 to 0.12.
  2. Many things broke during rewrite without being depreciated slowly.
  3. FrontendTools is just one of them. The human-in-the-loop capability is not working at all since it depends on successful FrontendTools usage as well. UseLocalRuntime also gets broken, I can name many more broken things, literally...
  • Currently the best way out is wait for the rewrite to be done and 0.12 to be released, hopefully things will get fixed.
  • Another way is to implement everything manually by your self: only usemakeAssistantToolUI to make UI, implement all the communication logic, frontend~backend communication yourself. Do not rely on their implementation of front end tool, avoid using useAssistantTool, makeAssistantTool or human in the loop if you are not confident on the stability of these features.

upwindchange avatar Dec 16 '25 22:12 upwindchange

Hi @wh1t3cAt1k , I resolved the issue using methods mentioned in this issue: #2369

upwindchange avatar Dec 18 '25 20:12 upwindchange