---
title: "Comment by Mateo Ruiz on \"Why did my AI chat stop? Using stoppedBy from AI SDK 7 in a React chat\" | Hashnode"
description: "The distinction between finishReason and stoppedBy is important because a stopped tool loop is not necessarily a completed assistant response. One additional ed"
url: "https://hashnode.com/posts/why-did-my-ai-chat-stop-using-stoppedby-from-ai-sdk-7-in-a-react-chat/6b090d138f611094af14c799/comment/6b090f9e5f7c455084abff51"
---

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

Comment [Why did my AI chat stop? Using stoppedBy from AI SDK 7 in a React chat](https://hashnode.com/posts/why-did-my-ai-chat-stop-using-stoppedby-from-ai-sdk-7-in-a-react-chat/6b090d138f611094af14c799)

[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.
