---
title: "Discussion on \"Why did my AI chat stop? Using stoppedBy from AI SDK 7 in a React chat\" | Hashnode"
description: "Discussion on \"Why did my AI chat stop? Using stoppedBy from AI SDK 7 in a React chat\". By the Cuelark Team. Details come from the Vercel AI SDK release notes and docs, checked on 27 November 2026. We didn't call a real model. Everything below ran against MockLanguageModelV4 from ai/test"
url: "https://hashnode.com/posts/why-did-my-ai-chat-stop-using-stoppedby-from-ai-sdk-7-in-a-react-chat/6b090d138f611094af14c799"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Why did my AI chat stop? Using stoppedBy from AI SDK 7 in a React chat](https://cuelark.hashnode.dev/why-did-my-ai-chat-stop-using-stoppedby-from-ai-sdk-7-in-a-react-chat?utm_source=hashnode&utm_medium=feed)

By the Cuelark Team. Details come from the Vercel AI SDK release notes and docs, checked on 27 November 2026. We didn't call a real model. Everything below ran against MockLanguageModelV4 from ai/test

4d ago · 6 min read · cuelark.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#ai](https://hashnode.com/tag/ai)
-   [#react](https://hashnode.com/tag/react)
-   [#nextjs](https://hashnode.com/tag/nextjs)

## Written by

[Cuelark](https://hashnode.com/@cuelark)

@cuelark

  
[View profile](https://hashnode.com/@cuelark)

Open-source React components for AI agent interfaces, built for shadcn/ui.

Open-source React components for AI agent interfaces, built for shadcn/ui.

## Responses 1

Markdown supported · ⌘↵ to post

[Mateo Ruiz](https://hashnode.com/@mateoruiz)

[4d ago](https://hashnode.com/posts/why-did-my-ai-chat-stop-using-stoppedby-from-ai-sdk-7-in-a-react-chat/6b090d138f611094af14c799/comment/6b090f9e5f7c455084abff51)

The distinction between `finishReason` and `stoppedBy` is important because a stopped tool loop is not necessarily a completed assistant response. One additional edge case I'd account for is continuation safety: since "Continue" creates a new turn with the full history, the server should verify which tool calls have already executed and which are still awaiting approval. Otherwise, resuming a workflow could unintentionally repeat a side effect.

I'd also keep `undefined` as a genuinely unknown state rather than silently treating it as normal completion. That makes mixed SDK versions and partially migrated agents much easier to handle safely. In production chat systems, execution state, approval state, and presentation state are separate concerns, and keeping those distinctions explicit prevents confusing UI behavior and duplicate operations.
