Skip to content

fix: Support finishReason in both new and old versions of ai-sdk - #7568

Closed
alexgleason wants to merge 1 commit into
anomalyco:devfrom
alexgleason:finish-reason
Closed

fix: Support finishReason in both new and old versions of ai-sdk#7568
alexgleason wants to merge 1 commit into
anomalyco:devfrom
alexgleason:finish-reason

Conversation

@alexgleason

@alexgleason alexgleason commented Jan 10, 2026

Copy link
Copy Markdown

What does this PR do?

Enables both new and old versions of ai-sdk providers to work with the new finishReason property introduced in vercel/ai#11338

Fixes #7439 #7674

How did you verify your code works?

I created a custom npm package based on @ai-sdk/openai-compatible. Before the change I was getting a zod error. After the change it works.

@github-actions

Copy link
Copy Markdown
Contributor

Hey! Your PR title Support finishReason in both new and old versions of ai-sdk doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@alexgleason alexgleason changed the title Support finishReason in both new and old versions of ai-sdk fix: Support finishReason in both new and old versions of ai-sdk Jan 10, 2026
@tzssangglass

Copy link
Copy Markdown

work for me, I built opencode with this PR locally, and no more errors like: #7439

@github-actions

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions Bot closed this Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AIHubMix provider: streaming completes output but errors near end with ZodError (invalid_union: reason/part/delta)

2 participants