Skip to content

feat(ai/v4): Record tool call errors on tool call spans in generateText and streamText #7290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2025

Conversation

AbhiPrasad
Copy link
Contributor

This is a backport of #7033

@AbhiPrasad AbhiPrasad changed the title feat(ai): Record tool call errors on tool call spans in generateText and streamText feat(ai/v4): Record tool call errors on tool call spans in generateText and streamText Jul 14, 2025
…` and `streamText` (vercel#7033)

Although the `recordSpan` helper does record errors on recorded spans,
in the case of tool call spans it was not being triggered. This was
causing confusion from users who depended on this status change to get
insights about tool call usage error rates. This change was done for
tool calls used by both `generateText` and `streamText`.

This PR updates these spans so that they get error statuses accordingly
by updating the places where `name: 'ai.toolCall'` spans are called.

This was manually verified in an example app.

ref vercel#6673
resolves getsentry/sentry-javascript#16748

---------

Signed-off-by: Abhijeet Prasad <aprasad@sentry.io>
@AbhiPrasad AbhiPrasad force-pushed the abhi-tool-call-errors-v4-ai-sdk branch from c504601 to fe3d9e8 Compare July 14, 2025 19:01
@lgrammel lgrammel merged commit 849af1c into vercel:v4 Jul 15, 2025
7 of 8 checks passed
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.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy