1- import { beforeEach , describe , expect , test } from 'vitest' ;
21import { _INTERNAL_getSpanContextForToolCallId , _INTERNAL_toolCallSpanContextMap } from '@sentry/core' ;
2+ import { beforeEach , describe , expect , test } from 'vitest' ;
33import {
4+ checkResultForToolErrors ,
45 determineRecordingSettings ,
5- _INTERNAL_checkResultForToolErrors ,
66} from '../../../../src/integrations/tracing/vercelai/instrumentation' ;
77
88describe ( 'determineRecordingSettings' , ( ) => {
@@ -226,7 +226,7 @@ describe('checkResultForToolErrors', () => {
226226 _INTERNAL_toolCallSpanContextMap . set ( 'tool-1' , { traceId : 't1' , spanId : 's1' } ) ;
227227 _INTERNAL_toolCallSpanContextMap . set ( 'tool-2' , { traceId : 't2' , spanId : 's2' } ) ;
228228
229- _INTERNAL_checkResultForToolErrors ( {
229+ checkResultForToolErrors ( {
230230 content : [ { type : 'tool-result' , toolCallId : 'tool-1' , toolName : 'bash' } ] ,
231231 } ) ;
232232
@@ -238,7 +238,7 @@ describe('checkResultForToolErrors', () => {
238238 test ( 'cleans up span context map on tool-error' , ( ) => {
239239 _INTERNAL_toolCallSpanContextMap . set ( 'tool-1' , { traceId : 't1' , spanId : 's1' } ) ;
240240
241- _INTERNAL_checkResultForToolErrors ( {
241+ checkResultForToolErrors ( {
242242 content : [ { type : 'tool-error' , toolCallId : 'tool-1' , toolName : 'bash' , error : new Error ( 'fail' ) } ] ,
243243 } ) ;
244244
@@ -249,7 +249,7 @@ describe('checkResultForToolErrors', () => {
249249 _INTERNAL_toolCallSpanContextMap . set ( 'tool-1' , { traceId : 't1' , spanId : 's1' } ) ;
250250 _INTERNAL_toolCallSpanContextMap . set ( 'tool-2' , { traceId : 't2' , spanId : 's2' } ) ;
251251
252- _INTERNAL_checkResultForToolErrors ( {
252+ checkResultForToolErrors ( {
253253 content : [
254254 { type : 'tool-result' , toolCallId : 'tool-1' , toolName : 'bash' } ,
255255 { type : 'tool-error' , toolCallId : 'tool-2' , toolName : 'bash' , error : new Error ( 'fail' ) } ,
@@ -261,7 +261,7 @@ describe('checkResultForToolErrors', () => {
261261 } ) ;
262262
263263 test ( 'does not throw for tool-error with unknown toolCallId' , ( ) => {
264- _INTERNAL_checkResultForToolErrors ( {
264+ checkResultForToolErrors ( {
265265 content : [ { type : 'tool-error' , toolCallId : 'unknown' , toolName : 'bash' , error : new Error ( 'fail' ) } ] ,
266266 } ) ;
267267
@@ -271,9 +271,9 @@ describe('checkResultForToolErrors', () => {
271271 test ( 'ignores results without content array' , ( ) => {
272272 _INTERNAL_toolCallSpanContextMap . set ( 'tool-1' , { traceId : 't1' , spanId : 's1' } ) ;
273273
274- _INTERNAL_checkResultForToolErrors ( { } ) ;
275- _INTERNAL_checkResultForToolErrors ( null ) ;
276- _INTERNAL_checkResultForToolErrors ( { content : 'not-an-array' } ) ;
274+ checkResultForToolErrors ( { } ) ;
275+ checkResultForToolErrors ( null ) ;
276+ checkResultForToolErrors ( { content : 'not-an-array' } ) ;
277277
278278 // Map should be untouched
279279 expect ( _INTERNAL_getSpanContextForToolCallId ( 'tool-1' ) ) . toEqual ( { traceId : 't1' , spanId : 's1' } ) ;
0 commit comments