Repository navigation
fix(server-utils): update Vercel AI decide span naming #25275
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -188,7 +188,7 @@ describe('instrumentWorkersAiClient', () => { | |
| expect(span.description).toBe('evaluate typesafe/jev'); | ||
| expect(span.data).toEqual({ | ||
| [SENTRY_ORIGIN]: 'auto.ai.cloudflare.workers_ai', | ||
| [SENTRY_OP]: 'gen_ai.evaluate', | ||
| [SENTRY_OP]: 'gen_ai.decide', | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unrelated tests expect decide opMedium Severity Workers AI, TypeSafe, and Cloudflare tests now assert Additional Locations (2)Triggered by project rule: PR Review Guidelines for Cursor Bot Reviewed by Cursor Bugbot for commit fc960e9. Configure here. |
||
| [SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: 1, | ||
| [SENTRY_SEGMENT_NAME_SOURCE]: 'custom', | ||
| [GEN_AI_PROVIDER_NAME]: 'cloudflare.workers_ai', | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,8 +27,7 @@ describe('Vercel AI evaluate spans', () => { | |
| getMainCarrier().__SENTRY__ = undefined; | ||
| }); | ||
|
|
||
| // `ai` 7.0.128 renamed the channel event from `experimental_evaluate` to `experimental_decide`. | ||
| it.each(['experimental_evaluate', 'experimental_decide'] as const)('creates an evaluate span for `%s`', type => { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unit test leaves type unboundMedium Severity The Triggered by project rule: PR Review Guidelines for Cursor Bot Reviewed by Cursor Bugbot for commit fc960e9. Configure here. |
||
| it('creates a decide span for `experimental_decide`', () => { | ||
| const message = { | ||
| type, | ||
| event: { | ||
|
|
@@ -49,7 +48,7 @@ describe('Vercel AI evaluate spans', () => { | |
|
|
||
| const json = spanToStaticSpanJSON(endedSpans[0]!); | ||
| expect(json.description).toBe('evaluate typesafe-ai/jev'); | ||
| expect(json.op).toBe('gen_ai.evaluate'); | ||
| expect(json.op).toBe('gen_ai.decide'); | ||
| expect(JSON.parse(json.data?.['gen_ai.output.messages'] as string)).toEqual([ | ||
| { type: 'evaluation', answers: { wantsRefund: { type: 'boolean', probability: 0.99 } } }, | ||
| ]); | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old evaluate channel events ignored
High Severity
experimental_evaluatewas dropped from the channel type, the start switch, andgetOutputMessages. Older supportedai7.x versions still publish that event name, so those decide/evaluate calls no longer create spans or record evaluation output messages.Additional Locations (2)
packages/server-utils/src/integrations/vercel-ai/vercel-ai-dc-subscriber.ts#L485-L487packages/server-utils/src/integrations/vercel-ai/vercel-ai-dc-subscriber.ts#L687-L689Reviewed by Cursor Bugbot for commit fc960e9. Configure here.