Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update with internal prefix
  • Loading branch information
RulaKhaled committed Aug 25, 2025
commit 71c96433847c3189832425b9d2181b9a5498165a
2 changes: 1 addition & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export type { ReportDialogOptions } from './report-dialog';
export { _INTERNAL_captureLog, _INTERNAL_flushLogsBuffer, _INTERNAL_captureSerializedLog } from './logs/exports';
export { consoleLoggingIntegration } from './logs/console-integration';
export { addVercelAiProcessors } from './utils/vercel-ai';
export { getSpanForToolCallId, cleanupToolCallSpan } from './utils/vercel-ai/utils';
export { _INTERNAL_getSpanForToolCallId, _INTERNAL_cleanupToolCallSpan } from './utils/vercel-ai/utils';
export { instrumentOpenAiClient } from './utils/openai';
export { OPENAI_INTEGRATION_NAME } from './utils/openai/constants';
export type { OpenAiClient, OpenAiOptions, InstrumentedMethod } from './utils/openai/types';
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/utils/vercel-ai/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ export function applyAccumulatedTokens(
/**
* Get the span associated with a tool call ID
*/
export function getSpanForToolCallId(toolCallId: string): Span | undefined {
export function _INTERNAL_getSpanForToolCallId(toolCallId: string): Span | undefined {
return toolCallSpanMap.get(toolCallId);
}

/**
* Clean up the span mapping for a tool call ID
*/
export function cleanupToolCallSpan(toolCallId: string): void {
export function _INTERNAL_cleanupToolCallSpan(toolCallId: string): void {
toolCallSpanMap.delete(toolCallId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import type { Span } from '@sentry/core';
import {
addNonEnumerableProperty,
captureException,
cleanupToolCallSpan,
_INTERNAL_cleanupToolCallSpan,
getActiveSpan,
getCurrentScope,
getSpanForToolCallId,
_INTERNAL_getSpanForToolCallId,
handleCallbackErrors,
SDK_VERSION,
withScope,
Expand Down Expand Up @@ -84,7 +84,7 @@ function checkResultForToolErrors(result: unknown | Promise<unknown>): void {
for (const item of resultObj.content) {
if (isToolError(item)) {
// Try to get the span associated with this tool call ID
const associatedSpan = getSpanForToolCallId(item.toolCallId) as Span;
const associatedSpan = _INTERNAL_getSpanForToolCallId(item.toolCallId) as Span;

if (associatedSpan) {
// We have the span, so link the error using span and trace IDs from the span
Expand Down Expand Up @@ -112,7 +112,7 @@ function checkResultForToolErrors(result: unknown | Promise<unknown>): void {

// Clean up the span mapping since we've processed this tool error
// We won't get multiple { type: 'tool-error' } parts for the same toolCallId.
cleanupToolCallSpan(item.toolCallId);
_INTERNAL_cleanupToolCallSpan(item.toolCallId);
} else {
// Fallback: capture without span linking
withScope(scope => {
Expand Down
Loading